You are not logged in.

#1 2010-01-03 16:15:58

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Help with NAS (Network Audio System) setup.

Anyone having any ideas how to set up this? I couldn't find any documentation, no howtos, no help, just an obscure nasd.con.eg in the package.
Has anyone managed to set up a client and a server for this system, it'd be really useful to me...


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#2 2010-01-03 17:12:58

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Help with NAS (Network Audio System) setup.

What are you gonna do with it? If it's simple stuff, I've written a small thing called RSound which might help you. http://aur.archlinux.org/packages.php?ID=33101 Tried NAS myself once, gave up though. Partly the reason why I started writing this. tongue

Last edited by Themaister (2010-01-03 17:20:45)

Offline

#3 2010-01-03 19:49:41

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: Help with NAS (Network Audio System) setup.

Well... I have a machine with good speakers, but I'm usually in bed with my notebook. And while music playing is solved using mpd + sonata on the notebook to control, there are some movies with low volume audio and even if I set my laptop speakers to max I can't here it. So I basicly need sometimes to redirect my mplayer audio output to the machine with good speakers. I tried (I use oss4 though but I tried your oss backend) and it didn't work well...
I'll try rsound (it's a different more advanced thing, as far as I see) tomorrow maybe, but if someone could point me to a NAS tutorial, I wouldn't refuse to give it a try too...


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#4 2010-01-03 20:06:38

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: Help with NAS (Network Audio System) setup.

Okay... Several troubles with rsound...
On the server side I initiate it with

rsoundserv -b oss -p 14567

and no matter whether I use the -d switch or not it looks for oss device at /dev/audio, which clearly is not the case.
On the client side

 rsound 85.187.41.92 -p 14567 --raw < temp/bar.wav

sends the data fine, however
mplayer is playing at 2x speed when initialized with the command

gmplayer ../\[DB\]_Bleach_225_\[C63D149C\].avi -ao pcm:file=bar.wav

EDIT:
the problem is in the oss.h library which points to invalid oss device... will try to hack your code xD
EDIT2:
Okay, with my hack everything works fine (except the audio is not synchd with the video from mpayer hmm so not usable yet). I suggest you make separate flags for oss and oss4 ;p

Last edited by Dheart (2010-01-03 20:15:40)


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#5 2010-01-03 22:12:29

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Help with NAS (Network Audio System) setup.

ah... I will try to make it possible to select which OSS device to use with -d. I thought /dev/audio was the standard device to use, but appearantly it's not so. The -d switch was only intended for alsa, as I first made alsa version.

Also, I've had problems with MPlayer playing back video and dumping audio at the same time (sync issues etc), so the dumping and video should perhaps be done in separate processes. Also, --raw shouldn't be used for streams which aren't raw PCM streams. -ao pcm defaults to print a wave header.

I have a script for video if you want to try it out.

#!/bin/sh

SS=""
if [ ! -z "$3" ]; then
    SS="-ss $3" # If third param is set, adds new -ss parameter to mplayer
fi
rm /tmp/temp.wav
mkfifo /tmp/temp.wav
rsound $1 < /tmp/temp.wav &
mplayer "$2" -vo null -vc null -ao pcm:file=/tmp/temp.wav $SS -nocorrect-pts & # Dumps audio via FIFO to rsound
mplayer -nosound -ao null "$2" $SS # Plays back video
killall rsound # Makes sure that audio dumping stops when video has exited
killall mplayer

EDIT: Okay, made it possible to select device with -d while using OSS. -d /dev/dsp, etc. Changed default OSS device to /dev/dsp also. I've tried rsoundserv on both OSS and OSSv4, and they work the same.

Last edited by Themaister (2010-01-04 09:50:26)

Offline

#6 2010-01-04 07:22:36

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: Help with NAS (Network Audio System) setup.

I'm having troubles figuring out your script, could you please help me as to how exactly should I evoke it?


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#7 2010-01-04 09:39:48

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Help with NAS (Network Audio System) setup.

I usually run the script as:

extern-movie.sh 10.0.0.4 movie.mkv

If you want the mplayer processes to start at a specific time (in seconds), you can give it a third argument. Since the script uses two different mplayer processes, I guess it's hard/impossible to keep the sync between them should you want to skip stuff or something in the middle of a movie.

extern-movie.sh 10.0.0.4 movie.mkv 124 #starts at 124s in movie.

The script doesn't include a -p option, so unless you change it, it uses the default port 12345.

On the 3-4 setups I've tried, this works really well, and no noticeable delay between the audio and video (probably due to the inherit low latency of OSS and ALSA.) The script is kinda quick 'n dirty, as you may see. tongue

Last edited by Themaister (2010-01-04 10:09:46)

Offline

#8 2010-01-04 16:33:09

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: Help with NAS (Network Audio System) setup.

Yes, this works, however no seeking support ;/
How hard would it be to write an audio plug in for mplayer?
I guess really hard...


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#9 2010-01-04 18:45:46

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Help with NAS (Network Audio System) setup.

Idd, seeking is hard and really hacky (:D) to implement with the two process solution. :\ You can use the

extern-movie.sh 10.0.0.4 movie.mkv 124

to seek where you want in the files, but you'd have to exit the script, then restart the script in the middle of a movie ... :\ Writing a plugin for MPlayer might kinda defeat the simplistic design of rsound. Shouldn't be hard to implement though. I made an rsound client in python in like 5 mins, so shouldn't be too hard.

As for NAS: http://linux.die.net/man/1/nasd this helped a little, but it really looks like legacy software. "When the Network Audio System server starts up, it takes over /dev/audio."
I've been trying to get nas up and running, and it wasn't hard to get it to play some stuff with mplayer, but it feels quite broken using the default config + mplayer. Might be my alsa emulation of course, but mplayer showed hickups, erratic framerate (-autosync 100 helped against this), bad sound quality, and a couple of crashes.

You could try this from the command line. Shouldn't need to set-up any config file yet.

sudo nasd -aa

And running this in another shell:

mplayer <movie> -ao nas

Try it locally, not sure how to set up nas to connect to extern servers. :\

Last edited by Themaister (2010-01-04 18:47:10)

Offline

#10 2010-01-04 20:25:41

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: Help with NAS (Network Audio System) setup.

hahahahah xD. If it looks for dev audio.. Ye... But there should be some way to set it up, because the last update is from 2009 and it "should" have oss4 implementation...
Well... I guess I should take my time to learn some programming, but a rsound plugin for mplayer would really rock. thank you for you help I guess I'll go that solution which works unlike nas....
Thank you and have a nice nice nice month and year.


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

Board footer

Powered by FluxBB