Bug 3227 - make pulseaudio talk to the local pulseaudio server
Summary: make pulseaudio talk to the local pulseaudio server
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Sound (show other bugs)
Version: 2.1.0
Hardware: PC Linux
: P2 Enhancement
Target Milestone: 4.0.0
Assignee: Pierre Ossman
URL:
Keywords: aaron_tester
: 3701 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-28 09:31 CEST by Pierre Ossman
Modified: 2012-11-28 12:12 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2009-08-28 09:31:44 CEST
Right now we only use ALSA or OSS as the backend for our pulseaudio server. Since a lot of distributions are moving towards using pulseaudio for everything, we should make our server talk to the system one. This avoids a lot of compatibility issues and generally gives a better experience.
Comment 1 Karl Mikaelsson cendio 2011-08-24 09:59:10 CEST
*** Bug 3701 has been marked as a duplicate of this bug. ***
Comment 2 Pierre Ossman cendio 2012-09-17 14:53:06 CEST
PulseAudio already has a tunnel module that we should be able to use. But I don't think the fire-and-forget approach of our current "auto" logic will cut it anymore. So this bug will probably have to cover that as well.


PulseAudio already has a bunch of "auto" modules:

a) module-detect

Oldest module. Supports Alsa, OSS, Solaris and Windows. Does not handle tunnels. Tries to bind to physical devices, meaning we get more than we need, cannot handle virtual devices, and might not pick the correct default.

b) module-udev-detect

Currently the popular one. Only works with ALSA though, and requires udev. Also uses physical devices.

c) module-hal-detect

Deprecated.

d) module-bluetooth-discover

Only for bluetooth.


So it seems none of the existing stuff works. We could try to do the auto logic in tlclient, but that means we would be unable to handle problems with loading/init in one module and fall back to the next. It's probably better to write our own, simple module.


Other issues:

1) module-tunnel doesn't support reading environment variables or X11 properties.

2) Not clear if module-tunnel supports unix sockets.


We might also want to investigate if we can make module-alsa-* detect a pulse backend and refuse to use those (as it will just crash anyway).
Comment 3 Pierre Ossman cendio 2012-09-24 12:15:41 CEST
(In reply to comment #2)
> 
> Other issues:
> 
> 1) module-tunnel doesn't support reading environment variables or X11
> properties.
> 
> 2) Not clear if module-tunnel supports unix sockets.
> 

Fixed in r25868. Also sent upstream:

https://bugs.freedesktop.org/show_bug.cgi?id=55280
Comment 4 Pierre Ossman cendio 2012-09-24 15:39:05 CEST
New module created in r25880.
Comment 5 Pierre Ossman cendio 2012-09-24 15:51:20 CEST
tlclient adjusted in r25883.
Comment 6 Pierre Ossman cendio 2012-09-25 16:31:43 CEST
Documentation updated in r25901.
Comment 7 Pierre Ossman cendio 2012-09-26 10:36:54 CEST
Something's off with the linking of the tunnel modules.
Comment 8 Pierre Ossman cendio 2012-09-26 14:38:08 CEST
Misfeature in libtool. Should be fixed now.
Comment 9 Peter Åstrand cendio 2012-09-27 11:08:41 CEST
Does not work. Apparently the tunnel does not split a PULSE_SERVER with multiple entries:

I: [pulseaudio] module.c: Loaded "module-esound-protocol-tcp" (index: #0; argument: "listen=127.0.0.1 port=59806 cookie='/tmp/esd9KSJ4Y'").
I: [pulseaudio] module.c: Loaded "module-native-protocol-tcp" (index: #1; argument: "listen=127.0.0.1 port=34402 cookie='/tmp/pulseaudioVWibSF'").
connect(17, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, 20) = 0
connect(18, {sa_family=AF_FILE, path="/home/astrand/.pulse/5f035e9fff826ceeb3472f5b0000002c-runtime/native tcp:scilla.lkpg.cendio.se:4713 tcp6:sc"}, 110) = -1 ENOENT (No such file or directory)
D: [pulseaudio] socket-client.c: connect(): Filen eller katalogen finns inte (2)
E: [pulseaudio] module-tunnel.c: Failed to connect to server '{5f035e9fff826ceeb3472f5b0000002c}unix:/home/astrand/.pulse/5f035e9fff826ceeb3472f5b0000002c-runtime/native tcp:scilla.lkpg.cendio.se:4713 tcp6:scilla.lkpg.cendio.se:4713'
E: [pulseaudio] module.c: Failed to load module "module-tunnel-sink" (argument: ""): initialization failed.
Comment 10 Pierre Ossman cendio 2012-09-27 13:15:28 CEST
(In reply to comment #9)
> Does not work. Apparently the tunnel does not split a PULSE_SERVER with
> multiple entries:
> 

Fixed in r25921.
Comment 11 Peter Åstrand cendio 2012-10-08 14:58:17 CEST
If you select Pulseaudio in the tlclient settings, it jumps back to Auto.
Comment 12 Pierre Ossman cendio 2012-10-09 09:35:53 CEST
Fixed in r25966.
Comment 13 Aaron Sowry cendio 2012-10-24 13:55:58 CEST
If I kill my local pulseaudio server and systemd kindly restarts it again for me, I get no sound from ThinLinc (F17). There seems to be no environment/xprop variables set for the PA server after doing this, but local sound still works.
Comment 14 Pierre Ossman cendio 2012-10-24 17:20:00 CEST
(In reply to comment #13)
> If I kill my local pulseaudio server and systemd kindly restarts it again for
> me, I get no sound from ThinLinc (F17). There seems to be no environment/xprop
> variables set for the PA server after doing this, but local sound still works.

Should be fixed in r26067.
Comment 15 Aaron Sowry cendio 2012-10-25 10:11:41 CEST
(In reply to comment #14)
> Should be fixed in r26067.

Yep.
Comment 16 Aaron Sowry cendio 2012-10-25 10:58:25 CEST
Tested client on F17, F18 alpha, and Ubuntu 12.10. Seems to work fine against both the demo system and an Ubuntu 12.10 server. There are some problems with audio sync, but these can be handled as bug #4411.

TODO:
- Test from a thin-client or something with an older/non-existent PulseAudio server
Comment 17 Aaron Sowry cendio 2012-10-25 13:24:26 CEST
(In reply to comment #16)
> TODO:
> - Test from a thin-client or something with an older/non-existent PulseAudio
> server

Tested OSS on IGEL, which also works. I'm happy enough with this now, closing.

Note You need to log in before you can comment on or make changes to this bug.