Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
YAAP - Alsa OSS is killing me too
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
axelmasok
Apprentice
Apprentice


Joined: 08 Oct 2003
Posts: 171

PostPosted: Wed Mar 15, 2006 1:20 am    Post subject: YAAP - Alsa OSS is killing me too Reply with quote

Now someone give it to me straight. I want answers from those who have actually spent half their lives fighting Alsa/OSS.
I have used Linux for about 10 years now, Windows-less for 3.
We all know that Linux can't do the simple stuff like play audio for the ordinary user which Windows 95 did better 11 years ago and OSX can do straight outta the box.
Like thousands of others I use software like Thunderbird(notification)/amarok/kphone/kopete(notifications)/kplayer and occasionally Skype.
I'll tell you you now that I like many others have to start and stop these to use them as most of them can't use the audio devices I have at the same time. I know your nodding at me. Most of us know alsa/arts/gstreamer/jack/oss/esound. All of the above use combinations of these. I have had enough. I have a Via ac97 onboard sound device and a USB headset.

- Is it possible to actually get to the stage where all of these programs can co-exist at the same time without fighting with the sound device?
- What is it going to take to get anywhere near the target above?
- Is anyone going to actually make an effort to write or point to a complete howto to get to the target above? The Gentoo Howto/Wiki just doesn't cut it.

If I ever get reach this impossible target I swear I'll document it for all to see once and for all. No more random asoundrc files damn it!
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Wed Mar 15, 2006 2:51 am    Post subject: Reply with quote

Follow this: http://www.gentoo.org/doc/en/alsa-guide.xml

then this: http://gentoo-wiki.com/HOWTO_ALSA_simple

done.

Or for a complete guide and more: http://gentoo-wiki.com/HOWTO_ALSA_sound_mixer_aka_dmix

axelmasok wrote:
Now someone give it to me straight. I want answers from those who have actually spent half their lives fighting Alsa/OSS.

I haven't spent half my life fighting it, I followed the docs and have a decent sound card with hardware mixing. :P

axelmasok wrote:
I have used Linux for about 10 years now, Windows-less for 3.

Great.
axelmasok wrote:
We all know that Linux can't do the simple stuff like play audio for the ordinary user which Windows 95 did better 11 years ago and OSX can do straight outta the box.

Really. Windows 95 and OS X are one OS/DE. Fluxbox, Gnome, KDE, Enlightenment, etc are essentially all different systems and use different backends and have programs specifically for each. So unfair to compare it that way.
(If you you used only KDE apps and arts it should essentially be just like those other OSes)

axelmasok wrote:
- Is it possible to actually get to the stage where all of these programs can co-exist at the same time without fighting with the sound device?

All you seem to be missing is a software mixer.

axelmasok wrote:
- What is it going to take to get anywhere near the target above?

Installing and configuring ALSA with OSS emulation support and a software mixer. (I think ALSA includes dmix by default now)

axelmasok wrote:
- Is anyone going to actually make an effort to write or point to a complete howto to get to the target above? The Gentoo Howto/Wiki just doesn't cut it.

Already done.
Back to top
View user's profile Send private message
axelmasok
Apprentice
Apprentice


Joined: 08 Oct 2003
Posts: 171

PostPosted: Wed Mar 15, 2006 3:05 am    Post subject: Reply with quote

Headrush wrote:
Follow this: http://www.gentoo.org/doc/en/alsa-guide.xml

then this: http://gentoo-wiki.com/HOWTO_ALSA_simple

done.

Or for a complete guide and more: http://gentoo-wiki.com/HOWTO_ALSA_sound_mixer_aka_dmix


Ah nice.
Perhaps a simple "Yes" that would have been more helpful. Sorry, these are guides I have read already.

Lets start maybe by discussing if anyone has achieved the ability to have all OSS and ALSA apps like my list above to be able to use an audio device at the same time. Then we can discuss if a hardware mixers like this
Mixers:
0: Realtek ALC200,200P rev 0
1: USB Mixer
should handle all the mixing without using dmix? Then if thats true what does it take to make the hardware mixer actually work? Is asound.conf and asoundrc.conf obsolete? Then what ALSA device and OSS device should these apps be configured to use?

Edit: The rest of your post just showed up after I replied... weird.

OK so it looks like you have a combination of hardware and software mixer (dmix i assume).
Generally most of the apps either talk ALSA OSS or with amarok here gstreamer and alsa (what the?)
What device do you configure your alsa apps to use?
What device do you configure your OSS apps to use?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Wed Mar 15, 2006 3:32 am    Post subject: Reply with quote

