Bug 809811

Summary: pulseaudio not usable with fvwm and also KDE
Product: [openSUSE] openSUSE 12.3 Reporter: Dr. Werner Fink <werner>
Component: BasesystemAssignee: Scott Reeves <sreeves>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: coolo, forgotten_zOWss6Gs9u, sbrabec
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: getfacl /dev/snd/*

Description Dr. Werner Fink 2013-03-16 18:17:31 UTC
After update from 11.4 to 12.3 pulseaudio is crying in the logs:

2013-03-16T18:39:32.828031+01:00 speedy pulseaudio[4493]: [pulseaudio] authkey.c: Failed to open cookie file '/home/werner/.config/pulse/cookie': No such file or directory
2013-03-16T18:39:32.828573+01:00 speedy pulseaudio[4493]: [pulseaudio] authkey.c: Failed to load authorization key '/home/werner/.config/pulse/cookie': No such file or direc2013-03-16T18:39:32.922607+01:00 speedy bluetoothd[4502]: Unable to get on D-Bus
2013-03-16T18:39:32.923024+01:00 speedy pulseaudio[4496]: [pulseaudio] bluetooth-util.c: org.bluez.Manager.GetProperties() failed: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.8" (uid=1000 pid=4496 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="org.bluez.Manager" member="GetProperties" error name="(unset)" requested_reply="0" destination="org.bluez" (uid=0 pid=4502 comm="/usr/sbin/bluetoothd -n ")
2013-03-16T18:39:57.934957+01:00 speedy pulseaudio[4496]: [pulseaudio] bluetooth-util.c: org.bluez.Manager.GetProperties() failed: org.freedesktop.DBus.Error.TimedOut: Action of org.bluez timed out

and I'm not able to play anything.  There is a dbus session in which the fvwm is running.
Comment 1 Dr. Werner Fink 2013-03-16 23:15:32 UTC
/home/werner> gmplayer -menu-startup -novideo -nojoystick -nolirc -noconsolecontrols -prefer-ipv4 http://gffstream.ic.llnwd.net/stream/gffstream_w12a

AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
[AO_ALSA] alsa-lib: confmisc.c:768:(parse_card) cannot find card '0'
[AO_ALSA] alsa-lib: conf.c:4246:(_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied
[AO_ALSA] alsa-lib: confmisc.c:392:(snd_func_concat) error evaluating strings
[AO_ALSA] alsa-lib: conf.c:4246:(_snd_config_evaluate) function snd_func_concat returned error: Permission denied
[AO_ALSA] alsa-lib: confmisc.c:1251:(snd_func_refer) error evaluating name
[AO_ALSA] alsa-lib: conf.c:4246:(_snd_config_evaluate) function snd_func_refer returned error: Permission denied
[AO_ALSA] alsa-lib: conf.c:4725:(snd_config_expand) Evaluate error: Permission denied
[AO_ALSA] alsa-lib: pcm.c:2223:(snd_pcm_open_noupdate) Unknown PCM sysdefault
[AO_ALSA] Playback open error: Permission denied
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.

/home/werner> aplay /usr/share/sounds/alsa/Noise.wav
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4246:(_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4246:(_snd_config_evaluate) function snd_func_concat returned error: Permission denied
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4246:(_snd_config_evaluate) function snd_func_refer returned error: Permission denied
ALSA lib conf.c:4725:(snd_config_expand) Evaluate error: Permission denied
ALSA lib pcm.c:2223:(snd_pcm_open_noupdate) Unknown PCM sysdefault
aplay: main:731: audio open error: Permission denied
/home/werner>
Comment 2 Dr. Werner Fink 2013-03-16 23:21:25 UTC
/home/werner> /usr/bin/start-pulseaudio-x11 -v -v --daemon
I: [pulseaudio] main.c: Daemon startup successful.
/home/werner> aplay /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono


silent ... nothing happens same with the bayern3 stream.

If I add

   load-module module-alsa-sink device=plughw:0,0

to /etc/pulse/default.pa then I see a permission denied

/home/werner> /usr/bin/start-pulseaudio-x11 -v -v --daemon
E: [pulseaudio] main.c: Daemon startup failed.

... ???
Comment 3 Dr. Werner Fink 2013-03-16 23:50:32 UTC
Yet an other bug 

  /home/werner> grep pulse /etc/passwd
  pulse:x:109:112:PulseAudio daemon:/var/lib/pulseaudio:/sbin/nologin
  /home/werner> sudo ls -d /var/lib/pulse*
  /var/lib/pulse
  /home/werner> sudo -i
  speedy:~ # /usr/bin/pulseaudio --verbose --system
  W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set!
  W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading  not set!
  N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode!
  N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time!
  I: [pulseaudio] core-util.c: Successfully gained nice level -11.
  I: [pulseaudio] main.c: Found user 'pulse' (UID 109) and group 'pulse' (GID 112).
  W: [pulseaudio] main.c: Home directory of user 'pulse' is not '/var/run/pulse', ignoring.

.. IMHO the HOME of user pulse should be /var/lib/pulse and not /var/lib/pulseaudio
Comment 4 Dr. Werner Fink 2013-03-17 00:59:52 UTC
Q: What about setting /usr/bin/pulseaudio setgid audio as the devices are group audio
Comment 5 Dr. Werner Fink 2013-03-17 14:25:23 UTC
Even KDE users can not use pulseaudio ... now with

    chown root:audio /usr/bin/pulseaudio
    chmod 2755 /usr/bin/pulseaudio

it works as it should.  Maybe a service daemon pulseaudio running as user pulse which the other pulseaudio clients could use would be an other option.
Comment 6 Stanislav Brabec 2013-03-18 16:33:00 UTC
Please check
getfacl /dev/snd/*

Here is what I see for all files there:
# owner: root
# group: audio
user::rw-
user:sbrabec:rw-
group::rw-
mask::rw-
other::---

ACL permission should be set for the user logged to a local session.

It was handled by ConsoleKit in past. I don't know implementation details in 12.3, but I guess that need interaction with polkit.
Comment 7 Dr. Werner Fink 2013-03-18 18:57:36 UTC
Created attachment 530254 [details]
getfacl /dev/snd/*

The output of

  sudo getfacl /dev/snd/*
Comment 8 Dr. Werner Fink 2013-03-18 18:59:08 UTC
Indeed there was no polkit running compare with bnc#809821 and bnc#809807
Comment 9 Stanislav Brabec 2013-03-18 19:25:38 UTC
Permissions in /dev/snd now look correctly. Does it work now if you revert SGID of /usr/bin/pulseaudio and restart pulseaudio daemon (e. g. re-login)? If it works now, it is probably a consequence of with bug 809821 or bug 809807.
Comment 10 Dr. Werner Fink 2013-03-18 21:27:14 UTC
Indeed this does work:

  /home/werner> ll /usr/bin/pulseaudio 
  -rwxr-xr-x 1 root audio 88280 Feb 14 22:19 /usr/bin/pulseaudio
  /home/werner> grep audio /etc/group
  audio:x:17:pulse
  /home/werner> pacmd list-sinks | grep name:
          name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
  /home/werner> paplay /usr/share/sounds/alsa/test.wav
  /home/werner>

*** This bug has been marked as a duplicate of bug 809821 ***