Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've got a KDE desktop on Debian 10 where I run Kodi, VLC, and web browsers, all produce audio streams. I'd like to capture the combined stream and render it on a Raspberry Pi (it's got a USB sound card) on my LAN.
The obvious solution would be SoX, "rec -c 2 -t wav | ssh Pi play". But every syntax for the rec(1) command that I have tried captures only white noise. Same with gst-launch-1.0.
Sorry if this question belongs elsewhere, but it spans desktop, network, and audio. And there are years-old threads in the KDE forums asking the same question there, and never any answers posted.
I don't use KDE, so I don't know if there is a "KDE" way of doing this, but I do this with "paprefs" - it's a pulseaudio preferences graphical utility. I have XFCE4 running on all of the relevant machines.
On the server, I go to the Network Server tab and set "Enable network access to local sound devices" and the sub-options (Allow other machines on the LAN to discover local sound devices and Don't require authentication.)
On the clients, I go to the Network Access tab and set "Make discoverable PulseAudio network sound devices available locally".
At that point, I might reboot the server because sometimes it doesn't seem to entirely "take" immediately.
On the client machines, the network audio output option is visible in XFCE4's pulseaudio volume control. I don't know how it looks in KDE, but it'll be something similar. To force everything to go to the network device, you can deactivate your local sound.
If your Raspberry Pi does not have a GUI (like XFCE4) installed, then it may be a bit more complicated to set up.
That said, I hope you're streaming sound over wired networking. I find performance fine over wired network but over wifi it just isn't really usable.
Yeah it should be possible with using socat, pulseaudio, and ssh.
Something like:
edit default.pa
make sure
load-module module-esound-protocol-tcp auth-anonymous=1
load-module module-native-protocol-tcp auth-anonymous=1
(i think it could be more secure without auth-anonymous) come to think..
and then start pulseaudio. or restart it.
On the pc you want to send sound from you need to create an ssh connect with the -L flag to send the sound through.
ssh -L4000:localhost:4000 localipaddress of pc to recieve sound.
and then in the same ssh session you can go ahead and start socat with
socat TCP-listen:4000,fork TCP:localhost:4713
with this setup you can now receive sound from the pulseaudio server on port 4000.
maybe try
rec -c 2 -t wav | PULSE_SERVER=localhost:4000 ssh Pi play
helpful hints in gnome you can make use of gnome-session-inhibit and this process works this way.
fuser is a good command also for stale ports since sometimes after awhile after connecting and reconnecting the port will need it.
Last edited by slackartist; 06-16-2021 at 05:52 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.