You are not logged in.
Hi, I've been working on an idea which I myself found quite useful over the time, and I've used it daily now for 2 months. I've had breaking problems with every sound daemon out there that does networking (afaik), and I wanted to get better at programming, so I started to write RSound. It is very simplistic (the code base being about 1/6 of esound's).
The server is quite simplistic, and doesn't do any sound mixing by itself, which all other popular sound servers do. RSound only tries to do networked audio, not to workaround legacy sound systems. It attempts to replace esound as the "simple sound server". It does not attempt to replace pulse, other than being far simpler. It also attempts to be platform independent with backend support for ALSA, OSS, libao and PortAudio. The "protocol" is so simple (there isn't really a protocol) that it is possible to create an rsound wav-player in python with approx 10 lines of code.
Clients can be implemented using librsound, an OSS-ish library in style. It is obviously not as advanced (500 sloc), and applications which require sophisticated features from sound APIs, or low output latency will not really work well (Pulse will be a better choise if you really need networked audio in those cases). It will however, work well with audio and video players. Since librsound was combat tested with MPlayer as reference, librsound supports everything that MPlayer needs in its audio stack, and therefore should support the needs of most applications.
The basic package consists of a CLI PCM player (similar to esdplay), and a server. It also provides the library. http://aur.archlinux.org/packages.php?ID=34028
There is an ALSA plugin, but just like with every plugin, it doesn't play nice with everything out there http://aur.archlinux.org/packages.php?ID=35527
For reference, there is an mplayer package with native rsound support. http://aur.archlinux.org/packages.php?ID=33401
An entry in .asoundrc could look like this
pcm.rsound {
type "rsound"
host "server"
}
Last edited by Themaister (2010-03-17 19:40:34)
Offline
Very nice, reminds me of a "suckless" pulseaudio
One minor thing that might be interesting to look at is using LD_PRELOAD or something similar to redirect sounds of those apps that can't output to a file or pipe, for example there is an alsa-oss package in Debian that can hook OSS calls in this fashion and redirect it to ALSA, so maybe something similar is possible here
Offline
Indeed, indeed. That is a really nice idea. If you can make apps write their raw audio that would otherwise go to /dev/audio or something of the sort to a file, then you could send that over the network I guess. I'll look into it.
Offline
KISS network audio, nice!
I don't use ALSA so I ask for OSS support . Just dumping the data into /dev/dsp should suffice, I think.
Making the daemon fork into background and creating multiple threads for each connection so you only have to run it once would also be nice.
Perhaps set up a git/hg/bzr repo so others can contribute?
Offline
I'll set up git or something tomorrow I guess. I'll try to add OSS-support, it should be a lot simpler than ALSA at least :3 Maybe the ralsac name will be useless. rsound sounds a bit more backend neutral.
EDIT: Git repo is up and PKGBUILD in AUR now pulls from git. http://github.com/Themaister/ralsa
Last edited by Themaister (2009-12-07 12:04:35)
Offline
KISS network audio, nice!
I don't use ALSA so I ask for OSS support
. Just dumping the data into /dev/dsp should suffice, I think.
Making the daemon fork into background and creating multiple threads for each connection so you only have to run it once would also be nice.Perhaps set up a git/hg/bzr repo so others can contribute?
Ok, now I think I've added what you requested OSS support with one thread per connection to it (same with ALSA version). About forking into background, isn't this done with & ? Or is there something I'm missing.
EDIT: Owh, it was just a simple as if ( fork() ) exit(0);
Last edited by Themaister (2009-12-09 17:15:33)
Offline
Cool, thank you. Works perfectly for stereo files
To make it work with mono input you can apply this patch:
http://git.server-speed.net/users/flo/r … 38b81ed243
Offline
Nice Ah, yes. Thanks for the fix.
Never tried with mono files. I'm pretty newb with git though. What's the right way to apply patches to the project, btw? I become the author of the patch when I commit this way. :x
I used
git apply rossd.patch
git commit
git push origin master
Guess I should learn some more if I want to use it.
EDIT: Okay, I guess git am did the trick xD
Last edited by Themaister (2009-12-10 01:33:53)
Offline
i contribute to an open source set-top box project where we're now offering a mipsel package of rsound/serv. i'm receiving positive feedback so far, here's two small requests you might want to consider:
- could you git-tag your release versions so our buildscript can automatically grab the latest release? the project policy is to only build release versions instead of current, and right now the build breaks when an older release tarball gets deleted on github
- we have a few boxtypes without also/oss, but which do support writing directly to the dvb audio adapter. would it possible to incorporate this scenario? here is an example of this:
http://schwerkraft.elitedvb.net/scm/vie … ibdreamdvd
(see section: CONFIG_API_VERSION == 3)
thx
ᶘ ᵒᴥᵒᶅ
Offline
Interesting indeed. I'll try to tag more I've been working on the v0.6 release, and there are quite a lot of changes, so I'll be sure to tag that.
That dvb example looks very OSS-ish with ioctl() etc, and write(). I guess you only need to write() raw audio to that audiofd. I don't have the hardware, so I doubt I could write the audio backend, but hopefully the oss.c example in the source should help. I've changed the name of the programs to rsd and rsdplay (less to write and resembles the naming scheme of other apps better I think), and changed some of the command line stuff.
Last edited by Themaister (2010-03-20 16:38:43)
Offline
is it possible to run mpd on a server and output it to my desktop with RSound?
I know this is possible with pulseaudio, but there it's a bit too complicated for me.....
Offline
Yes, you can I use it all the time myself.
Install rsound-git on both computers. http://aur.archlinux.org/packages.php?ID=34028
Install the alsa-plugins-rsound-git package on the server http://aur.archlinux.org/packages.php?ID=35527.
Set up an alsa device for rsound in .asoundrc, e.g.:
pcm.rsound {
type "rsound"
host "ip of desktop"
}
Configure MPD to use this device, and probably use software mixing as well.
audio_output {
type "alsa"
name "MPD"
device "rsound"
}
mixer_type "software"
Now, you could start the rsound server on your desktop with
rsd -D
and play.
Offline
@Themaister : I just want to thank you for your work !!
I used nas to export the sound of mplayer to my server but it didn't work very well (video was jerky and mplayer complained about nas server too slow).
With rsound there is no sound nor video problem, both are perfect :-)
Some idea and comment :
* It should be good if the daemon can log its output to syslog.
* when I tried to apply your mplayer patch it fail at :
-COMMON_LIBS += $(COMMON_LIBS-yes)
+COMMON_LIBS += $(COMMON_LIBS-yes)
which obviously doesn't change nothing (just a space at the end)...
So I think you should remove it from the patch.
* I have a little problem with mplayer, I have to pause the video before seeking ...
Am I the only one ?
Offline
akira86. Thanks
Yes, I know the problem. rsd doesn't do mixing (simplicity ... ), so it opens a new connection. When you seek in mplayer it resets connection (very simple to implement, one goal of rsound). There might be a delay, so you get two connections at a time, for a short period, where initing ALSA or whatever will fail if you can't do mixing in ALSA.
If you use hw:0 or something directly with rsound, you can get issues. Start rsd with --single, which should make sure you only get 1 connection at a time.
I'll have a look at syslog.
EDIT: Mplayer patch in AUR is probably horribly outdated. I should update that :3
EDIT2: Added syslog support. --syslog should do the trick. It's detailed in man rsd.
EDIT3: Updated MPlayer patch and mplayer-rsound-svn package. (That was old! hah)
Last edited by Themaister (2010-11-16 19:56:33)
Offline
Had this running on my server for a few months, was a good experience.
Offline
Looks interesting. I've added a dummy output driver to my audio player library so I can play with it later. ( http://code.google.com/p/gogglesmm/wiki … yerLibrary )
Last edited by GogglesGuy (2010-11-16 19:51:56)
Offline
Goggles: That looks cool
RSound 1.0rc1 is released!
https://aur.archlinux.org/packages.php?ID=33101
Offline
I'd like to stream audio from a microphone and listen to it on a windows machine using program like vlc, is this the software? Thanks.
Offline
Not really, RSound does not have recording facilities. One faint possibility would be recording, dumping it straight to rsdplay, and have it play back on a windows machine running the server, or something, but it's definitely not designed for it.
Offline
How might I use rsound in a pulseaudio output sink? Trying to switch the audio output of chromium from local soundcard output to rsound output while chromium is still running, which doesn't seem to be possible with ALSA. Thanks for your work besides; I'm using rsound for linux-to-linux streaming in addition to the OSX flowersound app you wrote which works perfectly by the way. All seamless and minimal and transparent, wonderful.
Only issue I've been having is occasional skipping when streaming audio, not sure where the latency is exactly. What settings should I play with on the rsd receiving server to hopefully ameliorate this, e.g. buffer et cetera? There is something about this in the documentation but I don't quite understand it.
Also, the audio quality when streaming with rsound is not quite as good (though not by much) as a physical connection. Not bothered by this - just streaming the audio track of videos anyway - just wondering what the processes involved are? Is the audio resampled or compressed along the way? Again I've read through the rsound source+documentation but it is a bit beyond me.
Cheers.
Last edited by OhneHerren (2013-08-02 03:29:42)
Offline