axelmasok wrote:
Lets start maybe by discussing if anyone has achieved the ability to have all OSS and ALSA apps like my list above to be able to use an audio device at the same time.

Yes.
axelmasok wrote:
Then we can discuss if a hardware mixers like this
Mixers:
0: Realtek ALC200,200P rev 0
1: USB Mixer
should handle all the mixing without using dmix?

Are you asking if that chipset has hardware mixing?

axelmasok wrote:
Then if thats true what does it take to make the hardware mixer actually work?

If you can't play multiple sound without any configuring, then you DON'T have hardware mixing.

axelmasok wrote:
Is asound.conf and asoundrc.conf obsolete?

They are needed.

axelmasok wrote:
Then what ALSA device and OSS device should these apps be configured to use?

ALSA hw0,0
OSS /dev/dsp

axelmasok wrote:
OK so it looks like you have a combination of hardware and software mixer (dmix i assume).

Right now, just hardware. (Had software before)
I added a SB Live to my system which has hardware mixing so I had no use for software mxing.

axelmasok wrote:
Generally most of the apps either talk ALSA OSS or with amarok here gstreamer and alsa (what the?)

ALSA is the sound driver. OSS was the older sound drivers. ALSA has an OSS Emulation layer so older apps will work.
gstreamer, artsd, esd are sound servers and they communicate to the lower lever sound drivers. (aka ALSA)
The guides above show how to make sure gstreamer, artsd, esd all use ALSA as the underlying sound driver.

axelmasok wrote:
What device do you configure your alsa apps to use?
What device do you configure your OSS apps to use?

See above.

My guess is the mixer for the USB headset just provides controls for adjusting volumes and things like that, not for mixing signals.
(I could be wrong though)


Last edited by Headrush on Wed Mar 15, 2006 3:51 am; edited 1 time in total
Back to top
View user's profile Send private message
axelmasok
Apprentice
Apprentice


Joined: 08 Oct 2003
Posts: 171

PostPosted: Wed Mar 15, 2006 3:38 am    Post subject: Reply with quote

Quote:
All you seem to be missing is a software mixer.


Quote:
Right now, just hardware. (Had software before)


8O
Back to top
View user's profile Send private message
scorpion7700
n00b
n00b


Joined: 27 Dec 2005
Posts: 39
Location: USA

PostPosted: Fri Mar 17, 2006 2:33 am    Post subject: Reply with quote

I have an Intel "High Definition Audio Controller" in my notebook
Code:

00:1b.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)


I haven't messed with any configs, and I can't play two sounds at once. If I'm correctly understanding what you wrote, that means my card does not do hardware mixing. Is that right?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Fri Mar 17, 2006 3:19 am    Post subject: Reply with quote

scorpion7700 wrote:
I haven't messed with any configs, and I can't play two sounds at once. If I'm correctly understanding what you wrote, that means my card does not do hardware mixing. Is that right?

Right. You'll have to use a software based mixer like dmix.
Back to top
View user's profile Send private message
BitKeeper
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 109
Location: Cairns, Australia

PostPosted: Fri Mar 17, 2006 5:53 am    Post subject: Reply with quote

The ALSA homepage has info on the support of different sound cards.

http://www.alsa-project.org/alsa-doc/

You can check your sound card here to see what alsa can do with it.

BK
Back to top
View user's profile Send private message
scorpion7700
n00b
n00b


Joined: 27 Dec 2005
Posts: 39
Location: USA

PostPosted: Sat Mar 18, 2006 1:07 am    Post subject: Reply with quote

I just got it working on my machine. Thanks!
Back to top
View user's profile Send private message
lopoetve
n00b
n00b


Joined: 10 Feb 2005
Posts: 9

PostPosted: Sun Mar 19, 2006 1:13 am    Post subject: Reply with quote

I hate to say it, but I'm with axel on this one...

ALSA configuration is a real PITA, especially on Gentoo. If I need sound, sadly, since the last few versions of alsa+gentoo, I install SuSE (or compile OSS and live with the limitations) :( I've not been able to get ALSA and gentoo working for 6 months (with an Audigy2 ZS)... either built into the kernel (last time I tried this I ended up with an unbootable kernel), with the alsa drivers provided (just doesn't work), or with the alsa-driver package.

Hell, I've even tried downloading and installing the drivers straight from alsa-project.org, which is what ~used~ to get them working (circa a year ago or so), and that doesn't work.
_________________
why can't it just work?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Sun Mar 19, 2006 2:06 am    Post subject: Reply with quote

