Hi,<br><br>I did a &quot;LANG=C pulseaudio --system --high-priority -vvvv &gt;/root/pulseverbose.log 2&gt;&amp;1&quot; on the client to write a detailed log file.<br>Here is the results when the remote client tries to connect:<br>
-----------------------------------------------------------------<br>I: client.c: Created 9 &quot;Native client (TCP/IP client from <a href="http://127.0.0.1:50604">127.0.0.1:50604</a>)&quot;<br>I: protocol-native.c: Client authenticated anonymously.<br>
E: client-ext.c: client-ext.c: Can&#39;t obtain command line<br>D: client-ext.c: new/modified client (idx=9) (Native client (TCP/IP client from 127.0.0.1:50604)|&lt;noid&gt;|0|0|&lt;noexe&gt;|&lt;noarg&gt;|&lt;noargs&gt;)<br>
D: protocol-native.c: Protocol version: remote 16, local 16<br>D: protocol-native.c: SHM possible: no<br>D: protocol-native.c: Negotiated SHM: no<br>E: protocol-native.c: protocol error, kicking client<br>I: client.c: Freed 9 &quot;Native client (TCP/IP client from <a href="http://127.0.0.1:50604">127.0.0.1:50604</a>)&quot;<br>
D: client-ext.c: client removed (idx=9)<br>-----------------------------------------------------------------<br><br>Still have not got further to solving the &quot;protocol error&quot; problem.  Maybe something to do with SHM?<br>
<br>br,<br>Quinn<br><br><div class="gmail_quote">On Sat, May 21, 2011 at 5:14 PM, Quinn Plattel <span dir="ltr">&lt;<a href="mailto:qiet72@gmail.com">qiet72@gmail.com</a>&gt;</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>Some more attempts.  I have now tried this:<br>client (session 1): stop pulseaudio<br>client (session 1): pulseaudio --system --high-priority -C<br><br>client (session 2): ssh -R 4000:localhost:4000 user@server<br>

client (session 3): socat TCP-LISTEN:4000,fork UNIX-CONNECT:/var/run/pulse/native<br><br>server: export PULSE_SERVER=localhost:4000<br>server: pactl stat<br><br>client (session 1) response (pulseaudio): E: protocol-native.c: protocol error, kicking client<br>

<br>&quot;protocol error&quot; - how can we go deeper to debug the problem?<br><br>Pulseaudio version information:<br>server: 0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14<br>client: 0.9.15-1maemo43+0m5<br><br>client pulseaudio modules loaded (pactl list|grep &quot;Name: module&quot;)<br>

-----------------------------------------------<br>    Name: module-native-protocol-unix<br>    Name: module-simple-protocol-unix<br>    Name: module-stream-restore<br>    Name: module-rescue-streams<br>    Name: module-suspend-on-idle<br>

    Name: module-augment-properties<br>    Name: module-null-sink<br>    Name: module-alsa-sink-old<br>    Name: module-alsa-sink-volume<br>    Name: module-alsa-source-old<br>    Name: module-nokia-voice<br>    Name: module-nokia-music<br>

    Name: module-nokia-record<br>    Name: module-alsa-sink-old<br>    Name: module-alsa-source-old<br>    Name: module-bluetooth-discover<br>    Name: module-combine<br>    Name: module-esound-protocol-unix<br>    Name: module-native-protocol-tcp<br>

    Name: module-policy-enforcement<br>    Name: module-match<br>    Name: module-cli<br>-----------------------------------------------<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 11:29 AM, Quinn Plattel <span dir="ltr">&lt;<a href="mailto:qiet72@gmail.com" target="_blank">qiet72@gmail.com</a>&gt;</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 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 &quot;pactl stat&quot; on the server, pulseaudio on the client reports:<br>--------------------------------------<br>E: client-ext.c: client-ext.c: Can&#39;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:<div><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></div>Any ideas?<br><br>br,<br><font color="#888888">Quinn</font><div><div></div><div><br><br>
<br><div class="gmail_quote">On Sat, May 21, 2011 at 10:53 AM, Quinn Plattel <span dir="ltr">&lt;<a href="mailto:qiet72@gmail.com" target="_blank">qiet72@gmail.com</a>&gt;</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 &quot;ssh -L 4713:localhost:4713 user@server&quot;:<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 &quot;ssh -R 4713:localhost:4713 user@server&quot; (notice the &quot;-R&quot; 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>&quot;pactl stat&quot; also seems to get a bit futher this time with the correct tunnelling direction:<br>



-------------------------------------------------------------------------<div><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>
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 &quot;connection refused&quot; to &quot;connection failure: connection terminated&quot;.<br>



<br>If I attach an strace to the pulseaudio process then this happens when &quot;pactl stat&quot; tries to connect to it remotely:<br>---------------------------------------------------------------------------<br>Process 1075 attached - interrupt to quit<br>



restart_syscall(&lt;... resuming interrupted call ...&gt;) = 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(&quot;127.0.0.1&quot;)}, [16]) = 0<br>getpeername(66, {sa_family=AF_INET, sin_port=htons(54205), sin_addr=inet_addr(&quot;127.0.0.1&quot;)}, [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(&quot;127.0.0.1&quot;)}, [16]) = 0<br>



open(&quot;/proc/0/cmdline&quot;, 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, &quot;E: client-ext.c: client-ext.c: Ca&quot;..., 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><br><br><div class="gmail_quote">On Sat, May 21, 2011 at 10:31 AM, Quinn Plattel <span dir="ltr">&lt;<a href="mailto:qiet72@gmail.com" target="_blank">qiet72@gmail.com</a>&gt;</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: &quot;ssh -L 4713:localhost:4713 user@server&quot;.  Then I can tell pulseaudio to use the servers local port 4713 which is automatically forwarded to the client&#39;s local port 4713.  But from what &quot;pactl stat&quot; command is telling me, then port 4713 on the client side seems to be blocked as it is giving a &quot;connection refused&quot;.  I know the tunnelling works with ssh because I use vnc connections through ssh by &quot;ssh -L 5901:localhost:5901 user@server&quot; and that works perfectly with my vnc client and server solution.<br>




<br>I am not sure if I can use &quot;pactl load-module module-protocol-native-tcp&quot; 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 &quot;netstat -an|grep 4713&quot; 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">&lt;<a href="mailto:ffrigerio@frigerio.us" target="_blank">ffrigerio@frigerio.us</a>&gt;</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">&lt;<a href="mailto:qiet72@gmail.com" target="_blank">qiet72@gmail.com</a>&gt;</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">&lt;<a href="mailto:qiet72@gmail.com" target="_blank">qiet72@gmail.com</a>&gt;</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">&lt;<a href="mailto:gmane@colin.guthr.ie" target="_blank">gmane@colin.guthr.ie</a>&gt;</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>
&#39;Twas brillig, and Quinn Plattel at 20/05/11 15:52 did gyre and gimble:<br>
<div>&gt; I am currently trying to attempt to redirect pulse audio sound from a<br>
&gt; server to a client through ssh.  I am bit unclear on what the correct<br>
&gt; 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&#39;t go over SSH. You just need to ensure the<br>
machine you&#39;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 &quot;xprop -root | grep PULSE&quot;.<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&#39;s trying to connect to etc.<br>
<br>
<br>
Hope that helps (although I wrote it really quick so apologies if it<br>
doesn&#39;t! I&#39;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>
</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>