Forwarding audio like X in SSH Announcing the arrival of Valued Associate #679: Cesar Manara ...

Fundamental Solution of the Pell Equation

For a new assistant professor in CS, how to build/manage a publication pipeline

How to convince students of the implication truth values?

What does できなさすぎる means?

Compare a given version number in the form major.minor.build.patch and see if one is less than the other

Amount of permutations on an NxNxN Rubik's Cube

Do I really need to have a message in a novel to appeal to readers?

Is safe to use va_start macro with this as parameter?

An adverb for when you're not exaggerating

If a VARCHAR(MAX) column is included in an index, is the entire value always stored in the index page(s)?

Do wooden building fires get hotter than 600°C?

Should I use a zero-interest credit card for a large one-time purchase?

Why do we bend a book to keep it straight?

How to answer "Have you ever been terminated?"

Is there any way for the UK Prime Minister to make a motion directly dependent on Government confidence?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

What do you call the main part of a joke?

Wu formula for manifolds with boundary

Can a new player join a group only when a new campaign starts?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

How do I find out the mythology and history of my Fortress?

Most bit efficient text communication method?

Why are the trig functions versine, haversine, exsecant, etc, rarely used in modern mathematics?



Forwarding audio like X in SSH



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Play local audio on remote computer (Linux)ssh: known_hosts forwardingSSH Agent Forwarding Not WorkingSSH configuration forwardingssh tunnelling port forwardingSSH Port forwardingSSH Port Forwarding ServiceHow to setup turnkey-mediawiki on remote linux host inside vmplayer without highjacking ssh?RDP to Windows machine via SSH tunnels breaks the connectionssh forwarding to guest vm on MacNested ssh command forwarding





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







27















