Hi,<br><br>I finally got some more details from pulseaudio. I did this on the client:<br>----------------------------------<br># stop pulseaudio<br># pulseaudio --system --high-priority -C<br>----------------------------------<br>
<br>Now, when I run "pactl stat" on the server, pulseaudio on the client reports:<br>--------------------------------------<br>E: client-ext.c: client-ext.c: Can't obtain command line<br>E: protocol-native.c: protocol error, kicking client<br>
---------------------------------------<br><br>This is strange because pactl on the server side reports that the protocol version is the same on both the remote and the local side:<br>------------------------------------------<br>
Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472<br>Trying to connect to localhost:4713...<br>SHM possible: yes<br>Protocol version: remote 16, local 16<br>
Negotiated SHM: no<br>Connection failure: Connection terminated<br>------------------------------------------<br><br>Any ideas?<br><br>br,<br>Quinn<br><br><br><div class="gmail_quote">On Sat, May 21, 2011 at 10:53 AM, Quinn Plattel <span dir="ltr"><<a href="mailto:qiet72@gmail.com">qiet72@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br><br>I found this message when I am trying to tunnel 4713 via ssh "ssh -L 4713:localhost:4713 user@server":<br>
------------------------------------------------------------<br>bind: Address already in use<br>
channel_setup_fwd_listener: cannot listen to port: 4713<br>Could not request local forwarding.<br>------------------------------------------------------------<br><br>BUT, this seems to work "ssh -R 4713:localhost:4713 user@server" (notice the "-R" parameter)<br>
<br>So, it seems the forwarding direction has some say in this. Forwarding from local to remote is not the right way, but forwarding from remote to local is the correct way.<br><br>"pactl stat" also seems to get a bit futher this time with the correct tunnelling direction:<br>
-------------------------------------------------------------------------<div class="im"><br>Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472<br>Trying to connect to localhost:4713...<br>
</div><div class="im">
SHM possible: yes<br>Protocol version: remote 16, local 16<br></div>Negotiated SHM: no<br>Connection failure: Connection terminated<br>-------------------------------------------------------------------------<br><br>So now we are down from "connection refused" to "connection failure: connection terminated".<br>
<br>If I attach an strace to the pulseaudio process then this happens when "pactl stat" tries to connect to it remotely:<br>---------------------------------------------------------------------------<br>Process 1075 attached - interrupt to quit<br>
restart_syscall(<... resuming interrupted call ...>) = 1<br>accept(57, 0, NULL) = 66<br>fcntl64(66, F_GETFD) = 0<br>fcntl64(66, F_SETFD, FD_CLOEXEC) = 0<br>setsockopt(57, SOL_SOCKET, SO_PRIORITY, [6], 4) = 0<br>
setsockopt(57, SOL_TCP, TCP_NODELAY, [1], 4) = 0<br>setsockopt(57, SOL_IP, IP_TOS, [16], 4) = 0<br>fcntl64(66, F_GETFL) = 0x2 (flags O_RDWR)<br>fcntl64(66, F_SETFL, O_RDWR|O_NONBLOCK) = 0<br>fstat64(66, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0<br>
getpeername(66, {sa_family=AF_INET, sin_port=htons(54205), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0<br>getpeername(66, {sa_family=AF_INET, sin_port=htons(54205), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0<br>
setsockopt(66, SOL_SOCKET, SO_RCVBUF, [16344], 4) = 0<br>setsockopt(66, SOL_SOCKET, SO_SNDBUF, [16344], 4) = 0<br>getsockname(66, {sa_family=AF_INET, sin_port=htons(4713), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0<br>
open("/proc/0/cmdline", O_RDONLY) = -1 ENOENT (No such file or directory)<br>ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbed12ef4) = -1 ENOTTY (Inappropriate ioctl for device)<br>write(2, "E: client-ext.c: client-ext.c: Ca"..., 57) = 57<br>
---------------------------------------------------------------------------<br><br>I am assuming the problem lies on the client side and not on the server side. Any more ideas? How can I see what is going on with the pulseaudio daemon when a remote client is trying to connect?<br>
<br>br,<br><font color="#888888">Quinn</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Sat, May 21, 2011 at 10:31 AM, Quinn Plattel <span dir="ltr"><<a href="mailto:qiet72@gmail.com" target="_blank">qiet72@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br><br>From what Colin says, the standard port is 4713 for pulseaudio. As I said before all network ports are blocked except port 22 which is only for ssh connections.<br>I should be able to tunnel port 4713 through ssh by doing this: "ssh -L 4713:localhost:4713 user@server". Then I can tell pulseaudio to use the servers local port 4713 which is automatically forwarded to the client's local port 4713. But from what "pactl stat" command is telling me, then port 4713 on the client side seems to be blocked as it is giving a "connection refused". I know the tunnelling works with ssh because I use vnc connections through ssh by "ssh -L 5901:localhost:5901 user@server" and that works perfectly with my vnc client and server solution.<br>
<br>I am not sure if I can use "pactl load-module module-protocol-native-tcp" together with tunnelled tcp connections. I need more details on how to that.<br><br>btw, I can see there is something listening on port 4713 on the client when I use the "netstat -an|grep 4713" command:<br>
---------------------------------------------------------<br>tcp 0 0 <a href="http://0.0.0.0:4713" target="_blank">0.0.0.0:4713</a> 0.0.0.0:* LISTEN<br>---------------------------------------------------------<br>
So now the question is why does the listener process on the client not accept pulseaudio data via the ssh tunnel?<br><br>br,<br><font color="#888888">Quinn</font><div><div></div><div><br><br><br><br><div class="gmail_quote">
On Fri, May 20, 2011 at 7:15 PM, Fred Frigerio <span dir="ltr"><<a href="mailto:ffrigerio@frigerio.us" target="_blank">ffrigerio@frigerio.us</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Have you tried redirecting the port in SSH? Then you get the native PA with SSH. I am not sure if there is some standard port.<div>
<br clear="all"><font color="#888888">Fred Frigerio</font><div><div></div><div><br><br>
<br><br><div class="gmail_quote">On Fri, May 20, 2011 at 1:01 PM, Quinn Plattel <span dir="ltr"><<a href="mailto:qiet72@gmail.com" target="_blank">qiet72@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Here is pactl stat on the client side:<div><br><br>PULSE_LOG=99 pactl stat<br>-------------------------------------------------<br></div>Using private memory pool with 1024 slots of size 16,0 KiB each, total size is 16,0 MiB, maximum usable slot size is 16344<br>
Trying to connect to /home/user/.pulse/fbd5d27658d3fcf30cb25bf800531799:runtime/native...<br>connect(): No such file or directory (2)<br>Trying to connect to /var/run/pulse/native...<br>SHM possible: no<div><br>
Protocol version: remote 16, local 16<br></div>
Negotiated SHM: no<br>Currently in use: 1 blocks containing 16,0 KiB bytes total.<br>Allocated during whole lifetime: 263989 blocks containing 231,3 MiB bytes total.<div><br>Sample cache size: 0 B<br></div>User name: pulse<br>
Host Name: Nokia-N900<br>
Server Name: pulseaudio<br>Server Version: 0.9.15<br>Default Sample Specification: s16le 2ch 48000Hz<div><br>Default Channel Map: front-left,front-right<br></div>Default Sink: sink.music<br>Default Source: source.record<br>
Cookie: 26e54bb2<br>
-------------------------------------------------<br><br>br,<br><font color="#888888">Quinn</font><div><div></div><div><br><br><div class="gmail_quote">On Fri, May 20, 2011 at 6:58 PM, Quinn Plattel <span dir="ltr"><<a href="mailto:qiet72@gmail.com" target="_blank">qiet72@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br><br>This is interesting:<br><br>client: ssh -XL 4713:localhost:4713 user@server<br>server: PULSE_LOG=99 pactl stat<br>
----------------------------------------<br>Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472<br>
Trying to connect to /home/quinn/.pulse/1ffe0fd6b5c9262aaa374e734c2cc8d0-runtime/native...<br>SHM possible: yes<br>Protocol version: remote 16, local 16<br>Negotiated SHM: yes<br>Currently in use: 1 blocks containing 63.9 KiB bytes total.<br>
Allocated during whole lifetime: 15741 blocks containing 81.5 MiB bytes total.<br>Sample cache size: 0 B<br>User name: quinn<br>Host Name: server<br>Server Name: pulseaudio<br>Server Version: 0.9.21-63-gd3efa-dirty<br>Default Sample Specification: s16le 2ch 44100Hz<br>
Default Channel Map: front-left,front-right<br>Default Sink: auto_null<br>Default Source: auto_null.monitor<br>Cookie: 6ccbf517<br>----------------------------------------<br>server: export PULSE_SERVER=localhost:4713<br>
server: PULSE_LOG=99 pactl stat<br>---------------------------------------<br>Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472<br>Trying to connect to localhost:4713...<br>
connect(): Connection refused<br>Connection failure: Connection refused<br>---------------------------------------<br><br>Ideas?<br><font color="#888888"><br>Quinn<br><br></font><div class="gmail_quote"><div>On Fri, May 20, 2011 at 5:48 PM, Colin Guthrie <span dir="ltr"><<a href="mailto:gmane@colin.guthr.ie" target="_blank">gmane@colin.guthr.ie</a>></span> wrote:<br>
</div><div><div></div><div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
'Twas brillig, and Quinn Plattel at 20/05/11 15:52 did gyre and gimble:<br>
<div>> I am currently trying to attempt to redirect pulse audio sound from a<br>
> server to a client through ssh. I am bit unclear on what the correct<br>
> way is of doing it.<br>
<br>
</div>Firstly, I wrote up how our X11 piggy backing stuff work here:<br>
<br>
<a href="http://colin.guthr.ie/2009/08/sound-on-linux-is-confusing-defuzzing-part-2-pulseaudio/" target="_blank">http://colin.guthr.ie/2009/08/sound-on-linux-is-confusing-defuzzing-part-2-pulseaudio/</a><br>
<br>
<br>
Technically we do not tunnel over SSH directly (this can of course be<br>
done, but not automatically as SSH does not know about PA in the same<br>
way it knows about X11). We can however piggy back on the X11 forwarding<br>
built into SSH for our authentication (cookie) and server connection<br>
strings.<br>
<br>
If this is on a private network (direct routing) then the built in way<br>
is the best, but it doesn't go over SSH. You just need to ensure the<br>
machine you're sshing from has the netwrok protocol module loaded into<br>
PA (pactl load-module module-protocol-native-tcp, or put it in your<br>
<a href="http://default.pa" target="_blank">default.pa</a>) and make sure port 4713/tcp is open for external connections.<br>
<br>
Also ensure that module-x11-publish is loaded on the client side and you<br>
should get some interesting results from "xprop -root | grep PULSE".<br>
<br>
Then when you ssh with x11 forwarding running the xprop command on the<br>
remote machine should show you the same results.<br>
<br>
<br>
<br>
If you cannot use the direct connection, just setup TCP tunnels in your<br>
SSH config and then hack the PULSE_SERVER property or env var on the<br>
remote machine to point to e.g. localhost:4713 which will actually be a<br>
tunnel back to localhost:4713 on the remote machine. The PULSE_COOKIE<br>
stuff already forwarded should be enough for auth.<br>
<br>
For debugging connections:<br>
<br>
PULSE_LOG=99 pactl stat<br>
<br>
This shows you e.g. the server name it's trying to connect to etc.<br>
<br>
<br>
Hope that helps (although I wrote it really quick so apologies if it<br>
doesn't! I'll clarify later if needs be :D)<br>
<br>
Col<br>
<br>
<br>
--<br>
<br>
Colin Guthrie<br>
gmane(at)<a href="http://colin.guthr.ie" target="_blank">colin.guthr.ie</a><br>
<a href="http://colin.guthr.ie/" target="_blank">http://colin.guthr.ie/</a><br>
<br>
Day Job:<br>
Tribalogic Limited [<a href="http://www.tribalogic.net/" target="_blank">http://www.tribalogic.net/</a>]<br>
Open Source:<br>
Mageia Contributor [<a href="http://www.mageia.org/" target="_blank">http://www.mageia.org/</a>]<br>
PulseAudio Hacker [<a href="http://www.pulseaudio.org/" target="_blank">http://www.pulseaudio.org/</a>]<br>
Trac Hacker [<a href="http://trac.edgewall.org/" target="_blank">http://trac.edgewall.org/</a>]<br>
<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@mail.0pointer.de" target="_blank">pulseaudio-discuss@mail.0pointer.de</a><br>
<a href="https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss" target="_blank">https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss</a><br>
</blockquote></div></div></div><br><br clear="all"><br>
</blockquote></div><br><br clear="all"><br></div></div><div><div></div><div>-- <br>Best regards/Med venlig hilsen,<br>Quinn Plattel<br>
</div></div><br>_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@mail.0pointer.de" target="_blank">pulseaudio-discuss@mail.0pointer.de</a><br>
<a href="https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss" target="_blank">https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss</a><br>
<br></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@mail.0pointer.de" target="_blank">pulseaudio-discuss@mail.0pointer.de</a><br>
<a href="https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss" target="_blank">https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Best regards/Med venlig hilsen,<br>Quinn Plattel<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards/Med venlig hilsen,<br>Quinn Plattel<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards/Med venlig hilsen,<br>Quinn Plattel<br>