LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-26-2009, 04:01 PM   #1
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Rep: Reputation: 56
the big dream of an universal WORKING linux sound infrastructure


Hi

I have now spent YEARS trying to achieve this and it is getting closer and closer. But so far, Linux sound is a gigantic mess of seemingly tens of different sound systems.
to just name a few:
first there was OSS, which died (deservingly) because it allowed only one program use of the soundcard.

/dev/dsp device or resource busy
was an ugly reminder that made us move to ALSA.

ALSA, though, has not solved the problem. It promised that several programs could use the soundcard, but failed. You still get the "device already in use" error.

Now, we got pulseaudio, which builds on top of ALSA and does what ALSA fails at.

Although there were initial problems with pulseaudio, I really like it now, since it is the reason that audio in Linux will just work in a few years, at least for the casual user. Being able to use skype, use firefox to play youtube videos and edit audio with audacity, currently an utopia, but possible with pulse in the future.

Now, the only audio server that does it all, that stands up to all demands is JACK.

Jack has some drawbacks, it pretty much only runs on a real time kernel (and we Debian users have fun (or pain in my case) compiling your own).
But Jack is great, since it has what ALSA and pulseaudio cannot:

-It is a central point where all audio converges.
-There are GUIs that you can form connections from application to application.
-Logging is transparent, you can see what the thing is doing. (i.e. when a application is connecting to it)
-performance troubleshooting is also easy, thanks to the nice logging.

The problem is that not all applications are supporting it so far. (skype probably never will)
But there are a lot already, among there: amarok, audacity, xmms, mplayer and of course all serious audio applications that depend on jack.

It is a real delight to plug together applications to use JACK at his fulles power and then record the resulting mix.
Imagine you need an echo, instead of piping the output of your sound directly to the sound card, insert a jackrack effect for echo inbetween and bingo.

Something I find really cool is the pulseaudio plug in for jack. It allows all applications that support pulse to use jack.
Now if only the ALSA plug in would work and not still be buggy. It just does not work to reroute a ALSA application into jack, and of course as ALSA is, no logging, no proper error messages, nothing to start solving the problem. After creating the pcm.jack sink, aplayer just complains
aplay: set_params:918: Sample format non available
which is even a wrong error, since it has nothing to do with the sample format.

If this would work, you could use JACK for EVERYTHING.
Even sound card hogging applications (there are still many of them) could then be used with jack.

I count myself to have a pretty big overview over Linux Audio and have been fiddling around with it for ages.

Jack would be the solution for all problems. And it is troubleshootable.
And most important of all, it boasts a nice GUI for the next generation of Linux users. Configuring ALSA with .asoundrc and the command line is just ugly.

Jack even has something that Windows does not have in the system, a patch bay where you can make connections.
In Windows, this is handled by the audio applications and Windows itself does not allow any audio debugging. If you run into problems there, you go through hell (reinstalling the sound card driver and other vodoo troublesolving)

In the future, we should have a maximum of ALSA (for the low level sound card support), Pulse Audio for normal desktops and Jack for everything else. ALSA and pulse still don't have any usable guis by normal mortals. Especially ALSA is very yucky. ;-)


Markus
 
Old 09-27-2009, 01:42 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
I'd rather fix ALSA or OSS4 instead of adding more layers of crap on top of a buggy foundation like ALSA is right now. I'd really prefer OSS4, a pity that not all apps support it, and that it doesn't have any working MIDI support. ALSA for me is a big ugly beast that is as Linux unfriendly as it can be, it's just my view of course.

ALSA is supposed to support software mixing, however it's true that it fails sometimes. As an example, my ca0106 based card works ok in stereo, but as soon as I use mplayer -channels 6 to play 5.1 ac3 stuff then I can't play anything else.

Jack is ok for some purposes, but the average desktop user doesn't need that.
 
