Ticket #311 (closed defect: invalid)

Opened 4 years ago

Last modified 3 years ago

Error opening PCM device hw:1: Device or resource busy

Reported by: d.paleino Owned by: lennart
Milestone: Component: daemon
Keywords: Cc:

Description

Hi, I know this might seem a duplicate of #128, but I have no applications running, no hald running, and the soundcard should be "statically detected".

I currently have two "soundcards": one is a modem, one is the effective soundcard. They get strangely detected by BIOS: one is hw:0 on time, and (randomly) on the next boot it might be hw:1... but this is another story.

I've tried to "cat file.wav >/dev/dsp1" (dsp1 being the "real" soundcard), and it works. I haven't anything sound-related running (oh, well, apart padevchooser), and ALSA is stopped.

Here's the error log:

# LANG=C pulseaudio --system=1 --high-priority=1 --daemonize=false -vvvvvv
I: core-util.c: Successfully gained nice level -11.
I: main.c: Found user 'pulse' (UID 113) and group 'pulse' (GID 122).
I: main.c: Successfully dropped root privileges.
W: main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
W: main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
I: main.c: This is PulseAudio 0.9.10
I: main.c: Page size is 4096 bytes
I: main.c: Fresh high-resolution timers available! Bon appetit!
I: module-alsa-sink.c: Successfully opened device hw:1.
I: module-alsa-sink.c: Successfully enabled mmap() mode.
I: alsa-util.c: Successfully attached to mixer 'hw:1'
I: alsa-util.c: Using mixer control "Master".
I: sink.c: Created sink 0 "alsa_output.hw_1" with sample spec "s16le 2ch 44100Hz"
I: source.c: Created source 0 "alsa_output.hw_1.monitor" with sample spec "s16le 2ch 44100Hz"
I: module-alsa-sink.c: Using 4 fragments of size 4352 bytes.
I: alsa-util.c: All 2 channels can be mapped to mixer channels. Using hardware volume control.
D: module-alsa-sink.c: Thread starting up
D: rtpoll.c: Acquired POSIX realtime signal SIGRTMIN+29
I: module-alsa-sink.c: Starting playback.
I: module.c: Loaded "module-alsa-sink" (index: #0; argument: "device=hw:1").
I: module-alsa-source.c: Successfully opened device hw:1.
I: module-alsa-source.c: Successfully enabled mmap() mode.
I: alsa-util.c: Successfully attached to mixer 'hw:1'
I: alsa-util.c: Using mixer control "Capture".
I: source.c: Created source 1 "alsa_input.hw_1" with sample spec "s16le 2ch 44100Hz"
I: module-alsa-source.c: Using 4 fragments of size 4352 bytes.
I: alsa-util.c: All 2 channels can be mapped to mixer channels. Using hardware volume control.
D: module-alsa-source.c: Thread starting up
D: rtpoll.c: Acquired POSIX realtime signal SIGRTMIN+28
I: module.c: Loaded "module-alsa-source" (index: #1; argument: "device=hw:1").
D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9/modules/module-hal-detect.so': failure
W: alsa-util.c: Device hw:0 doesn't support 44100 Hz, changed to 37286 Hz.
W: alsa-util.c: Device hw:0 doesn't support 2 channels, changed to 1.
I: module-alsa-sink.c: Successfully opened device hw:0.
I: module-alsa-sink.c: Successfully enabled mmap() mode.
I: alsa-util.c: Successfully attached to mixer 'hw:0'
I: alsa-util.c: Using mixer control "Master".
I: sink.c: Created sink 1 "alsa_output.hw_0" with sample spec "s16le 1ch 37286Hz"
I: source.c: Created source 2 "alsa_output.hw_0.monitor" with sample spec "s16le 1ch 37286Hz"
I: module-alsa-sink.c: Using 4 fragments of size 2204 bytes.
I: alsa-util.c: ALSA device lacks separate volumes control for channel 'mono', falling back to software volume control.
D: module-alsa-sink.c: Thread starting up
D: rtpoll.c: Acquired POSIX realtime signal SIGRTMIN+27
I: module-alsa-sink.c: Starting playback.
I: module.c: Loaded "module-alsa-sink" (index: #2; argument: "device=hw:0").
E: alsa-util.c: Error opening PCM device hw:1: Device or resource busy
E: module.c: Failed to load  module "module-alsa-sink" (argument: "device=hw:1"): initialization failed.
E: alsa-util.c: Error opening PCM device hw:1: Device or resource busy
E: module.c: Failed to load  module "module-alsa-source" (argument: "device=hw:1"): initialization failed.
I: module-detect.c: loaded 1 modules.
I: module.c: Loaded "module-detect" (index: #3; argument: "").
D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9/modules/module-esound-protocol-unix.so': success
E: module-protocol-stub.c: Failed to create socket directory '/tmp/.esd/socket': Operation not permitted
E: module.c: Failed to load  module "module-esound-protocol-unix" (argument: "socket="/tmp/.esd/socket""): initialization failed.
E: main.c: Module load failed.
E: main.c: Failed to initialize daemon.
I: module.c: Unloading "module-alsa-sink" (index: #0).
D: module-alsa-sink.c: Thread shutting down
I: sink.c: Freeing sink 0 "alsa_output.hw_1"
I: source.c: Freeing source 0 "alsa_output.hw_1.monitor"
I: module.c: Unloaded "module-alsa-sink" (index: #0).
I: module.c: Unloading "module-alsa-source" (index: #1).
D: module-alsa-source.c: Thread shutting down
I: source.c: Freeing source 1 "alsa_input.hw_1"
I: module.c: Unloaded "module-alsa-source" (index: #1).
I: module.c: Unloading "module-alsa-sink" (index: #2).
D: module-alsa-sink.c: Thread shutting down
I: sink.c: Freeing sink 1 "alsa_output.hw_0"
I: source.c: Freeing source 2 "alsa_output.hw_0.monitor"
I: module.c: Unloaded "module-alsa-sink" (index: #2).
I: module.c: Unloading "module-detect" (index: #3).
I: module.c: Unloaded "module-detect" (index: #3).
I: main.c: Daemon terminated.

Kindly, David

Change History

  Changed 4 years ago by tanuk

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

The "Device or resource busy" message comes when the daemon tries to load module-alsa-sink the second time for hw:1. That happens because you have module-detect loaded. Comment it out in /etc/pulse/default.pa.

However, that's not the reason the daemon fails to start up. The "fatal" failure is this line:
E: module-protocol-stub.c: Failed to create socket directory '/tmp/.esd/socket': Operation not permitted

  Changed 4 years ago by tanuk

Oh, and a tip regarding the card numbers: instead of hw:1, you can use hw:<card name> instead. The name can be found in /proc/asound/cards. For example, my /proc/asound/cards looks like this:

 0 [U61            ]: USB-Audio - USB Oxygen 61
                      M-Audio USB Oxygen 61 at usb-0000:00:10.0-1, full speed
 1 [V8237          ]: VIA8237 - VIA 8237
                      VIA 8237 with AD1980 at 0x1000, irq 22
 2 [T71Space       ]: Aureon71 - Terratec Aureon 7.1-Space
                      Terratec Aureon 7.1-Space at 0xb400, irq 19

Usually I want to refer to the Terratec card, so I use hw:T71Space.

follow-up: ↓ 4   Changed 4 years ago by d.paleino

Hi tanuk, thanks for clarifying.

Is there any way to fix this?

E: module-protocol-stub.c: Failed to create socket directory '/tmp/.esd/socket': Operation not permitted 

Thanks, David

in reply to: ↑ 3   Changed 4 years ago by coling

Replying to d.paleino:

Is there any way to fix this? {{{ E: module-protocol-stub.c: Failed to create socket directory '/tmp/.esd/socket': Operation not permitted }}}

You need to find out why it's failing. Perhaps you cannot write to the /tmp/.esd/ folder (perhaps it exists and is owned by another user?).

Also PulseAudio should be creating per-user esd socket directories since many versions ago. There is a configure option to use the global option, so perhaps you should investigate whether you have this option enabled when you compiled PulseAudio?

Also, if you do not need ESD protocol, simply don't load it :D

This kind of discussion/help is much better handled by the mailing list - Trac is a bug tracking tool, not a support tool. If you need help, please post to the mailing list or pop along to the IRC channel :)

Note: See TracTickets for help on using tickets.