[pulseaudio-tickets] [PulseAudio] #785: No or only random connections to PulseAudio server after `pulseaudio -k`.

PulseAudio trac-noreply at tango.0pointer.de
Mon Feb 1 02:10:57 PST 2010


#785: No or only random connections to PulseAudio server after `pulseaudio -k`.
--------------------------+-------------------------------------------------
  Reporter:  PaulePanter  |       Owner:  lennart
      Type:  defect       |      Status:  new    
 Milestone:               |   Component:  daemon 
Resolution:               |    Keywords:         
--------------------------+-------------------------------------------------

Comment(by PaulePanter):

 Following your suggestions I found several things I find strange. I
 enumerated them. Please tell me if I should create separate tickets for
 those.

 Replying to [comment:1 coling]:
 > Chances are your X11 properties are somehow out of sync with the running
 PA. This shouldn't really happen but does pax11publish -r help?

 Did you mean `pax11publish -e` to export the information to the X11 root
 window?

 I did not know about `pax11publish`. The manual page lists `xprop -root |
 grep ^PULSE_` to dump the raw information. `pax11publish -d` seems to
 output the `Server` and `Cookie` nicely formatted.

 So with the PulseAudio server started by my GNOME session(?) I got.

 {{{
 $ xprop -root | grep ^PULSE_
 PULSE_COOKIE(STRING) =
 "aa0cf9aa0ba2703f23be6741b64a9521bc460d6943b03c878fba145ce8823ff46253a04361b89cffd1a339293f09d1ae446297ca43129d58214f27e3acd54d643803da7cf9aca2455fac684f2323856b10d76186cdbbca8942e12d0c0f64f5202ac1d15714f6afc6335d6b3853ffe1024f1422e1d0390a44c4da8e4b02e56e270a23e4f0e95504cd22a1c0c080c01b9f3f7de653c8e5d25d0308e46d24439b66a5bc9363830eb8fe0b8e4e57483427437307e864528ea304d0f5f6c382e4113b7bed540371170ec1dab36f1d75dce14671c4a69871d8af336c47b1c1a0822a9d7066507aff52de158b7b796afcde280919a0dbce5a69fbc40cbc87d43edf1c20"
 PULSE_SERVER(STRING) =
 "{1572dc2ca76ca04c3351599547f539a6}unix:/home/joe/.pulse/1572dc2ca76ca04c3351599547f539a6-runtime/native"
 PULSE_SESSION_ID(STRING) =
 "1572dc2ca76ca04c3351599547f539a6-1265011784.364806-1969959962"
 PULSE_ID(STRING) = "1000 at 1572dc2ca76ca04c3351599547f539a6/3489"
 }}}

 {{{
 $ pax11publish -d
 Server:
 {1572dc2ca76ca04c3351599547f539a6}unix:/home/joe/.pulse/1572dc2ca76ca04c3351599547f539a6-runtime/native
 Cookie:
 aa0cf9aa0ba2703f23be6741b64a9521bc460d6943b03c878fba145ce8823ff46253a04361b89cffd1a339293f09d1ae446297ca43129d58214f27e3acd54d643803da7cf9aca2455fac684f2323856b10d76186cdbbca8942e12d0c0f64f5202ac1d15714f6afc6335d6b3853ffe1024f1422e1d0390a44c4da8e4b02e56e270a23e4f0e95504cd22a1c0c080c01b9f3f7de653c8e5d25d0308e46d24439b66a5bc9363830eb8fe0b8e4e57483427437307e864528ea304d0f5f6c382e4113b7bed540371170ec1dab36f1d75dce14671c4a69871d8af336c47b1c1a0822a9d7066507aff52de158b7b796afcde280919a0dbce5a69fbc40cbc87d43edf1c20
 }}}

 Killing `pulseaudio -k` and starting PulseAudio `pulseaudio -vvvvv` with
 `autospawn = no` resulted in the following.

 {{{
 $ pulseaudio -k
 $ xprop -root | grep ^PULSE
 $ pax11publish -d
 $ pulseaudio -vvvvv
 $
 }}}

 So the PA server credentials were not published to the X root window.
 Wondering why, I noticed in the log or with `list-modules` in `pacmd` that
 `module-x11-publish` was not being loaded. It is commented out in
 `/etc/pulse/defaul.pa`.

 {{{
 $ more /etc/pulse/default.pa
 ### Publish connection data in the X11 root window
 #.ifexists module-x11-publish.so
 #.nofail
 #load-module module-x11-publish
 #.fail
 #.endif
 }}}

 This was done in
 [http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=3888bfcccd8324d23a7bc31ebb2d8063d9da1aaf
 commit 3888bfcccd8324d23a7bc31ebb2d8063d9da1aaf] with the commit message
 »enable exit-on-idle by default«. I cannot grasp the reasons behind this
 though. Maybe because it should not be loaded when running without X and
 one is supposed to use `start-pulseaudio-x11` if a X server is running.

 I do not know why `module-x11-publish` is loaded when my system starts

 Anyway loading this module manually

 {{{
 $ pacmd
 Welcome to PulseAudio! Use "help" for usage information.
 >>> load-module module-x11-publish
 }}}

 seems to publish the credentials just fine.

 {{{
 $ xprop -root | grep ^PULSE_
 PULSE_SESSION_ID(STRING) =
 "1572dc2ca76ca04c3351599547f539a6-1265011784.364806-1969959962"
 PULSE_ID(STRING) = "1000 at 1572dc2ca76ca04c3351599547f539a6/24717"
 PULSE_COOKIE(STRING) =
 "aa0cf9aa0ba2703f23be6741b64a9521bc460d6943b03c878fba145ce8823ff46253a04361b89cffd1a339293f09d1ae446297ca43129d58214f27e3acd54d643803da7cf9aca2455fac684f2323856b10d76186cdbbca8942e12d0c0f64f5202ac1d15714f6afc6335d6b3853ffe1024f1422e1d0390a44c4da8e4b02e56e270a23e4f0e95504cd22a1c0c080c01b9f3f7de653c8e5d25d0308e46d24439b66a5bc9363830eb8fe0b8e4e57483427437307e864528ea304d0f5f6c382e4113b7bed540371170ec1dab36f1d75dce14671c4a69871d8af336c47b1c1a0822a9d7066507aff52de158b7b796afcde280919a0dbce5a69fbc40cbc87d43edf1c20"
 PULSE_SERVER(STRING) =
 "{1572dc2ca76ca04c3351599547f539a6}unix:/home/joe/.pulse/1572dc2ca76ca04c3351599547f539a6-runtime/native"
 }}}

 {{{
 $ pax11publish -d
 Server:
 {1572dc2ca76ca04c3351599547f539a6}unix:/home/joe/.pulse/1572dc2ca76ca04c3351599547f539a6-runtime/native
 Cookie:
 aa0cf9aa0ba2703f23be6741b64a9521bc460d6943b03c878fba145ce8823ff46253a04361b89cffd1a339293f09d1ae446297ca43129d58214f27e3acd54d643803da7cf9aca2455fac684f2323856b10d76186cdbbca8942e12d0c0f64f5202ac1d15714f6afc6335d6b3853ffe1024f1422e1d0390a44c4da8e4b02e56e270a23e4f0e95504cd22a1c0c080c01b9f3f7de653c8e5d25d0308e46d24439b66a5bc9363830eb8fe0b8e4e57483427437307e864528ea304d0f5f6c382e4113b7bed540371170ec1dab36f1d75dce14671c4a69871d8af336c47b1c1a0822a9d7066507aff52de158b7b796afcde280919a0dbce5a69fbc40cbc87d43edf1c20
 }}}

 1. Can `module-x11-publish` be loaded conditionally if a X server is
 running? It seems to be the task of the desktop environment, but as we
 have seen sometimes the PA server is killed and started automatically
 (`autospawn = yes`) or manually (`autospawn = no`).

 To do some further tests I killed the PA server again and tried your
 suggestion to export the PA server credentials manually after starting the
 PA server again (without `module-x11-publish`).

 {{{
 $ pax11publish -e
 PULSE_COOKIE(STRING) =
 "aa0cf9aa0ba2703f23be6741b64a9521bc460d6943b03c878fba145ce8823ff46253a04361b89cffd1a339293f09d1ae446297ca43129d58214f27e3acd54d643803da7cf9aca2455fac684f2323856b10d76186cdbbca8942e12d0c0f64f5202ac1d15714f6afc6335d6b3853ffe1024f1422e1d0390a44c4da8e4b02e56e270a23e4f0e95504cd22a1c0c080c01b9f3f7de653c8e5d25d0308e46d24439b66a5bc9363830eb8fe0b8e4e57483427437307e864528ea304d0f5f6c382e4113b7bed540371170ec1dab36f1d75dce14671c4a69871d8af336c47b1c1a0822a9d7066507aff52de158b7b796afcde280919a0dbce5a69fbc40cbc87d43edf1c20"
 PULSE_SERVER(STRING) = "myhostname"
 }}}
 {{{
 $ pax11publish -d
 Server: myhostname
 Cookie:
 aa0cf9aa0ba2703f23be6741b64a9521bc460d6943b03c878fba145ce8823ff46253a04361b89cffd1a339293f09d1ae446297ca43129d58214f27e3acd54d643803da7cf9aca2455fac684f2323856b10d76186cdbbca8942e12d0c0f64f5202ac1d15714f6afc6335d6b3853ffe1024f1422e1d0390a44c4da8e4b02e56e270a23e4f0e95504cd22a1c0c080c01b9f3f7de653c8e5d25d0308e46d24439b66a5bc9363830eb8fe0b8e4e57483427437307e864528ea304d0f5f6c382e4113b7bed540371170ec1dab36f1d75dce14671c4a69871d8af336c47b1c1a0822a9d7066507aff52de158b7b796afcde280919a0dbce5a69fbc40cbc87d43edf1c20
 }}}

 So it looks a little bit different then from the beginning. `Cookie` has
 the same value, but the other information are all different or are not
 set. The problem with `gstreamer-properties` and `mplayer` are the *same*
 as in my original report, i. e. the connection is refused for them. I
 found out that `paplay` has the same problem.

 {{{
 $ LANG=C paplay song.flac
 Connection failure: Connection refused
 }}}

 After killing this PA server (started with `pulseaudio -vvvvv`) with
 `pulseaudio -k` the credentials are not removed.

 {{{
 $ pulseaudio -k
 $ pax11publish -d
 Server: myhostname
 Cookie:
 aa0cf9aa0ba2703f23be6741b64a9521bc460d6943b03c878fba145ce8823ff46253a04361b89cffd1a339293f09d1ae446297ca43129d58214f27e3acd54d643803da7cf9aca2455fac684f2323856b10d76186cdbbca8942e12d0c0f64f5202ac1d15714f6afc6335d6b3853ffe1024f1422e1d0390a44c4da8e4b02e56e270a23e4f0e95504cd22a1c0c080c01b9f3f7de653c8e5d25d0308e46d24439b66a5bc9363830eb8fe0b8e4e57483427437307e864528ea304d0f5f6c382e4113b7bed540371170ec1dab36f1d75dce14671c4a69871d8af336c47b1c1a0822a9d7066507aff52de158b7b796afcde280919a0dbce5a69fbc40cbc87d43edf1c20
 }}}

 2. It looks like `pax11publish` fails to publish the correct credentials
 as `module-x11-publish` is doing. Is that a bug?

 >Or running start-pulseaudio-x11 after killing PA

 That one works because `module-x11-publish` is loaded when starting PA
 server with `start-pulseaudio-x11`.

 {{{
 $ LANG=C start-pulseaudio-x11
 I: main.c: Daemon startup successful.
 $ pax11publish -d
 Server:
 {1572dc2ca76ca04c3351599547f539a6}unix:/home/joe/.pulse/1572dc2ca76ca04c3351599547f539a6-runtime/native
 Cookie:
 aa0cf9aa0ba2703f23be6741b64a9521bc460d6943b03c878fba145ce8823ff46253a04361b89cffd1a339293f09d1ae446297ca43129d58214f27e3acd54d643803da7cf9aca2455fac684f2323856b10d76186cdbbca8942e12d0c0f64f5202ac1d15714f6afc6335d6b3853ffe1024f1422e1d0390a44c4da8e4b02e56e270a23e4f0e95504cd22a1c0c080c01b9f3f7de653c8e5d25d0308e46d24439b66a5bc9363830eb8fe0b8e4e57483427437307e864528ea304d0f5f6c382e4113b7bed540371170ec1dab36f1d75dce14671c4a69871d8af336c47b1c1a0822a9d7066507aff52de158b7b796afcde280919a0dbce5a69fbc40cbc87d43edf1c20
 $ LANG=C paplay song.flac
 $ # plays until end
 }}}

 >(or after running it in the terminal manually - i.e. run start-
 pulseaudio-x11 in another term while the -vvv manual run is happily
 sitting and waiting)

 I do not know what you mean by »sitting and waiting«. But if I run
 `pulseaudio -vvvvv` before in another terminal, running `start-
 pulseaudio-x11` does not work.

 {{{
 $ LANG=C start-pulseaudio-x11
 I: main.c: Daemon startup successful.
 [(With `--daemonize=no` we get the reason.) E: pid.c: Daemon already
 running.]
 Failure: Module initalization failed
 }}}

 3. This error message is in my opinion confusing. »E: pid.c: Daemon
 already running.« should be printed as the error.

 > Both methods should fix up the X11 settings that the client uses when
 connecting... Not certain this is the problem, but I suspect it's
 something in this area.

 I think you were spot on and probably the instructions in the Wiki should
 be changed on how to start a PA server with a X server running.


 PS: I hope publishing my PA cookie in this ticket will not have any
 security consequences for me. If you please tell me.

-- 
Ticket URL: <http://pulseaudio.org/ticket/785#comment:2>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server


More information about the pulseaudio-bugs mailing list