LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-07-2006, 07:10 AM   #1
martinr
Member
 
Registered: Mar 2006
Location: Stockholm, Sweden
Distribution: FC10 x86_64, RHEL4/5 x86_64
Posts: 87

Rep: Reputation: 15
playing audio files over ssh connection (linux-linux)


Hello everyone,

I'm using Redhat ES at work and FC5 at home and I'd like to access and play my music files from my home desktop at work. I'm using ssh to move files around and do everything else so I'd really like to be able to stream audio using the same connection.

I've just recently installed FC5 at home and I haven't really decided on the best mp3 player yet (any suggestions?). I'm currently trying "xmms" but I aint too thrilled with it since it doesn't have any "music library" feature.

I'd preffer it if I could simply ssh to my computer, run my music-playing program there, and let it tranfer its audio output along with it's visual appearence (which of course works allready). Preferably fairly automatic. I've heard about "esound", but I have no idear how to make it work. newbie, remember.

I'm really thankful for any help.
 
Old 04-08-2006, 07:06 PM   #2
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
I'm mildly surprised that no one's jumped into this one yet, so I'll step up.

Firstly, if you're looking to play your home music at work via ssh and esound, it is, indeed, possible, but very 'expensive' in terms of bandwidth use. Consider that a decent quality mp3 is 128 kbps (and the bitrate snobs would disagree and insist on at least 192 kbps, or vbr >192, or 320....), then your upstream and downstream bandwidth is going to have to be >128 kbps.

An easy solution, in terms of ease-of-use/configuration, is gnump3. This is a daemon that will read your music collection upon startup and will allow you to access your music library from wherever you have an internet connection - this can be accomplished through ssh, or via http, or both. The http connection can be username:password accessible (and I would imagine there are stronger authentication options, but is it really necessary?..)

Gnump3 can also be configured to downsample the bitrate to what both your home and work connections can handle without adversely affecting the other bandwidth needs. If your work station is simply a matter of a desktop pc with a couple of pc-type speakers, then downsampling to 32 kbps or even 16 is probably sufficient.

The 'downside' to gnump3 is that it doesn't stream what you may actually be playing at home ie., it's not a 'broadcast' per se; it simply allows remote access to your home music collection.

A 'broadcast' solution is vlc. Vlc offers more options via the broadcast route, because you have more input and output possibilities. Last summer I was working at a place that had two-way satellite high speed connection, but because of fair access policies, etc, it wasn't possible to consume more than about 10 MB/hour bandwidth. Hence, wanting the best quality possible, at the lowest bitrate possible, I was able to transcode the stream to a 0 quality ogg stream, in stereo, at about 16kbps. And, quite frankly, it sounded pretty darn good (thank god for ogg)

In short, you can play vlc at home and stream what you're playing at home to your workplace. Therefore, your cat and you are listening to the same thing at the same time.

Here's a sample vlc command-line stream (then I'll show you the ssh command line for both vlc and gnump3)

Code:
vlc -I http --control http:rc --rc-host :4800 --http-host :7000 --no-rc-show-pos --volume 500 --spdif -vvv /home/laptop/all.m3u --random --sout-keep --sout '#duplicate{dst=display,dst="transcode{acodec=vorb,anc=vorbis{quality=2},ab=64,samplerate=44100,channels=2}:standard{access=http,mux=ogg,url=192.168.3.2:8000}"}'
To explain what's going on:
vlc opens in the background with an http interface available. vlc can be controlled by both the http interface, on port 7000, and a remote control advanced telnet interface on port 4800. It's playing the all.m3u playlist, at random, and keeps the stream-out alive between tracks. The stream-out (sout) is duplicated: the first stream plays locally (display), whilst the duplicate stream is transcoded via vorbis, to a quality of 2, at a bitrate of 64, 44100 mhz, stereo, with an ogg stream via http on port 8000. (whew)

Vlc 'talks' best to vlc, so if you want to connect problem-free at work, use vlc.

If you go the gnump3 route, then your work music player doesn't matter (as long as it can play http streams....)

As far as ssh is concerned, here's the command:

Code:
ssh  -l  username  your_external_adsl_ip_address  -L  8000:127.0.0.1:8000
once you have established your ssh connection using this command, you can point your music player (vlc method) or browser (gnump3 method) to localhost:8000, and voila, you're listening to music you can't possibly complain about.

obviously, whatever port you're using for your stream, be it gnump3, vlc, or whatever else may come your way is what you would put before the 127.0.0.1.

hope this gets you on your way...

EDIT: had to get rid of those damn smileys...they're spookier than clowns....

cheers,

Last edited by mrclisdue; 04-08-2006 at 10:05 PM.
 
Old 04-18-2006, 08:31 AM   #3
martinr
Member
 
Registered: Mar 2006
Location: Stockholm, Sweden
Distribution: FC10 x86_64, RHEL4/5 x86_64
Posts: 87

Original Poster
Rep: Reputation: 15
Hello again,

I haven't had the time to try the above yet since I havent been able to get VLC to work with mp3:s. I've just found the the program amaroK, which behaves much like iTunes. I allready love it!

Now... eh.. is there some way of getting my above wish to work with this program? There seems to be options about it in the configuration menu. Just in case someone have allready tried it? AmaroK seems so very much above every other program I have tried so there got to be a lot of people experimenting with it.

thanks a lot for the help
 
Old 04-18-2006, 08:58 AM   #4
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
It's a shame you can't get the mp3's to work in vlc - I've seen threads around here relating to that issue, but it's not something i can address.

Here's a howto for amarok streaming:

http://www.linux.ie/articles/streamingaudio.php

IIRC, icecast and ices stream only in ogg format. You will, undoubtably, have people warn you about transcoding mp3s (which are lossy) to oggs (which are lossy), and how it's the end of the world, soundwise, but as I indicated in my intitial reply to your query, 'sound is in the ear of the beholder.'

If your ultimate goal is to listen 'radio-style' to your home music collection while you work, then you'll probably be quite satisfied. I guess what I'm trying to say is that if you're transcoding a 192kbps mp3 to a 64kbps ogg, you have nothing to worry about. Where it 'may' get iffy is if you're transcoding the mp3 to a 'like' kbps ogg, and expecting it to sound the same; then again, maybe only 'you' will know the truth...


cheers,
 
Old 12-03-2007, 10:06 AM   #5
rouzbeh58
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Rep: Reputation: 0
I am playing my songs over ssh by mounting the target by sshfs protocol. Here is what I have in my /etc/fstab:

sshfs#USERNAME@YOUR.SSH.SERVER:/FOLDER/ /mnt/MNTPOINT fuse uid=1002,gid=100,umask=0,allow_other 0 0

ofcourse, your uid and gid will change based on your UserID and GroupID.
then just do a "mount -a" to reread fstab, and you can cd to that mount point and use it.

Last edited by rouzbeh58; 12-03-2007 at 10:09 AM.
 
Old 12-03-2007, 05:13 PM   #6
the_ultimate_samurai
Member
 
Registered: Jan 2006
Distribution: debian-lenny
Posts: 37

Rep: Reputation: 15
one thing i have done with this is to simply mount the FS that the songs are located on with nfs. and then just play them with juk. streamwise im not sure how this translates...i imagine the songs are actually playing on your computer not the computer with the files, the data of the file itself is being transmited across the network...if you goal is perhaps to have the host computer do all the work and you get the results, i dont know if this would be the solution. but i remember one time i was far away from my computer as i was sleeping and couldnt bring it with me so i just NFSed the hdd and ran it localy.
 
Old 05-18-2014, 04:06 PM   #7
zarglink
LQ Newbie
 
Registered: Feb 2012
Location: right coast oo ess aye
Distribution: slackware, knoppix, grml, FreeBSD
Posts: 8

Rep: Reputation: Disabled
Exclamation solution to question as asked

the answer to the question as asked (how to listen to sound using x11 forwarding) is to use something (pulse audio) to allow network access to the sound device on the server. in pluse audio this is done with the program paprefs.

The answers here so far actually explain work-arounds on how to accomplish the task of listening to audio from a remote machine (server) on your local machine (client), but they do not actually answer the user's question as asked, which as I read it was how to hear on your client the sound generated by a program (any program that plays sound) running on the server.
the implications of this are that by accessing the sound device on the server you could have (i'll use a fictitious one) a program like foowave.bin which plays sound installed no where else but on your server, ssh in from your client, start foowave.bin and hear it on your client. you can listen to youtube videos on your server's browser, run mplayer, kaffeine, xmms, you name it, it will work.

as far as mounting nfsd or sshfs over wan, its all good till its not. especially with nfsd....good luck trying to kill a stale share without rebooting when your connection craps out, and although sshfs is a good answer on how to accomplish the task of listening to the audio, it (and none of the other answers) doesnt address the question of how to do it via x11 forwarding.

Just being precise....as a newbie it was irritating to me to have people tell me to do something else instead of how to make the software I had in mind do what I wanted it to.

Linux is about control right? Make it do......what you want it to.
 
Old 05-18-2014, 04:11 PM   #8
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Did anybody mention MPD yet?
 
Old 05-18-2014, 05:57 PM   #9
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
zarglink all the way bask in 2007
Fedora CORE 5 did not have pulse audio YET
 
Old 05-18-2014, 09:12 PM   #10
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
zarglink all the way bask in 2007
Fedora CORE 5 did not have pulse audio YET
Maybe not then, but I appreciate the tip now. I have a pretty huge .mp3 library sitting on a Fedora 20 box, and I'm off to try out hooking up over ssh to play using some command-line player on the "server" and shuffle the audio to my remote workstation via pulse.
 
  


Reply



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
Playing rm Real Audio files? phlyersphan Linux - Software 7 08-23-2004 02:12 PM
Problem playing Audio CD's on Linux mdk hari_seldon99 Linux - Software 3 02-02-2004 08:55 PM
Playing Audio Files in Redhat 7.2 newbie2linux Linux - Newbie 2 12-04-2003 03:52 PM
Playing 2 audio files simulatanously with Alsa dnar Linux - Software 5 05-26-2003 08:00 AM
playing real audio files gadhiraju Linux - General 2 09-04-2001 05:36 AM

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

All times are GMT -5. The time now is 07:37 PM.

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