Old 09-28-2009, 07:30 AM   #3
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by i92guboj View Post
I'd rather fix ALSA or OSS4 instead of adding more layers of crap on top of a buggy foundation like ALSA is right now. I'd really prefer OSS4, a pity that not all apps support it, and that it doesn't have any working MIDI support. ALSA for me is a big ugly beast that is as Linux unfriendly as it can be, it's just my view of course.

ALSA is supposed to support software mixing, however it's true that it fails sometimes. As an example, my ca0106 based card works ok in stereo, but as soon as I use mplayer -channels 6 to play 5.1 ac3 stuff then I can't play anything else.

Jack is ok for some purposes, but the average desktop user doesn't need that.
Well, OSS4 is probably dead. I have not seen one application that is using it. I have seen a strong push for pulseaudio and that looks like it is the future for the desktop, everything else is going to jack.
Unfortunately, OSS4 is to radical a change, too much is on ALSA, pulse and jack already. And the point that OSS4 does not have any midi, well... death-knell.
The reality is that most (if not all) applications lock ALSA and do not let anything else use it.

So far, the easiest to understand and use is jack, thanks to that wonderful GUI called jack control (or qjackctl).

Markus
 
Old 09-28-2009, 09:34 AM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by browny_amiga View Post
Well, OSS4 is probably dead.
Nope, they do releases and make announces, that's hardly a dead project. Maybe slow paced, but not dead.

Quote:
I have not seen one application that is using it.
What about 99% of the OSS3 applications? Almost all the apps supporting the old OSS stuff will work with OSS4, and that's most of the linux applications that use sound for one or another thing. Only very specialized programs that chose not to support OSS will not work with OSS4, well, those and the gkrellm volume plugin

Quote:
I have seen a strong push for pulseaudio and that looks like it is the future for the desktop, everything else is going to jack.
Yeah, global warming is also the future, that doesn't mean it's good. I don't have anything against what pulse represent, but I think that the current status of the sound systems is just pitiful. ALSA breaks every now and then depending on what card to you have, dmix works sometimes yes, sometimes not, then you have to resort to yet-another-esound clone just to do mixing, which is stupid. Sirs, ladies, let's do soft mixing in one place, either alsa or pulse, but let's not duplicate functionality. Let's skin alsa a bit taking out of it all this crap and then pulse will make sense and we will have less bugs. Or let's fix alsa and let's throw pulse away, either way would be better than what we have right now.
 
Old 09-28-2009, 10:07 AM   #5
manu-tm
Member
 
Registered: May 2008
Location: France
Distribution: Ubuntu, Debian
Posts: 343