lopoetve wrote:
I hate to say it, but I'm with axel on this one...

ALSA configuration is a real PITA, especially on Gentoo. If I need sound, sadly, since the last few versions of alsa+gentoo, I install SuSE (or compile OSS and live with the limitations) :( I've not been able to get ALSA and gentoo working for 6 months (with an Audigy2 ZS)... either built into the kernel (last time I tried this I ended up with an unbootable kernel), with the alsa drivers provided (just doesn't work), or with the alsa-driver package.

Hell, I've even tried downloading and installing the drivers straight from alsa-project.org, which is what ~used~ to get them working (circa a year ago or so), and that doesn't work.

lopoetve, I couldn't find any of your posts asking for ALSA help.
Don't take this personally, but I think you might be doing something wrong if including ALSA support in your kernel, (as modules), makes your kernel unbootable something is indeed wrong.
Back to top
View user's profile Send private message
axelmasok
Apprentice
Apprentice


Joined: 08 Oct 2003
Posts: 171

PostPosted: Sun Mar 19, 2006 6:35 am    Post subject: Reply with quote

Well, here is some stuff I have found out. I have not acheived what I set out to do - still. I don't think anyone has.

Most of the good stuff lives here:
http://www.alsa-project.org/alsa-doc/doc-php/asoundrc.php

Alsa devices:
hw0:0 - 1st direct device. If you can't play more than 1 stream to this you have no hardware mixing
plughw0:0 - No idea but works like the above
dmix - the software mixing device that has been automagically setup without the need for those howtos.

