FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Sound daemons and stream mixing





rdrs
Hello there,

with the emergence of VoIP telephones, an issue that I always found negligible has been growing to a different proportion: having multiple sound streams simultaneously.

To put this into perspective, an example: in my linux box, I usually have a music player rolling. If I want to call someone, I need to stop the music, then make the call. Reasonable, I'd say. But if someone wants to call me, since the music player is using the sound device, the phone won't ring!

It happens that consumer sound cards are 1-input devices. To have simultaneous sources, these have to be software mixed before being sent to the device. Now, decent ALSA-enable software manage this properly: I can listen to three different mp3-files on Xine, XMMS and Mplayer - simultaneously. On the other hand, VLC, Skype, as well as KDE or Gnome apps will try to grab /dev/dsp, and complain it is in use (or conversely, prevent other apps from grabbing it).

Do a search on 'multiple sound source' or 'stream mixing', and you'll get a profusion of results; I couldn't extract the answer I wanted anyway. Usually, one of the next solutions will be proposed:
- use a sound daemon: artsd, esd or jackd
- add a mixer device to alsa config

All very nice, right? Well, each will work if and only if the application has an output module for the respective daemon or alsa.

Did any of you find a sensible solution for this issue? I mean, I could get my hands dirty writing a plugin for, say, ekida, so that I could have on and still hear the phone ringing throughout the BBC radio feed. But if Mplayer, XMMS and Xine are ALSA friendly, why aren't the others?

Cheers,

rdrs
martindecorte
When I was using Linux a lot, I got the same problem (essentially in order to get teamspeak run together with enemy territory). First of all, I never could solve the problem.

I tried many sound daemons, but none worked really well. I guess the only reliable solution for now is to have a hardware mixer in your sound card.

Someone once asked the following question: "Why does it work perfectly & transparently with Windows?" The answer is that Windows imposes his built-in sound daemon, and all applications have no choice but to use it. Since Linux always offer many different opportunities, the result is that you are lucky if your favourite application supports your sound daemon. If it doesn't, wait until the next software update.
rdrs
Indeed, Windows and Mac had some advantage in this field.

I've been doing some more research, and finally came into some sensible answers. Here's the summary:

- newer versions of ALSA are not only able to do software mixing, but they're shipping with it enabled by default. That explains why mplayer, xmms and xine (all ALSA-aware apps) manage to share the soundcard without problems.

- some apps still won't work - they're not using proper ALSA guidelines. You can coax them into using ALSA by calling them with a soundwrapper. My experience showed that some don't cope very well

- if you have latency problems, then you should invest in Jackd. Its architecture takes it quite farther than Artsd or Esd. I've no idea about Gstreamer.

- it seems that if every app is ALSA-enabled, then Artsd and Esd are redundant - and you don't need to worry about daemons lurking in the background.

I also found something called Phonon - it appears to be an attempt at regulation KDE apps' access to the soundcard. It's only a front-end, though, and still needs ALSA or a sound daemon.

Now, I'm going to do some more tests, to see how ALSA holds up..
Related topics
Great php editor
Bulent's Screen Recorder v.2.4b
Adding Music or Sound to Your WebsitE
Making a mouseover "sound" or "pic"?????
If Hardly Davidson made Computers instead of Motorcycles...
Which phone would be better?
Support rbs files?
No sound on a Dell Dimension 4500S
FLAC support in Sony Sound Forge
Sound problems!
Switchfoot's New Album: Nothing Is Sound
Strange cracking sound in converted mp3
AVI codec missing?!?
My live mixing stream
Reply to topic    Frihost Forum Index -> Computers -> Operating Systems

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.