LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-14-2021, 06:30 PM   #1
clsgis
Member
 
Registered: Nov 2007
Posts: 37
Blog Entries: 4

Rep: Reputation: 5
Question Stream desktop audio across network.


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.
 
Old 06-14-2021, 08:25 PM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
1 members found this post helpful.
Old 06-16-2021, 05:30 AM   #3
slackartist
Member
 
Registered: Oct 2015
Location: Where the buffalo's roam
Distribution: Slackware Current Multilib
Posts: 161
Blog Entries: 20

Rep: Reputation: 26
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.
 
  


Reply

Tags
audio, gstreamer, kde5, pulseaudio, sox



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I setup a stream across a subnet using a http proxy... trist007 Linux - Newbie 1 06-27-2010 02:51 PM
program to stream the stream (or maybe streaming proxy?) jimmykarily Linux - Software 1 05-13-2009 04:35 AM
How to record a stream and start a new outputXXX.avi/mp3 for each new stream title ? frenchn00b Linux - General 4 08-04-2008 05:40 AM
Howto transcode & relay a MPEG stream to a WMV stream?? crazyivan Linux - Software 0 06-15-2007 03:18 AM
Cannot stream media across network ckent Linux - Networking 7 01-16-2007 10:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration