Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 286839 - media-sound/pulseaudio: udev autodetection module doesn't work (ALSA, kernel, or what?)
Summary: media-sound/pulseaudio: udev autodetection module doesn't work (ALSA, kernel,...
Status: VERIFIED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-28 19:45 UTC by Fabio Erculiani (RETIRED)
Modified: 2009-09-29 09:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info.txt,5.50 KB, text/plain)
2009-09-28 19:47 UTC, Fabio Erculiani (RETIRED)
Details
uname -a (kernel is based on gentoo-sources w/tuxonice patches) (uname,139 bytes, text/plain)
2009-09-28 19:48 UTC, Fabio Erculiani (RETIRED)
Details
dmesg output (dmesg,27.09 KB, text/plain)
2009-09-28 19:49 UTC, Fabio Erculiani (RETIRED)
Details
lspci -vvv output (lspci,4.96 KB, text/plain)
2009-09-28 19:49 UTC, Fabio Erculiani (RETIRED)
Details
lsmod output (lsmod,1.55 KB, text/plain)
2009-09-28 19:49 UTC, Fabio Erculiani (RETIRED)
Details
here it is, thanks! (pulseaudio_-k_--loglevel_debug.txt,91.89 KB, text/plain)
2009-09-28 20:38 UTC, Fabio Erculiani (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 19:45:27 UTC
Pulseaudio udev module doesn't seem to work properly here. alsa-sink module seems loaded but then, using ALSA and PA afterwards to play sound causes the latter to make your sound app hanging indefinitely.

To workaround this issue I just enabled alsa-sink module in default.pa.

I'm attaching some logs. Kernel is 2.6.31, Gentoo unstable. Currently using PA 0.9.17, let me know if I should update to 0.9.18.

Reproducible: Always

Steps to Reproduce:
How I reproduced:

1. make sure you're using PA udev autodetection module and disable "load-module module-alsa-sink" from default.pa
2. Fire up Audacious (make sure it's using PA output)
3. Fire up Firefox and load a YT video, play the video
4. Play music in Audacious
5. See Audacious hang
Comment 1 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 19:47:30 UTC
Created attachment 205533 [details]
emerge --info
Comment 2 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 19:48:55 UTC
Created attachment 205535 [details]
uname -a (kernel is based on gentoo-sources w/tuxonice patches)
Comment 3 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 19:49:10 UTC
Created attachment 205537 [details]
dmesg output
Comment 4 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 19:49:25 UTC
Created attachment 205539 [details]
lspci -vvv output
Comment 5 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 19:49:40 UTC
Created attachment 205541 [details]
lsmod output
Comment 6 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 19:53:36 UTC
This is the error when manually launching PA (and doing all the procedure listed in #0):

E: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
E: alsa-sink.c: Error opening PCM device front:0: Device or resource busy

I can collect any further information or give ssh access to the box.
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-09-28 19:58:35 UTC
Well, that's obvious: Firefox got exclusive access to the device. It's the same as if there wasn't pulseaudio and Audacious were to use the ALSA device directly: they cannot.

You need to set up ALSA to output to PulseAudio, or use libflashsupport to output directly to Pulse.

        if use alsa; then
                local pkg="media-plugins/alsa-plugins"
                if has_version ${pkg} && ! built_with_use --missing false ${pkg} pulseaudio; then
                        elog
                        elog "You have alsa support enabled so you probably want to install"
                        elog "${pkg} with pulseaudio support to have"
                        elog "alsa using applications route their sound through pulseaudio"
                fi
        fi
Comment 8 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 20:07:51 UTC
I know that, and I also have libflashsupport installed.
Comment 9 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 20:10:56 UTC
As I told you: enabling alsa-sink module _fixes_ the issue.
So it's NOT libflashsupport.
Comment 10 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-09-28 20:16:59 UTC
Then post the pulseaudio log file.
Comment 11 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 20:38:38 UTC
Created attachment 205543 [details]
here it is, thanks!
Comment 12 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 20:40:47 UTC
Here's what I've done so far (to collect the log):

- launched (as user) pulseaudio -k --log-level=debug
- launched Audacious2
- launched Firefox and played a YT video
- played a song on Audacious2 (which hanged until timeout)
- closed Audacious2
- closed Firefox
Comment 13 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-09-28 20:48:23 UTC
Your Firefox is still accessing alsa directly:

I: module-suspend-on-idle.c: Source alsa_input.pci-0000_00_05.0.analog-stereo idle for too long, suspending ...
D: source.c: Suspend cause of source alsa_input.pci-0000_00_05.0.analog-stereo is 0x0004, suspending
I: alsa-source.c: Device suspended...
I: module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_05.0.analog-stereo idle for too long, suspending ...
D: sink.c: Suspend cause of sink alsa_output.pci-0000_00_05.0.analog-stereo is 0x0004, suspending
I: alsa-sink.c: Device suspended...
[snip]
I: alsa-sink.c: Trying resume...
E: alsa-sink.c: Error opening PCM device front:0: Device or resource busy


Have you configured /etc/asound.conf to output by default on PulseAudio? It really shouldn't matter whether alsa is loaded manually or through udev, but the suspension is going to free the device for enough time for Firefox to open it.
Comment 14 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 20:52:30 UTC
No, I have no /etc/asound.conf.
From my PA-ignorant POV, I was able to workaround and make all working by just manually enabling the alsa-sink module. I got your point though, but still, that seems to fix it.
Do you want me to provide logs with alsa-sink module manually enabled in default.pa?

Thanks
Comment 15 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-09-28 20:56:17 UTC
No I don't really care to be honest, since the issue is the usual "somebody stole my device" problem.

Just google around for "pulseaudio perfect setup" and you'll see what you have to do; which is, by the way, configuring the alsa-plugins[pulseaudio] thing which I noted in Comment #7.
Comment 16 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 21:12:45 UTC
I think you're still missing the fact that enabling alsa-sink modules makes fixes every single issue. But I understand you're the PA dev and ebuild maintainer.
Comment 17 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-28 21:13:28 UTC
(In reply to comment #16)
> I think you're still missing the fact that enabling alsa-sink modules makes
> fixes every single issue. But I understand you're the PA dev and ebuild
> maintainer.
> 

s/s makes//

Comment 18 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-09-28 21:16:38 UTC
Seriously, if that workaround works for you (for whatever reason), it's going to break for 10 more users. I'm not going to start adding a number of different workarounds for problems that are configuration problems.

If you feel like spending some time on something useful, we _could_ use a Gentoo-specific PulseAudio documentation; it has been in my TODO list for a while but I have nowhere near enough time for that.
Comment 19 Fabio Erculiani (RETIRED) gentoo-dev 2009-09-29 09:57:32 UTC
I still think there's something wrong somewhere (perhaps in the udev module?), because as you said, alsa-sink is automatically enabled by the udev module and thus, this shouldn't make any diff.
Instead, it seems to make the diff here, because manually enabling alsa-sink makes Firefox(flash), and any other app using PA happy.
Maybe I failed at explaining things better, but all this means that (maybe only with some particular devices or what -- issue reproduced inside virtualbox) media-sound/pulseaudio is not shipping with default config working out of the box, or at least in a basic way.
I'm sure it is a bug somewhere but as I said, i'm not a PA expert at the moment but I think to be smart enough to understand that there's still something wrong. Closing with "INVALID" doesn't help solving issues.

And yes, it could be a config issue that is masking a software issue. Why am I supposed to enable alsa-sink if you said that it is taken care by udev module?

Don't get me wrong, I'm not criticizing you and PA, I just, would like to make sure it's not a bug somewhere, that is.