Ticket #426 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

yet another Error opening PCM device hw:0: Device or resource busy

Reported by: tetromino Owned by: lennart
Milestone: Component: daemon
Keywords: Cc:

Description

This might look like a duplicate of #138 or #311, but I promise it's different: AFAIKT I am not loading module-detect and I am only loading module-alsa-sink one time.

I am using a Lenovo SL300. The sound card and alsa work correctly (tested with aplay and gstreamer-based applications). However, with no processes using the sound card (according to lsof), when I try to run pulseaudio-0.9.13, I get:

$ pulseaudio -vvvvvv
I: caps.c: Dropping root priviliges.
D: main.c: Started as real root: no, suid root: yes
I: main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
W: main.c: High-priority scheduling enabled in configuration but not allowed by policy.
W: core-util.c: setpriority(): Permission denied
D: main.c: Can realtime: no, can high-priority: no
W: ltdl-bind-now.c: Failed to find original dlopen loader.
I: main.c: This is PulseAudio 0.9.13
D: main.c: Compilation host: x86_64-pc-linux-gnu
D: main.c: Compilation CFLAGS: -march=native -O2 -pipe -UNDEBUG -Wall -W -Wextra -pedantic -pipe -Wno-long-long -Wvla -Wno-overlength-strings -Wconversion -Wundef -Wformat -Wlogical-op -Wpacked -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-unused-parameter -ffast-math
D: main.c: Running on host: Linux x86_64 2.6.27-gentoo-r4 #5 SMP PREEMPT Sun Nov 30 13:14:19 EST 2008
I: main.c: Page size is 4096 bytes
D: main.c: Compiled with Valgrind support: no
D: main.c: Running in valgrind mode: no
D: main.c: Optimized build: yes
I: main.c: Machine ID is 116729070bd2e5a352042c6649311566.
I: main.c: Using runtime directory /home/rostovts/.pulse/116729070bd2e5a352042c6649311566:runtime.
I: main.c: Using state directory /home/rostovts/.pulse.
I: main.c: Running in system mode: no
I: main.c: Fresh high-resolution timers available! Bon appetit!
D: memblock.c: Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB
D: cli-command.c: Checking for existance of '/usr/lib64/pulse-0.9/modules/module-hal-detect.so': success
I: module-hal-detect.c: Trying capability alsa
D: module-hal-detect.c: Not loaded device /org/freedesktop/Hal/devices/computer_alsa_timer
D: module-hal-detect.c: Not loaded device /org/freedesktop/Hal/devices/computer_alsa_sequencer
D: module-hal-detect.c: Not loaded device /org/freedesktop/Hal/devices/pci_8086_293e_sound_card_0_alsa_playback_1
D: module-hal-detect.c: Loading module-alsa-sink with arguments 'device_id=0 sink_name=alsa_output.pci_8086_293e_sound_card_0_alsa_playback_0 tsched=1'
D: alsa-util.c: Trying front:0...
I: alsa-util.c: Couldn't open PCM device front:0: Device or resource busy
D: alsa-util.c: Trying surround40:0...
I: alsa-util.c: Couldn't open PCM device surround40:0: Device or resource busy
D: alsa-util.c: Trying surround41:0...
I: alsa-util.c: Couldn't open PCM device surround41:0: Device or resource busy
D: alsa-util.c: Trying surround50:0...
I: alsa-util.c: Couldn't open PCM device surround50:0: Device or resource busy
D: alsa-util.c: Trying surround51:0...
I: alsa-util.c: Couldn't open PCM device surround51:0: Device or resource busy
D: alsa-util.c: Trying surround71:0...
I: alsa-util.c: Couldn't open PCM device surround71:0: Device or resource busy
D: alsa-util.c: Trying hw:0 as last resort...
D: alsa-util.c: Trying hw:0...
E: alsa-util.c: Error opening PCM device hw:0: Device or resource busy
E: module.c: Failed to load  module "module-alsa-sink" (argument: "device_id=0 sink_name=alsa_output.pci_8086_293e_sound_card_0_alsa_playback_0 tsched=1"): initialization failed.
D: module-hal-detect.c: Not loaded device /org/freedesktop/Hal/devices/pci_8086_293e_sound_card_0_alsa_playback_0
D: module-hal-detect.c: Loading module-alsa-source with arguments 'device_id=0 source_name=alsa_input.pci_8086_293e_sound_card_0_alsa_capture_0 tsched=1'
D: alsa-util.c: Trying front:0...
D: alsa-util.c: Maximum hw buffer size is 371 ms
I: module-alsa-source.c: Successfully opened device front:0.
I: module-alsa-source.c: Successfully enabled mmap() mode.
I: module-alsa-source.c: Successfully enabled timer-based scheduling mode.
I: (alsa-lib)control.c: Invalid CTL front:0
I: alsa-util.c: Unable to attach to mixer front:0: No such file or directory
I: alsa-util.c: Successfully attached to mixer 'hw:0'
I: alsa-util.c: Cannot find mixer control "Capture".
W: alsa-util.c: Cannot find fallback mixer control "Mic".
I: source.c: Created source 0 "alsa_input.pci_8086_293e_sound_card_0_alsa_capture_0" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: module-alsa-source.c: Using 2 fragments of size 32768 bytes, buffer time is 371.52ms
I: module-alsa-source.c: Time scheduling watermark is 20.00ms
D: module-alsa-source.c: hwbuf_unused_frames=0
D: module-alsa-source.c: setting avail_min=62005
D: alsa-util.c: snd_pcm_dump():
D: alsa-util.c: Soft volume PCM
D: alsa-util.c: Control: PCM Playback Volume
D: alsa-util.c: min_dB: -51
D: alsa-util.c: max_dB: 0
D: alsa-util.c: resolution: 256
D: alsa-util.c: Its setup is:
D: alsa-util.c:   stream       : CAPTURE
D: alsa-util.c:   access       : MMAP_INTERLEAVED
D: alsa-util.c:   format       : S16_LE
D: alsa-util.c:   subformat    : STD
D: alsa-util.c:   channels     : 2
D: alsa-util.c:   rate         : 44100
D: alsa-util.c:   exact rate   : 44100 (44100/1)
D: alsa-util.c:   msbits       : 16
D: alsa-util.c:   buffer_size  : 16384
D: alsa-util.c:   period_size  : 8192
D: alsa-util.c:   period_time  : 185759
D: alsa-util.c:   tstamp_mode  : NONE
D: alsa-util.c:   period_step  : 1
D: alsa-util.c:   avail_min    : 62005
D: alsa-util.c:   period_event : 0
D: alsa-util.c:   start_threshold  : -1
D: alsa-util.c:   stop_threshold   : -1
D: alsa-util.c:   silence_threshold: 0
D: alsa-util.c:   silence_size : 0
D: alsa-util.c:   boundary     : 4611686018427387904
D: alsa-util.c: Slave: Hardware PCM card 0 'HDA Intel' device 0 subdevice 0
D: alsa-util.c: Its setup is:
D: alsa-util.c:   stream       : CAPTURE
D: alsa-util.c:   access       : MMAP_INTERLEAVED
D: alsa-util.c:   format       : S16_LE
D: alsa-util.c:   subformat    : STD
D: alsa-util.c:   channels     : 2
D: alsa-util.c:   rate         : 44100
D: alsa-util.c:   exact rate   : 44100 (44100/1)
D: alsa-util.c:   msbits       : 16
D: alsa-util.c:   buffer_size  : 16384
D: alsa-util.c:   period_size  : 8192
D: alsa-util.c:   period_time  : 185759
D: alsa-util.c:   tstamp_mode  : NONE
D: alsa-util.c:   period_step  : 1
D: alsa-util.c:   avail_min    : 62005
D: alsa-util.c:   period_event : 0
D: alsa-util.c:   start
D: module-alsa-source.c: Thread starting up
D: rtpoll.c: Acquired POSIX realtime signal SIGRTMIN+29
I: module.c: Loaded "module-alsa-source" (index: #0; argument: "device_id=0 source_name=alsa_input.pci_8086_293e_sound_card_0_alsa_capture_0 tsched=1").
D: module-hal-detect.c: Not loaded device /org/freedesktop/Hal/devices/pci_8086_293e_sound_card_0_alsa_hw_specific_2
D: module-hal-detect.c: Not loaded device /org/freedesktop/Hal/devices/pci_8086_293e_sound_card_0_alsa_hw_specific_0
D: module-hal-detect.c: Not loaded device /org/freedesktop/Hal/devices/pci_8086_293e_sound_card_0_alsa_control__1
I: module-hal-detect.c: Loaded 1 modules.
I: module.c: Loaded "module-hal-detect" (index: #1; argument: "").
D: cli-command.c: Checking for existance of '/usr/lib64/pulse-0.9/modules/module
-esound-protocol-unix.so': success
I: module.c: Loaded "module-esound-protocol-unix" (index: #2; argument: "").
I: module.c: Loaded "module-native-protocol-unix" (index: #3; argument: "").
D: module-zeroconf-publish.c: Publishing services in Zeroconf

So it looks like pulseaudio can load alsa source, but for some reason cannot load alsa sinks...

Change History

follow-up: ↓ 2   Changed 3 years ago by lennart

  • status changed from new to closed
  • resolution set to invalid

Some other application is apparently blocking access to the audio device and hence PA cannot access it anymore. Use "fuser -v /dev/snd/* /dev/dsp*" to find out which one it is.

in reply to: ↑ 1   Changed 3 years ago by tetromino

Replying to lennart:

Some other application is apparently blocking access to the audio device and hence PA cannot access it anymore. Use "fuser -v /dev/snd/* /dev/dsp*" to find out which one it is.

Thank you, you are correct. It turned out that Gnome was automatically starting esound (despite the fact that I had configured it not to do so); making /usr/bin/esd into a symlink to /usr/bin/esdcompat (on gentoo, it's "eselect esd set PulseAudio") fixed the problem.

  Changed 3 years ago by coling

FYI tetromino, if the esound libraries do not find an /etc/esd.conf they will turn on autospawning by default (even although the default esd.conf has it turned off). That means that if an esound client tries to play audio, libesound will try and launch /usr/bin/esd... It could be that were hit by auto-spawning.

That's why my mandriva packages ship an esd.conf file with pulseaudio... just to make sure auto-spawn is turned off!

Note: See TracTickets for help on using tickets.