While it is possible to use X applications remotely by using -X switch in ssh, the sound is being played in remote machine's speaker only. For example if I view a film in VLC/Totem only video is visible and I can't hear the audio. Is there a way to forward audio too? [without digging through Pulse-audio's setup, I mean; Like how ssh understands X forwarding by itself.]



I have tried this only in Ubuntu (in various Ubuntu versions from 9.10 through 10.10), if that helps.










share|improve this question





























    27















    While it is possible to use X applications remotely by using -X switch in ssh, the sound is being played in remote machine's speaker only. For example if I view a film in VLC/Totem only video is visible and I can't hear the audio. Is there a way to forward audio too? [without digging through Pulse-audio's setup, I mean; Like how ssh understands X forwarding by itself.]



    I have tried this only in Ubuntu (in various Ubuntu versions from 9.10 through 10.10), if that helps.










    share|improve this question

























      27












      27








      27


      18






      While it is possible to use X applications remotely by using -X switch in ssh, the sound is being played in remote machine's speaker only. For example if I view a film in VLC/Totem only video is visible and I can't hear the audio. Is there a way to forward audio too? [without digging through Pulse-audio's setup, I mean; Like how ssh understands X forwarding by itself.]



      I have tried this only in Ubuntu (in various Ubuntu versions from 9.10 through 10.10), if that helps.










      share|improve this question














      While it is possible to use X applications remotely by using -X switch in ssh, the sound is being played in remote machine's speaker only. For example if I view a film in VLC/Totem only video is visible and I can't hear the audio. Is there a way to forward audio too? [without digging through Pulse-audio's setup, I mean; Like how ssh understands X forwarding by itself.]



      I have tried this only in Ubuntu (in various Ubuntu versions from 9.10 through 10.10), if that helps.







      ssh






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 11 '11 at 20:06









      AkilanAkilan

      3181515




      3181515






















          1 Answer
          1






          active

          oldest

          votes


















          26














          First, run paprefs, go to Network Server and check Enable network access to local sound devices. This will load "module-native-protocol-tcp" in PulseAudio.



          You can now access the PulseAudio server in several ways:



          Manually forward the TCP connection over SSH




          1. Use pax11publish to discover your PulseAudio listener port (usually 4713);

          2. Connect to another computer with ssh -R 24713:localhost:4713 (the remote port '24713' was chosen arbitrarily);

          3. Copy your authentication cookie (~/.config/pulse/cookie) to that computer;

          4. Finally run export PULSE_SERVER="tcp:localhost:24713" and test with pactl info.


          Use automatic direct connection with X11-based discovery



          Whenever you SSH with X11 forwarding enabled, PulseAudio programs use X11 to discover your sound server (use pax11publish or xprop -root PULSE_SERVER to see for yourself). They will try to establish a direct (non-SSH, unencrypted) connection to your computer for audio streaming.



          Use automatic direct connection with DNS-SD discovery



          If you have avahi-daemon and pulseaudio-zeroconf installed, you can activate "Allow other machines to discover local devices". This will load "module-zeroconf-publish".



          Other computers, with the option "Make discoverable network devices available locally" enabled (module-zeroconf-discover), will automatically list outputs (sinks) that your computer exports. They will use a direct (unencrypted) connection for audio streaming.



          This method also requires ~/.config/pulse/cookie to be identical across hosts.






          share|improve this answer





















          • 2





            Where does ~/.pulse_cookie exist? On the remote or locally?

            – HSchmale
            Dec 29 '15 at 0:29






          • 2





            Both. It's generated by the pulseaudio daemon, then read by connecting clients (like a password), so you'll want to copy it from the server to clients. (Note that the path has since been changed to ~/.config/pulse/cookie; if one doesn't work, try the other.)

            – grawity
            Dec 29 '15 at 15:29








          • 2





            Note that after changing the settings in paprefs, you must manually restart at least pulseaudio. In my case, after spending hours trying to figure out what was wrong, I just rebooted, and then everything worked :).

            – crazy2be
            Jun 1 '16 at 23:59











          • This worked for me, thanks. Using a remote raspberry pi with rtl-sdr, hence wanting to get audio over ssh working.

            – Paul M
            16 hours ago












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f231920%2fforwarding-audio-like-x-in-ssh%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          26














          First, run paprefs, go to Network Server and check Enable network access to local sound devices. This will load "module-native-protocol-tcp" in PulseAudio.



          You can now access the PulseAudio server in several ways:



          Manually forward the TCP connection over SSH




          1. Use pax11publish to discover your PulseAudio listener port (usually 4713);

          2. Connect to another computer with ssh -R 24713:localhost:4713 (the remote port '24713' was chosen arbitrarily);

          3. Copy your authentication cookie (~/.config/pulse/cookie) to that computer;

          4. Finally run export PULSE_SERVER="tcp:localhost:24713" and test with pactl info.


          Use automatic direct connection with X11-based discovery



          Whenever you SSH with X11 forwarding enabled, PulseAudio programs use X11 to discover your sound server (use pax11publish or xprop -root PULSE_SERVER to see for yourself). They will try to establish a direct (non-SSH, unencrypted) connection to your computer for audio streaming.



          Use automatic direct connection with DNS-SD discovery



          If you have avahi-daemon and pulseaudio-zeroconf installed, you can activate "Allow other machines to discover local devices". This will load "module-zeroconf-publish".



          Other computers, with the option "Make discoverable network devices available locally" enabled (module-zeroconf-discover), will automatically list outputs (sinks) that your computer exports. They will use a direct (unencrypted) connection for audio streaming.



          This method also requires ~/.config/pulse/cookie to be identical across hosts.






          share|improve this answer





















          • 2





            Where does ~/.pulse_cookie exist? On the remote or locally?

            – HSchmale
            Dec 29 '15 at 0:29






          • 2





            Both. It's generated by the pulseaudio daemon, then read by connecting clients (like a password), so you'll want to copy it from the server to clients. (Note that the path has since been changed to ~/.config/pulse/cookie; if one doesn't work, try the other.)

            – grawity
            Dec 29 '15 at 15:29








          • 2





            Note that after changing the settings in paprefs, you must manually restart at least pulseaudio. In my case, after spending hours trying to figure out what was wrong, I just rebooted, and then everything worked :).

            – crazy2be
            Jun 1 '16 at 23:59











          • This worked for me, thanks. Using a remote raspberry pi with rtl-sdr, hence wanting to get audio over ssh working.

            – Paul M
            16 hours ago
















          26














          First, run paprefs, go to Network Server and check Enable network access to local sound devices. This will load "module-native-protocol-tcp" in PulseAudio.



          You can now access the PulseAudio server in several ways:



          Manually forward the TCP connection over SSH




          1. Use pax11publish to discover your PulseAudio listener port (usually 4713);

          2. Connect to another computer with ssh -R 24713:localhost:4713 (the remote port '24713' was chosen arbitrarily);

          3. Copy your authentication cookie (~/.config/pulse/cookie) to that computer;

          4. Finally run export PULSE_SERVER="tcp:localhost:24713" and test with pactl info.


          Use automatic direct connection with X11-based discovery



          Whenever you SSH with X11 forwarding enabled, PulseAudio programs use X11 to discover your sound server (use pax11publish or xprop -root PULSE_SERVER to see for yourself). They will try to establish a direct (non-SSH, unencrypted) connection to your computer for audio streaming.



          Use automatic direct connection with DNS-SD discovery



          If you have avahi-daemon and pulseaudio-zeroconf installed, you can activate "Allow other machines to discover local devices". This will load "module-zeroconf-publish".



          Other computers, with the option "Make discoverable network devices available locally" enabled (module-zeroconf-discover), will automatically list outputs (sinks) that your computer exports. They will use a direct (unencrypted) connection for audio streaming.



          This method also requires ~/.config/pulse/cookie to be identical across hosts.






          share|improve this answer





















          • 2





            Where does ~/.pulse_cookie exist? On the remote or locally?

            – HSchmale
            Dec 29 '15 at 0:29






          • 2





            Both. It's generated by the pulseaudio daemon, then read by connecting clients (like a password), so you'll want to copy it from the server to clients. (Note that the path has since been changed to ~/.config/pulse/cookie; if one doesn't work, try the other.)

            – grawity
            Dec 29 '15 at 15:29








          • 2





            Note that after changing the settings in paprefs, you must manually restart at least pulseaudio. In my case, after spending hours trying to figure out what was wrong, I just rebooted, and then everything worked :).

            – crazy2be
            Jun 1 '16 at 23:59











          • This worked for me, thanks. Using a remote raspberry pi with rtl-sdr, hence wanting to get audio over ssh working.

            – Paul M
            16 hours ago














          26












          26








          26







          First, run paprefs, go to Network Server and check Enable network access to local sound devices. This will load "module-native-protocol-tcp" in PulseAudio.



          You can now access the PulseAudio server in several ways:



          Manually forward the TCP connection over SSH




          1. Use pax11publish to discover your PulseAudio listener port (usually 4713);

          2. Connect to another computer with ssh -R 24713:localhost:4713 (the remote port '24713' was chosen arbitrarily);

          3. Copy your authentication cookie (~/.config/pulse/cookie) to that computer;

          4. Finally run export PULSE_SERVER="tcp:localhost:24713" and test with pactl info.


          Use automatic direct connection with X11-based discovery



          Whenever you SSH with X11 forwarding enabled, PulseAudio programs use X11 to discover your sound server (use pax11publish or xprop -root PULSE_SERVER to see for yourself). They will try to establish a direct (non-SSH, unencrypted) connection to your computer for audio streaming.



          Use automatic direct connection with DNS-SD discovery



          If you have avahi-daemon and pulseaudio-zeroconf installed, you can activate "Allow other machines to discover local devices". This will load "module-zeroconf-publish".



          Other computers, with the option "Make discoverable network devices available locally" enabled (module-zeroconf-discover), will automatically list outputs (sinks) that your computer exports. They will use a direct (unencrypted) connection for audio streaming.



          This method also requires ~/.config/pulse/cookie to be identical across hosts.






          share|improve this answer















          First, run paprefs, go to Network Server and check Enable network access to local sound devices. This will load "module-native-protocol-tcp" in PulseAudio.



          You can now access the PulseAudio server in several ways:



          Manually forward the TCP connection over SSH




          1. Use pax11publish to discover your PulseAudio listener port (usually 4713);

          2. Connect to another computer with ssh -R 24713:localhost:4713 (the remote port '24713' was chosen arbitrarily);

          3. Copy your authentication cookie (~/.config/pulse/cookie) to that computer;

          4. Finally run export PULSE_SERVER="tcp:localhost:24713" and test with pactl info.


          Use automatic direct connection with X11-based discovery



          Whenever you SSH with X11 forwarding enabled, PulseAudio programs use X11 to discover your sound server (use pax11publish or xprop -root PULSE_SERVER to see for yourself). They will try to establish a direct (non-SSH, unencrypted) connection to your computer for audio streaming.



          Use automatic direct connection with DNS-SD discovery



          If you have avahi-daemon and pulseaudio-zeroconf installed, you can activate "Allow other machines to discover local devices". This will load "module-zeroconf-publish".



          Other computers, with the option "Make discoverable network devices available locally" enabled (module-zeroconf-discover), will automatically list outputs (sinks) that your computer exports. They will use a direct (unencrypted) connection for audio streaming.



          This method also requires ~/.config/pulse/cookie to be identical across hosts.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 15 hours ago

























          answered Jul 18 '11 at 8:29









          grawitygrawity

          244k37516576




          244k37516576








          • 2





            Where does ~/.pulse_cookie exist? On the remote or locally?

            – HSchmale
            Dec 29 '15 at 0:29






          • 2





            Both. It's generated by the pulseaudio daemon, then read by connecting clients (like a password), so you'll want to copy it from the server to clients. (Note that the path has since been changed to ~/.config/pulse/cookie; if one doesn't work, try the other.)

            – grawity
            Dec 29 '15 at 15:29








          • 2





            Note that after changing the settings in paprefs, you must manually restart at least pulseaudio. In my case, after spending hours trying to figure out what was wrong, I just rebooted, and then everything worked :).

            – crazy2be
            Jun 1 '16 at 23:59











          • This worked for me, thanks. Using a remote raspberry pi with rtl-sdr, hence wanting to get audio over ssh working.

            – Paul M
            16 hours ago














          • 2





            Where does ~/.pulse_cookie exist? On the remote or locally?

            – HSchmale
            Dec 29 '15 at 0:29






          • 2





            Both. It's generated by the pulseaudio daemon, then read by connecting clients (like a password), so you'll want to copy it from the server to clients. (Note that the path has since been changed to ~/.config/pulse/cookie; if one doesn't work, try the other.)

            – grawity
            Dec 29 '15 at 15:29








          • 2





            Note that after changing the settings in paprefs, you must manually restart at least pulseaudio. In my case, after spending hours trying to figure out what was wrong, I just rebooted, and then everything worked :).

            – crazy2be
            Jun 1 '16 at 23:59











          • This worked for me, thanks. Using a remote raspberry pi with rtl-sdr, hence wanting to get audio over ssh working.

            – Paul M
            16 hours ago








          2




          2





          Where does ~/.pulse_cookie exist? On the remote or locally?

          – HSchmale
          Dec 29 '15 at 0:29





          Where does ~/.pulse_cookie exist? On the remote or locally?

          – HSchmale
          Dec 29 '15 at 0:29




          2




          2





          Both. It's generated by the pulseaudio daemon, then read by connecting clients (like a password), so you'll want to copy it from the server to clients. (Note that the path has since been changed to ~/.config/pulse/cookie; if one doesn't work, try the other.)

          – grawity
          Dec 29 '15 at 15:29







          Both. It's generated by the pulseaudio daemon, then read by connecting clients (like a password), so you'll want to copy it from the server to clients. (Note that the path has since been changed to ~/.config/pulse/cookie; if one doesn't work, try the other.)

          – grawity
          Dec 29 '15 at 15:29






          2




          2





          Note that after changing the settings in paprefs, you must manually restart at least pulseaudio. In my case, after spending hours trying to figure out what was wrong, I just rebooted, and then everything worked :).

          – crazy2be
          Jun 1 '16 at 23:59





          Note that after changing the settings in paprefs, you must manually restart at least pulseaudio. In my case, after spending hours trying to figure out what was wrong, I just rebooted, and then everything worked :).

          – crazy2be
          Jun 1 '16 at 23:59













          This worked for me, thanks. Using a remote raspberry pi with rtl-sdr, hence wanting to get audio over ssh working.

          – Paul M
          16 hours ago





          This worked for me, thanks. Using a remote raspberry pi with rtl-sdr, hence wanting to get audio over ssh working.

          – Paul M
          16 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f231920%2fforwarding-audio-like-x-in-ssh%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

          looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...