Bug 521866 - alsa-sink.c: Error opening PCM device front:0: Device or resource busy and process kept busy
Summary: alsa-sink.c: Error opening PCM device front:0: Device or resource busy and pr...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: pulseaudio
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-08 14:54 UTC by Amit Shah
Modified: 2009-10-21 12:06 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-10-21 12:06:27 UTC


Attachments (Terms of Use)
pacmd 'ls' output (42.20 KB, text/plain)
2009-09-08 14:54 UTC, Amit Shah
no flags Details

Description Amit Shah 2009-09-08 14:54:27 UTC
Created attachment 360090 [details]
pacmd 'ls' output

Description of problem:

I had a lot of 'play' processes hogging cpu. This happened when I had a voip call in progress on ekiga and a few alerts were sounded. Interestingly, I have alerts to 'muted' but they sounded nevertheless in this instance.

More interestingly, there was nothing in the 'output' sound preferences tab when the ekiga call had just started. Maybe pulseaudio died and came back and couldn't sync with what was happening?

I will attach pacmd 'ls' output.

Pasting /var/log/messages and top output here:

(starts from the time the ekiga call started)

/var/log/messages
Sep  8 19:36:03 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing minimal latency to 1.00 ms
Sep  8 19:36:08 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing minimal latency to 2.00 ms
Sep  8 19:36:09 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing minimal latency to 4.00 ms
Sep  8 19:36:38 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing minimal latency to 8.00 ms
Sep  8 19:37:41 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 19:37:41 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 19:37:41 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing minimal latency to 16.00 ms
Sep  8 19:37:47 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 19:37:47 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 19:37:58 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing minimal latency to 26.00 ms
Sep  8 19:39:14 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing wakeup watermark to 15.99 ms
Sep  8 19:39:36 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing minimal latency to 36.00 ms
Sep  8 19:40:14 amit-x200 pulseaudio[2237]: alsa-source.c: Increasing wakeup watermark to 25.99 ms
Sep  8 19:44:34 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 19:44:34 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 19:44:38 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 19:44:38 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 19:44:59 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 19:44:59 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 19:45:18 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 19:45:18 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 19:45:21 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 19:45:21 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.

...

Sep  8 20:11:42 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:11:42 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:11:42 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:11:43 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:12:29 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:12:29 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 20:12:33 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:12:33 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 20:14:02 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:14:02 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:14:12 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:14:12 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:14:31 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:14:31 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 20:14:32 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:14:32 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 20:15:22 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:15:22 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 20:15:30 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:15:30 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.
Sep  8 20:15:42 amit-x200 pulseaudio[2237]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Sep  8 20:15:42 amit-x200 pulseaudio[2237]: sink-input.c: Failed to create sink input: sink is suspended.


top output:

top - 20:16:23 up 10:59, 11 users,  load average: 16.50, 13.00, 7.83
Tasks: 200 total,  18 running, 182 sleeping,   0 stopped,   0 zombie
Cpu(s):  7.8%us,  3.6%sy,  0.0%ni, 87.5%id,  1.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3912008k total,  3203780k used,   708228k free,   324404k buffers
Swap:  5963768k total,     2876k used,  5960892k free,  1714916k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                        
10582 amit      20   0  346m 4196 3212 R 15.7  0.1   5:02.08 play                                                           
10661 amit      20   0  346m 4196 3212 R 13.7  0.1   2:59.62 play                                                           
10831 amit      20   0  346m 4196 3212 R 13.7  0.1   0:16.74 play                                                           
10504 amit      20   0  346m 4192 3212 R 11.8  0.1  12:02.24 play                                                           
10566 amit      20   0  346m 4196 3212 R 11.8  0.1   5:33.68 play                                                           
10700 amit      20   0  346m 4192 3212 R 11.8  0.1   2:25.91 play                                                           
10709 amit      20   0  346m 4192 3212 R 11.8  0.1   2:18.76 play                                                           
10755 amit      20   0  346m 4192 3212 R 11.8  0.1   1:33.07 play                                                           
10762 amit      20   0  346m 4192 3212 R 11.8  0.1   1:31.16 play                                                           
10800 amit      20   0  346m 4196 3212 R 11.8  0.1   0:36.04 play                                                           
10805 amit      20   0  346m 4192 3212 R 11.8  0.1   0:35.69 play                                                           
10808 amit      20   0  346m 4192 3212 R 11.8  0.1   0:36.61 play                                                           
10953 amit      20   0  346m 4196 3212 R 11.8  0.1   0:02.36 play                                                           
10835 amit      20   0  346m 4220 3240 R  9.8  0.1   0:15.42 play                                                           
10445 amit      20   0  346m 4192 3212 R  7.8  0.1  17:51.61 play                                                           
10765 amit      20   0  346m 4196 3212 R  7.8  0.1   1:26.59 play                                                           
10771 amit      20   0  346m 4192 3212 R  7.8  0.1   1:05.77 play                                                           
    1 root      20   0  4080  852  592 S  0.0  0.0   0:01.35 init

Comment 1 Amit Shah 2009-09-15 15:15:11 UTC
When this happens, pulseaudio is obviously not in use:

(from another run:)

fuser /dev/snd/*
/dev/snd/controlC0:   2233
/dev/snd/pcmC0D0c:   11999m
/dev/snd/pcmC0D0p:   11999m

2233 is pulseaudio but 11999 is ekiga.

$ rpm -q alsa-plugins-pulseaudio
alsa-plugins-pulseaudio-1.0.21-2.fc11.x86_64

I also checked running with 'padsp' but that didn't make any difference.

So there might be two bugs: one is pulseaudio hogging the cpu and second is ekiga not using pulseaudio. I don't know if the latter is an ekiga bug or a pulseaudio bug.

Comment 2 Lennart Poettering 2009-09-16 21:17:16 UTC
Whcih version of PA is this?

PA in F12 actually refuses to open an audio device that is opened by at least one other process.

In F11 we try to open the audio device each time a client wants to play something. So if you have this spinning loop here this probably means that some clients are constantly asking pa to play something?

Note that disabling "Window and Input sounds" in g-v-c does not disable all event sounds. that is what selecting the "off" theme is for.

Comment 3 Amit Shah 2009-09-17 04:24:54 UTC
pulseaudio-0.9.15-17.fc11.x86_64

What seems to be happening is ekiga claims ownership of the snd devices so centerim can't play its audio. The 'play' processes then get stuck, repeatedly trying to write to the output stream and go away. But that doesn't happen.

Also, when ekiga claims ownership of the snd devices, none of pulseaudio's settings seem to take effect: input mic volume gets restored to what ekiga sets instead of the value set from Sound Preferences. And that's also true for the event sounds, which do not get emitted when ekiga is not playing. Only when ekiga is started, the event sounds come up. (Since under Sound Preferences, event sounds are muted.)

Comment 4 Lennart Poettering 2009-10-14 21:52:57 UTC
So, it seems Ekiga is bypassing PA? Why is it doing that? Did you configure it that way? Can you make sure to configure it to use PA?

Comment 5 Amit Shah 2009-10-19 02:16:10 UTC
I haven't configured ekiga to not use PA. In fact, there's no setting that I see that mandates the use of PA in ekiga.

The Audio devices presented are:

SILENT(ekiga/ekiga)
Default(PTLIB/ALSA)
HDA INTEL(PTLIB/ALSA) (*)
HDA INTEL (1) (PTLIB/ALSA)

and I have it configured it for the one marked with the asterisk for all -- ringing device, output device and input device.

Comment 6 Adam Williamson 2009-10-20 19:53:45 UTC
I think when you specify an input or output device in Ekiga, it explicitly uses that device via ALSA, which would bypass the automatic routing of audio to and from ALSA's *default* devices to PA which we implement with /etc/alsa/pulse-default.conf . That's how I read it, anyway.

I'm not sure if there's anything PA can do about this, we can't really start intercepting apps which try to talk to ALSA directly, since there may be valid reasons for that in some circumstances.

As far as I can see the 'fix' for this is the later version of Ekiga / opal with native PA support.

Lennart, do you agree with my reading of this?

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 7 Amit Shah 2009-10-21 04:57:07 UTC
(In reply to comment #6)
> I think when you specify an input or output device in Ekiga, it explicitly uses
> that device via ALSA, which would bypass the automatic routing of audio to and
> from ALSA's *default* devices to PA which we implement with
> /etc/alsa/pulse-default.conf . That's how I read it, anyway.

Aha, that seems to be the case. I switched ekiga to use the Default device and that uses pulseaudio. I've not tested this by making a call yet, but there must be some reason why I switched to the non-default device.

I'll try making a call and report back or close the Bug.

Thanks!

Comment 8 Amit Shah 2009-10-21 12:06:27 UTC
With those settings and the new ekiga (3.6 in F11-updates), all works fine.

Thanks again!


Note You need to log in before you can comment on or make changes to this bug.