So, if you point all the alsa players to the device "dmix" you might be fortunate enough to mix some audio.
Speaking of devices, there is no real way to query your system to find out what your devices are really called (well i can't find it). How good's that?
If you want to mix OSS audio then too bad, you have to read another 100 pages of howtos.
If your wondering how gstreamer and its alsasink fits in here then please tell my too. All I can work out is tell alsasink to use "dmix" too and if your lucky it will work. Same goes for xine engines etc etc.
Why can't all apps be created to use the alsa hw0 or dmix device? Who knows.
Why doesn't the Mozilla applications make use of alsa properly or at all instead of using esd? Can't help you there.
Why would the evil soundserver artsd claim to support alsa devices but not work with dmix? Haha no idea. And why would anyone seriosly have to go to the trouble of working around this by making arts use esd that then uses the alsa dmix plugin device? Say that 10 times fast.
The SIP client kphone does not support dmix and neither does it support multiple alsa devices correctly due to some wierd bugs.

Anyway, here is my config file if anyone is interested:
Code:
gentoo64 ~ # cat /home/user/.asoundrc
pcm.via82xx {
  type hw
  card 0
}
ctl.via82xx {
  type hw
  card 0
}
pcm.usb_audio {
  type hw
  card 1
}
ctl.usb_audio {
  type hw
  card 1
}
#Alias to make any app that uses the "default" device use dmix
pcm.!default {
    type plug
    slave.pcm "dmix"
}


Sound in Linux still sux and amplifies all the worst parts of opensource software unfortunately, but sometimes you have to take the bad with the good.
If anyone achieves greatness in this area please let us all know.
Back to top
View user's profile Send private message
zsitvaij
n00b
n00b


Joined: 11 Jan 2006
Posts: 74

PostPosted: Sun Mar 19, 2006 7:28 am    Post subject: Reply with quote

I have no problems at all. ALSA 1.0.10. Here are a few helpful tips:
1. Without any interference, most apps will figure out to use the default device, which is, suprise, surpise, the dmix:0 one.
2. Those that don't are easily worked around:
a. mplayer: add this line in your .mplayer/config: ao=alsa:device=dmix=0
b. using gstreamer in amarok needs plug:dmix:0 as the device. But I think it defaults to that without any hassle.
c. to use artsd in full duplex mode without it hogging the device, you can tell it to use the device duplex0, if you adapt the .asoundrc below:
Code:
pcm.ens1371 {
   type hw
   card 0
}

ctl.ens1371 {
   type hw
   card 0
}

pcm.intel8x0 {
   type hw
   card 1
}

ctl.intel8x0 {
   type hw
   card 1
}

pcm.duplex0 {
  type asym
  playback.pcm "dmix:0"
  capture.pcm "dsnoop:0"
}

pcm.duplex1 {
  type asym
  playback.pcm "dmix:1"
  capture.pcm "dsnoop:1"
}
pcm.dsp "duplex0"
pcm.dsp1 "duplex1"


d. incidentally, this also allows skype to work.
3. use your browser with aoss, eg. aoss firefox, and even the flash animations will give you sound. In full duplex, because of the last two .asoundrc lines.

Did I miss anything?

EDIT: And you DO know what your devices are. You configured them in .asoundrc. In my case, that is ens1371 and intel8x0. Accessing them using those names however bypasses dmix here.
Back to top
View user's profile Send private message
lopoetve
n00b
n00b


Joined: 10 Feb 2005
Posts: 9

PostPosted: Mon Apr 24, 2006 9:23 pm    Post subject: Reply with quote

Headrush wrote:
lopoetve wrote:
I hate to say it, but I'm with axel on this one...

ALSA configuration is a real PITA, especially on Gentoo. If I need sound, sadly, since the last few versions of alsa+gentoo, I install SuSE (or compile OSS and live with the limitations) :( I've not been able to get ALSA and gentoo working for 6 months (with an Audigy2 ZS)... either built into the kernel (last time I tried this I ended up with an unbootable kernel), with the alsa drivers provided (just doesn't work), or with the alsa-driver package.

Hell, I've even tried downloading and installing the drivers straight from alsa-project.org, which is what ~used~ to get them working (circa a year ago or so), and that doesn't work.

lopoetve, I couldn't find any of your posts asking for ALSA help.
Don't take this personally, but I think you might be doing something wrong if including ALSA support in your kernel, (as modules), makes your kernel unbootable something is indeed wrong.

No, there was something else in there that messed the kernel up, I don't blame that entirely on ALSA, but it simply stopped being worth it at that point. 20 minutes later, and 15 mouse clicks, and I had a full development box with SuSE set up, working, with working sound and options, and that's what I needed.

My posts here were under a different username (my friends, he posted for me) from some time ago. I got it working about a year and a half ago, and then when the mobo died and I got a new one, I've never gotten alsa to work since. Except with a precomiled-distro. Rather than asking the same questions over and over again, I've been following every how-to and guide and other post on here first to exhaust all the options, and that's what's gotten me so messed up, and drove me back to SuSE.

edit: and I compiled alsa into the kernel as built-in source, not as modules, when it got corrupted.
_________________
why can't it just work?
Back to top
View user's profile Send private message
CyD
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jul 2004
Posts: 117

PostPosted: Fri Apr 28, 2006 6:46 pm    Post subject: Reply with quote

axelmosk, in case you're still watching, i'll note that every via onboard chipset i've worked with has a hardware mixer. The only documentation needed to properly set up sound in gentoo is the official gentoo alsa docs. please use that as reference while reading the following:

first, sync and download new kernel:

Code:
emerge --sync
emerge gentoo-sources


remove /usr/src/linux and point to new kernel with:

Code:
cd /usr/src
ls -l
rm linux
ln -s linux-<new_kernel> linux


Code:
cd linux
make menuconfig


in kernel sound configuration, configure sound support as module; be sure to remove any in kernel alsa and oss drivers.

Code:
make && make modules_install

mount /boot
cp arch/<arch>/boot/bzImage /boot/new_kernel


modify grub accordingly:

Code:
nano -w /boot/grub/grub.conf


modify /etc/make.conf:

Code:
nano -w /etc/make.conf


add this line to the bottom and save make.conf:

Code:
ALSA_CARDS="via82xx usb-audio"




be sure oss support is included in alsa-driver:

Code:
echo media-sound/alsa-driver oss >> /etc/portage/package.use
emerge -av alsa-driver alsa-utils


here we see alsa configuration, change yours to match this:

Code:
nano -w /etc/modules.d/alsa


Code:
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
##  ALSA portion
alias snd-card-0 snd-via82xx
alias snd-card-1 snd-usb-audio
##  OSS/Free portion
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1
##

# OSS/Free portion - card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
##  OSS/Free portion - card #2
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.
options snd cards_limit=2



now:

Code:
rc-update add alsasound boot


move your .asoundrc out of the way:

Code:
mv /home/you/.asoundrc /home/you/.asoundrc.bak


reboot into better sound

be sure you have coldplug/hotplug in proper run levels to ensure proper hardware config:

Code:
rc-update add coldplug boot
rc-update add hotplug default


this guide assumes a fairly up to date gentoo, installed as per gentoo installation documentation. a fresh 2006.0 install is suggested for optimal use.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum