module-esound-protocol-unix and ownership of /tmp/.esd directory

Bug #91494 reported by Stefan Fleiter
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PulseAudio
Won't Fix
Unknown
pulseaudio (Ubuntu)
Fix Released
Wishlist
Martin Pitt

Bug Description

Binary package hint: pulseaudio

I had pulseaudio configured to run as system daemon, which did not work correctly.
So I stopped the daemon and tried to start it as user:

sf@ID-24857:~$ pulseaudio
[..]
module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed.
[..]

So I did only know that "module-esound-protocol-unix" did not work and not why.

So I tried again with more logging:
sf@ID-24857:~$ pulseaudio --log-level=debug
main.c: WARNING: called SUID root, but not in group 'pulse-rt'.
[..]
module-protocol-stub.c: Failed to create socket directory: Operation not permitted
module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed.
[..]

Ok, a directory could not be created, but which was not said.

So since it was the esd module it was not that difficult *for me* to guess which:

sf@ID-24857:~$ ll /tmp/.esd/
insgesamt 0
srwxrwxrwx 1 pulse pulse 0 2007-03-11 19:29 socket

So the socket in /tmp.esd belonged to user pulse and could not be overwritten by my user.
So I deleted /tmp/.esd and pulseaudio started ok.

sf@ID-24857:~$ sudo rm -rf /tmp/.esd/
sf@ID-24857:~$ pulseaudio
main.c: WARNING: called SUID root, but not in group 'pulse-rt'.
alsa-util.c: device doesn't support 44100 Hz, changed to 48000 Hz.
sound-file.c: Failed to open file /usr/share/sounds/gtk-events/activate.wav
main.c: Failed to load sound file.

So here are at least 3 bugs involved:
 * Not printing the error message that the socket file could not be written without
    modifying the debugging level
 * Not printing the name of the file which could not be written
 * Insisting on exclusive rights on a directory which should be writeable by all users:
    AFAIK all users need access to /tmp/.esd for esd programs to work correctly.

I must admit I don't know how esound compatibility is intended to work in a
multiuser scenario where serveral users start a pulseaudio daemon and need
esd compatibility since there is only a single esd socket dir and so only one
pulseaudio daemon can manage it.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Similar to bug 76234.

Changed in pulseaudio:
importance: Undecided → Wishlist
status: Unconfirmed → Needs Info
Revision history for this message
Matteo Z (matteozandi) wrote : does esd works?
Download full text (4.0 KiB)

Stefan,

after the fix, does actually esd works? I have a similar problem: esd doesn't work

matteo@burnt:~$ mplayer -ao esd startup.wav
MPlayer 2:1.0~rc1-0ubuntu7 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) M processor 2.00GHz (Family: 6, Model: 13, Stepping: 8)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing startup.wav.
Audio file file format detected.
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
[AO ESD] esd_open_sound failed: No child processes
Could not open/initialize audio device -> no sound.
Usage:program_name [address][:port]Audio: no sound
Video: no video

but I have read/write permission on /tmp/.esd

matteo@burnt:~$ ls -lah /tmp/
total 48K
drwxrwxrwt 11 root root 4.0K Mar 13 16:32 .
drwxr-xr-x 21 root root 4.0K Mar 3 11:42 ..
drwxrwxrwt 2 root root 4.0K Mar 13 16:15 .ICE-unix
-r--r--r-- 1 root root 11 Mar 13 16:15 .X0-lock
drwxrwxrwt 2 root root 4.0K Mar 13 16:15 .X11-unix
drwx------ 2 matteo matteo 4.0K Mar 13 16:32 .esd
drwx------ 3 matteo matteo 4.0K Mar 13 16:15 gconfd-matteo
drwx------ 2 matteo matteo 4.0K Mar 13 16:15 keyring-vwlU2X
srwxr-xr-x 1 matteo matteo 0 Mar 13 16:15 mapping-matteo
drwx------ 2 matteo matteo 4.0K Mar 13 16:32 orbit-matteo
drwx------ 2 matteo matteo 4.0K Mar 13 16:32 pulse-matteo
drwx------ 2 matteo matteo 4.0K Mar 13 16:15 ssh-HAsXrP3169
drwx------ 2 matteo matteo 4.0K Mar 13 16:15 virtual-matteo.GN164Z
matteo@burnt:~$ ls -lah /tmp/.esd/
total 8.0K
drwx------ 2 matteo matteo 4.0K Mar 13 16:32 .
drwxrwxrwt 11 root root 4.0K Mar 13 16:32 ..
srwxrwxrwx 1 matteo matteo 0 Mar 13 16:32 socket

I don't find any errors if I start pulseaudio manually

matteo@burnt:~$ pulseaudio --log-level=debug
caps.c: dropping root rights.
module-hal-detect.c: Trying capability 0 (alsa)
alsa-util.c: Using mixer control "PCM".
sink.c: created 0 "alsa_output.pci_8086_266e_alsa_playback_0" with sample spec "s16le 2ch 44100Hz"
source.c: created 0 "alsa_output.pci_8086_266e_alsa_playback_0.monitor" with sample spec "s16le 2ch 44100Hz"
module-alsa-sink.c: using 8 fragments of size 1376 bytes.
module.c: Loaded "module-alsa-sink" (index: #0; argument: "device=hw:0 sink_name=alsa_output.pci_8086_266e_alsa_playback_0").
alsa-util.c: Using mixer control "Capture".
source.c: created 1 "alsa_input.pci_8086_266e_alsa_capture_0" with sample spec "s16le 2ch 44100Hz"
module-alsa-source.c: using 12 fragments of size 1376 bytes.
module.c: Loaded "module-alsa-source" (index: #1; argument: "device=hw:0 source_name=alsa_input.pci_8086_266e_alsa_capture_0").
module-hal-detect.c: loaded 2 mod...

Read more...

Revision history for this message
Stefan Fleiter (stefan-fleiter) wrote :

@Matteo: No it does not.

# esdplay /usr/share/games/wesnoth/sounds/water-blast.wav
main.c: WARNING: called SUID root, but not in group 'pulse-rt'.
esdplay: pcm_params.c:2351: sndrv_pcm_hw_params: Assertion `err >= 0' failed.
Aborted (core dumped)

# mplayer -ao esd 02.Bring_Me_To_Life.mp3
MPlayer 2:1.0~rc1-0ubuntu8 (C) 2000-2006 MPlayer Team
CPU: AMD Athlon(tm) XP 2000+ (Family: 6, Model: 6, Stepping: 2)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
[..]
==========================================================================
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
main.c: WARNING: called SUID root, but not in group 'pulse-rt'.
[AO ESD] esd_open_sound failed: No child processes
Could not open/initialize audio device -> no sound.
Audio: no sound

I don't hear sound with:
# esdplay /usr/share/licq/sounds/Monty-Python.wav
main.c: WARNING: called SUID root, but not in group 'pulse-rt'.

but do hear it with:
# paplay /usr/share/licq/sounds/Monty-Python.wav

Revision history for this message
Matteo Z (matteozandi) wrote :

shouldn't we say that pulseaudio-esound-compact is affected instead of pulseaudio? Pulseaudio here works (either directly or via alsa wrapper), esd wrapper only doesn't work.

Revision history for this message
Viorel Stirbu (viorels) wrote :

Same bug here. What I don't understand is why it happens at every reboot (/tmp/.esd owned by root)
although I have PULSEAUDIO_SYSTEM_START=0 in /etc/default/pulseaudio

Revision history for this message
Eetu Huisman (eh) wrote : Upstream ticket

I linked to the upstream ticket about the same issue. It is (for now) closed as wontfix, since the upstream maintainer states that this is an Ubuntu issue.

Changed in pulseaudio:
status: Unknown → Won't Fix
Revision history for this message
Martin Pitt (pitti) wrote :

 pulseaudio (0.9.7-3ubuntu2) hardy; urgency=low
 .
   * Disable 0001-Set-ESD-socket-to-tmp-.esd-socket-to-match-up-with.patch. We
     do want per-user esd sockets in Ubuntu. This unbreaks multiuser support
     and matches the patch that we did to esound for the very same reason:
     every user needs its own esd socket path to have them not conflict to each
     other.

Changed in pulseaudio:
status: Incomplete → Fix Released
assignee: nobody → pitti
Revision history for this message
Martin Pitt (pitti) wrote :

Context for above change, for the curious: upstream's default is now to create per-user esd sockets, above patch was introduced in Debian, since Debian's esound does not have the per-user sockets. Ubuntu's has, though.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.