{"id":2547,"date":"2017-06-02T23:51:07","date_gmt":"2017-06-02T21:51:07","guid":{"rendered":"http:\/\/monodes.com\/predaelli\/?p=2547"},"modified":"2017-06-02T23:51:07","modified_gmt":"2017-06-02T21:51:07","slug":"forwarding-audio-elsewhere-on-linux","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2017\/06\/02\/forwarding-audio-elsewhere-on-linux\/","title":{"rendered":"Forwarding audio elsewhere on Linux"},"content":{"rendered":"<p>These days I&#8217;ve been attending to an online course that require me not to do anything else in the user session beside watching and listening.<\/p>\n<p>Actually I&#8217;ve been able to pass two checks while I&#8217;ve been hacking on another machine, just listening and watching now and then.<\/p>\n<p>But it&#8217;s boring to plug headphones into the &#8220;secondary&#8221; machine and switch off the audio on the main one.<\/p>\n<p>Luckily we have PulseAudio on Linux.<\/p>\n<p><!--more--><\/p>\n<p>It was just a matter on<\/p>\n<ol>\n<li>using <code class=\"\" data-line=\"\">paprefs<\/code> and telling to listen on the net,<\/li>\n<li>issuing <code class=\"\" data-line=\"\">pactl load-module module-native-protocol-tcp auth-ip-acl&lt;span class=&quot;o&quot;&gt;=&lt;\/span&gt;&lt;span class=&quot;m&quot;&gt;rigel.local&lt;\/span&gt;<\/code><\/li>\n<li>on the secondary machine launching <code class=\"\" data-line=\"\">PULSE_SERVER=rigel.local firefox<\/code><\/li>\n<\/ol>\n<p>Voil\u00e0, the audio of firefox is forwarded. Ok, uncompressed and unencrypted, but it&#8217;s on my own LAN, so that&#8217;s not a problem<\/p>\n<p><!--nextpage--><\/p>\n<p>From: <em><a href=\"https:\/\/en.wikibooks.org\/wiki\/Configuring_Sound_on_Linux\/Pulse_Audio\/Remote_server\">Configuring Sound on Linux\/Pulse Audio\/Remote server &#8211; Wikibooks, open books for an open world<\/a><\/em><\/p>\n<blockquote>\n<h2><span id=\"RTP\" class=\"mw-headline\">RTP<\/span><\/h2>\n<p>RTP streams use multicast IP adresses like 224.0.0.56 (default) and UDP datagrams for transport. Multicasts are generally not allowed in Internet (blocked by ISPs). RTP is designed for low latency.<\/p>\n<h3><span id=\"Server\" class=\"mw-headline\">Server<\/span><\/h3>\n<div class=\"mw-highlight mw-content-ltr\" dir=\"ltr\">\n<pre> $ pactl load-module module-rtp-recv\n<\/pre>\n<\/div>\n<h3><span id=\"Client\" class=\"mw-headline\">Client<\/span><\/h3>\n<dl>\n<dt><a class=\"external text\" href=\"http:\/\/videolan.org\" rel=\"nofollow\">VLC<\/a><\/dt>\n<dd><a class=\"external text\" href=\"http:\/\/www.videolan.org\/doc\/videolan-howto\/en\/ch09.html\" rel=\"nofollow\">RTP docs<\/a><\/dd>\n<\/dl>\n<h2><span id=\"TCP\" class=\"mw-headline\">TCP<\/span><\/h2>\n<p>Only uncompressed audio is supported.<\/p>\n<h3><span id=\"Configuring_the_Server\" class=\"mw-headline\">Configuring the Server<\/span><\/h3>\n<p>This process is rather simple. You will need to load <a class=\"external text\" href=\"http:\/\/www.pulseaudio.org\/wiki\/Modules#module-native-protocol-unixtcp\" rel=\"nofollow\">module-native-protocol-tcp<\/a>. You can optionally specify an <tt>auth-ip-acl<\/tt> to permit\/blacklist anonymous connections from specific ips or IP ranges (to list more than one, separate by semicolon).<\/p>\n<div class=\"mw-highlight mw-content-ltr\" dir=\"ltr\">\n<pre>$ pactl load-module module-native-protocol-tcp auth-ip-acl<span class=\"o\">=<\/span><span class=\"m\">192<\/span>.168.1.138\n<\/pre>\n<\/div>\n<h3><span id=\"Configuring_the_Client\" class=\"mw-headline\">Configuring the Client<\/span><\/h3>\n<p>Simply set the environmental variable <tt>PULSE_SERVER<\/tt> to the destination and PulseAudio will redirect the stream over tcp to the provided destination.<\/p>\n<div class=\"mw-highlight mw-content-ltr\" dir=\"ltr\">\n<pre>$ PULSE_SERVER=192.168.1.146 totem\n<\/pre>\n<\/div>\n<\/blockquote>\n<p>Note, the audio server is the workstation where the audio speakers actually are<\/p>\n<p>And from <a href=\"https:\/\/superuser.com\/questions\/231920\/forwarding-audio-like-x-in-ssh\">https:\/\/superuser.com\/questions\/231920\/forwarding-audio-like-x-in-ssh<\/a><\/p>\n<blockquote><p>While it is possible to use X applications remotely by using -X switch in ssh, the sound is being played in remote machine&#8217;s speaker only. For example if I view a film in VLC\/Totem only video is visible and I can&#8217;t hear the audio. Is there a way to forward audio too? [without digging through Pulse-audio&#8217;s setup, I mean; Like how ssh understands X forwarding by itself.]<\/p>\n<div class=\"post-text\">\n<p>The easy way: Run <code class=\"\" data-line=\"\">paprefs<\/code>, go to <em>Network Server<\/em> and check <em>Enable network access to local sound devices<\/em>.<\/p>\n<p>Whenever you SSH with X11 forwarding enabled, PulseAudio programs use X11 to discover your sound server (use <code class=\"\" data-line=\"\">pax11publish<\/code> or <code class=\"\" data-line=\"\">xprop -root PULSE_SERVER<\/code> to see for yourself). Just tell PulseAudio to listen for network connections (<code class=\"\" data-line=\"\">paprefs<\/code> as described above), and all X11 programs will be able to use it.<\/p>\n<p>(Other users will not have access to your sound server, unless you allow it yourself in <code class=\"\" data-line=\"\">paprefs<\/code>. The authentication data is carried over in the X11 <code class=\"\" data-line=\"\">PULSE_COOKIE<\/code> property, or you can copy <code class=\"\" data-line=\"\">~\/.pulse_cookie<\/code> manually.)<\/p>\n<p>Note however, that the PulseAudio stream is not encrypted this way, so it is okay for use at home, but not over the Internet.<\/p>\n<hr \/>\n<p>The slightly more complicated way: Enable network access as above, but tunnel PulseAudio over SSH TCP forwarding. Use <code class=\"\" data-line=\"\">pax11publish<\/code> to discover your PulseAudio port (usually 4713), connect with <code class=\"\" data-line=\"\">ssh -R 24713:localhost:4713<\/code>, then run <code class=\"\" data-line=\"\">export PULSE_SERVER=&quot;tcp:localhost:24713&quot;<\/code>. This will be slightly slower due to SSH overhead, but is safe to use over the Internet.<\/p>\n<\/div>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">These days I&#8217;ve been attending to an online course that require me not to do anything else in the user session beside watching and listening. Actually I&#8217;ve been able to pass two checks while I&#8217;ve been hacking on another machine, just listening and watching now and then. But it&#8217;s boring to plug headphones into the&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2017\/06\/02\/forwarding-audio-elsewhere-on-linux\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_members_access_role":[],"_members_access_error":""},"categories":[72],"tags":[160],"class_list":["post-2547","post","type-post","status-publish","format-standard","hentry","category-documentations","tag-pulseaudio"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-F5","jetpack-related-posts":[{"id":11302,"url":"https:\/\/monodes.com\/predaelli\/2024\/02\/05\/quickemu\/","url_meta":{"origin":2547,"position":0},"title":"Quickemu","author":"Paolo Redaelli","date":"2024-02-05","format":false,"excerpt":"This quickemu could easily dislodge VirtualBox as my favorite desktop virtualization solution: Quickly create and run highly optimized desktop virtual machines for Linux, macOS and Windows; ... Quickemu now also includes comprehensive support for macOS and Windows. Features macOS Monterey, Big Sur, Catalina, Mojave & High Sierra Windows 10 and\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/monodes.com\/predaelli\/category\/apple\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2024\/02\/quickemu-logo.webp?fit=512%2C512&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":15957,"url":"https:\/\/monodes.com\/predaelli\/2026\/08\/25\/how-to-run-gui-applications-in-docker-x11-forwarding-and-vnc\/","url_meta":{"origin":2547,"position":1},"title":"How to Run GUI Applications in Docker (X11 Forwarding and VNC)","author":"Paolo Redaelli","date":"2026-08-25","format":"link","excerpt":"How to Run GUI Applications in Docker (X11 Forwarding and VNC) How to Run GUI Applications in Docker (X11 Forwarding and VNC) Learn how to run graphical applications inside Docker containers using X11 forwarding, VNC servers, and browser-based solutions for cross-platform GUI access. Running GUI applications in Docker enables isolated\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1645,"url":"https:\/\/monodes.com\/predaelli\/2016\/06\/06\/little-hidden-gems\/","url_meta":{"origin":2547,"position":2},"title":"Little, hidden gems.","author":"Paolo Redaelli","date":"2016-06-06","format":false,"excerpt":"I was looking for a Tiny Core image with Firefox preinstalled, found this spartan web page: Marketplace - Firefox - GNS3 That has a hidden gem in it: http:\/\/downloads.sourceforge.net\/project\/gns-3\/Qemu%20Appliances\/linux-tinycore-linux-6.4-firefox-33.1.1-2.img A bootable image with a pretty recent web browser. It's always useful.","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4928,"url":"https:\/\/monodes.com\/predaelli\/2018\/11\/17\/green-recorder-a-simple-screen-recorder-for-linux-with-wayland-support-2daygeek-com\/","url_meta":{"origin":2547,"position":3},"title":"Green Recorder &#8211; A Simple Screen Recorder For Linux With Wayland Support | 2daygeek.com","author":"Paolo Redaelli","date":"2018-11-17","format":false,"excerpt":"Green recorder is a free, open source, simple desktop recorder for Linux systems and written using Python, GTK+3 and ffmpeg. It supports audio and video Source: Green Recorder - A Simple Screen Recorder For Linux With Wayland Support | 2daygeek.com","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8136,"url":"https:\/\/monodes.com\/predaelli\/2021\/01\/31\/piping-video-over-ssh\/","url_meta":{"origin":2547,"position":4},"title":"Piping video over ssh","author":"Paolo Redaelli","date":"2021-01-31","format":false,"excerpt":"My situation is not the same depicted in \"Can I pipe \/dev\/video over ssh\" but I have a similar need. See an audio-video flow from an RTSP camera which is not accessible - by choice! - from the net but there is an accessible Linux machine which can talk to\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11263,"url":"https:\/\/monodes.com\/predaelli\/2024\/01\/27\/firefox-is-finally-providing-deb-package-for-debian-and-ubuntu-users\/","url_meta":{"origin":2547,"position":5},"title":"Firefox is Finally Providing Deb Package for Debian and Ubuntu Users","author":"Paolo Redaelli","date":"2024-01-27","format":false,"excerpt":"Mozilla Firefox has a new native package available for Linux. Source: Ah, Snap! Firefox is Finally Providing Deb Package for Debian and Ubuntu Users","rel":"","context":"In &quot;Software Libero&quot;","block_context":{"text":"Software Libero","link":"https:\/\/monodes.com\/predaelli\/category\/software\/software-libero\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/2547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=2547"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/2547\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=2547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=2547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=2547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}