Rep: Reputation: 43
I more than agree that linux audio is a mess (honestly it's s**t.) On ubuntu, every upgrade breaks the almost working setup I've slowly and painly achieved before. This just pisses me off so much. But I still don't know what I should stick to (alsa, pulseaudio, jack, oss4?)
Am I the only one so confused about the damn sound thing? Anyways, it's just good to start discussing this here. I think me and a lot of people feel the same about the situation and would more than appreciate to be able to find their way through...
 
Old 09-28-2009, 10:31 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
There's really no easy way. It depends mostly in your hardware. If you don't need midi and your hardware is supported by oss4, then you might want to try it. It really works out of the box, provided that there's a driver for your card which unfortunately is not always true.

Otherwise your only alternative is alsa.

Alsa and oss are the most low level layers, they provide the driver, so the rest of the sound daemons (pulse, jact, esound, arts, phonon and whatever else) just build on top of one of either alsa or oss. Pulse is well known for being buggy, but the problems for all of them is mostly the same: there's no one that will work with all the programs, so it also depends on the set of software that you use. In addition, and to make this even funnier, then are lots of plug layers to connect / emulate oss to alsa, alsa to oss, jack to pulse, to alsa, to jack and so on, forming a true spider web which is nonsensical, prone to bugs and complicated to handle (which is indeed the opposite of the original purpose of all this crap).

Sometimes having lots of crappy options is not a good thing.
 
Old 09-28-2009, 11:22 AM   #7
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by i92guboj View Post
Nope, they do releases and make announces, that's hardly a dead project. Maybe slow paced, but not dead.



What about 99% of the OSS3 applications? Almost all the apps supporting the old OSS stuff will work with OSS4, and that's most of the linux applications that use sound for one or another thing. Only very specialized programs that chose not to support OSS will not work with OSS4, well, those and the gkrellm volume plugin



Yeah, global warming is also the future, that doesn't mean it's good. I don't have anything against what pulse represent, but I think that the current status of the sound systems is just pitiful. ALSA breaks every now and then depending on what card to you have, dmix works sometimes yes, sometimes not, then you have to resort to yet-another-esound clone just to do mixing, which is stupid. Sirs, ladies, let's do soft mixing in one place, either alsa or pulse, but let's not duplicate functionality. Let's skin alsa a bit taking out of it all this crap and then pulse will make sense and we will have less bugs. Or let's fix alsa and let's throw pulse away, either way would be better than what we have right now.
Well, I don't especially like pulse, but it has done one thing: united the sound world in Linux, meaning all new distros have pulseaudio as standard and we will finally have a sound system, that all can agree on. Jack is that already in the professional audio world in Linux, ALSA and Pulse are the future, that much is sure. (in a very determined way, because so far there was NO agreement on anything except ALSA and Jack: ESD, artsd, portaudio and the miriad of others that each one has his own)

Now the problem with OSS is that we all learned that OSS is dead and has been replaced by ALSA. I have read a little essay of how the new OSS is superior to ALSA, but 99% of all Linux supporters have not, they can't understand the perverse complexity of the seemingly millions of audio systems that exist. They want things easier and clearer.
OSS4 might be superior, yes. But are the distros standing behind it? Which disto is using it as a standard sound system?
OSS4 has one problem: The timing is really bad right now, Linux is going from many to few audio systems, because me and a lot of people want it and are tired of the "too many". People want to write a program that supports jack or pulse and know that it will work in any case.

Another problem is that OSS4 and ALSA are competitors. ALSA is surely inferior in it's design, but established and here to stay. We should fix it, instead of AGAIN replaying it with something else on which we still have to agree on. People currently are agreed on ALSA, at least when you look at distros, you will see what I mean.
As funny as it sounds, there is such a thing as politics in Open Source: People agree on something that is used most or people "in power" push a system or another and make it a defacto standard. It might not be pretty, but it works.

Correct me if I am wrong, but isn't OSS support removed from most programs? Or did it only seem to me like this?

Cheers

Markus
 
Old 09-28-2009, 11:37 AM   #8
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by manu-tm View Post
I more than agree that linux audio is a mess (honestly it's s**t.) On ubuntu, every upgrade breaks the almost working setup I've slowly and painly achieved before. This just pisses me off so much. But I still don't know what I should stick to (alsa, pulseaudio, jack, oss4?)
Am I the only one so confused about the damn sound thing? Anyways, it's just good to start discussing this here. I think me and a lot of people feel the same about the situation and would more than appreciate to be able to find their way through...
Nope, you are not the only one. We are all confused, I guess I am an expert in that I know what fits how together with whatother.

the way it works is following:

SOUNDCARD LAYER:
ALSA OSS

SOUNDSERVER LAYER:
ESD PULSEAUDIO JACK

APPLICATION LAYER:
rosegarden firefox audacity amarok


The soundcard layer deals directly with the soundcard. Applications that directly connect to OSS(3) or ALSA lock the soundcard and block all others.

The sound server level is for sharing, it connects to the layer below and allows sharing for applications.

ESD is old, Pulse audio is new and Jack is the most powerful of them all. Jack allows pretty cool stuff, but is also more complex. Pulse is simple and easy to use, but cannot do much.

Pulseaudio basically connects applications together and sends the output to the soundcard.
Jack on the other hand does that graphically, you can use a patchbay to make connections from one application to another and then send it to another (much like the PIPE in bash). The possibilities are endless.
But Jack is wierd in things like that there is no standard service that gets started. At the beginning I thought that is sound server like it was supposed to be started at system start, but when I went to check out an init.d entry, there was none. Now they have made one, but it is still disabled by design.
AND: jack tends to crash from time to time and then all audio applications break.
I am currently investigating how to make sure JACKD is autorestarted. I mean, if it is running, you want it to restart ASAP, right? Otherwise you would not be running it in the first place.


I guess it is all up to us to point this out and help and work together in constructive effort to shape the Linux audio landscape. We can, we are the community! We got the power, it is not like on other OSes where you have to prod a dumb megalomaniac company which does not listen to users at the least and be powerless.
We are Linux!

so to make it short, currently, we can do everything we need to do with ALSA, Pulseaudio and JACK.
 
Old 09-28-2009, 12:24 PM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by browny_amiga View Post
Now the problem with OSS is that we all learned that OSS is dead and has been replaced by ALSA. I have read a little essay of how the new OSS is superior to ALSA, but 99% of all Linux supporters have not, they can't understand the perverse complexity of the seemingly millions of audio systems that exist. They want things easier and clearer.
OSS4 might be superior, yes.
Well, it depend on what regard. I think it's infrastructure is better, but that's just me. I am pretty sure you can find people that think the opposite, it's a very subjective matter, I'll admit.

Quote:
OSS4 has one problem: The timing is really bad right now, Linux is going from many to few audio systems, because me and a lot of people want it and are tired of the "too many". People want to write a program that supports jack or pulse and know that it will work in any case.
I just wish an unified foundation, whatever that is. I am not an oss zealot or something. I just want something that works and that is not as damn buggy as alsa (or pulseaudio for that matter). I just think it would be easier to do because oss -unlike alsa- is a thin layer. Alsa can do almost everything that pulse can, it's just that it's as damn difficult to do it that it's not even worth the trouble. Oss in the contrary is a thin layer, and using pulse or jack in conjunction with it would make much more sense, in an architectural sense. That's my view anyway.

Quote:
Correct me if I am wrong, but isn't OSS support removed from most programs? Or did it only seem to me like this?
That's not my experience. Most applications that ever supported oss, will still support oss upstream. A very different thing is what do distro packagers compile

There are a few applications, like rosegarden if my memory serves, that don't support oss, but they are very concrete applications. Of course if you need one of these there's little you can do. Oss anyway can do alsa emulation I think, just like alsa can emulate oss, but I never tried that so I am not sure how well it works, if at all.



Quote:
Originally Posted by browny_amiga View Post
The soundcard layer deals directly with the soundcard. Applications that directly connect to OSS(3) or ALSA lock the soundcard and block all others.
ALSA can do soft mixing, just like pulse does. That's what the dmix plugin is there for. However it has probed to be at best a crappy hack, which works ok sometimes, and doesn't work at all some others.

Quote:
ESD is old, Pulse audio is new and Jack is the most powerful of them all. Jack allows pretty cool stuff, but is also more complex. Pulse is simple and easy to use, but cannot do much.
I guess that it's a matter of how the backends are handled, how the interfaces are designed and such. It wouldn't be difficult to build a "lite" jack frontend emulating the ones for pulseaudio, and there's nothing stopping the first jack-based application from forking jackd if it's not already enabled... This "flaw" that you describe is merely circumstantial and only describes the average profile of the typical user of each of the two platforms. The average jack user wants control, but that doesn't mean that jack can't be used for a desktop if someone takes the time to put together all the pieces.

In any case, I'd just like a working solution, regardless of its name.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dream Linux OS Kinshin Linux - General 22 12-29-2003 08:18 AM
My Dream Linux OS mymojo Linux - Newbie 4 11-02-2003 06:27 AM
Designing a Linux Network Infrastructure!? therizwaan Linux - Networking 5 09-12-2002 05:51 PM
Linux Infrastructure ahmiq Linux - General 5 06-24-2002 10:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:33 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