PulseAudio Creator Responds To Critics
Dan Jones writes "As recently discussed here, Linux sound development has come under fire for being overly complex and, more specifically, PulseAudio has been criticized for not being a 'good idea.' In a lengthy interview, PulseAudio creator Lennart Poettering has responded to the many critics of the new-generation sound server and says such complaints and criticisms about PulseAudio in some Internet forums are not really shared by the vast majority of technical people. While Poettering admits PulseAudio itself is not bug-free, he believes the majority of issues are being triggered by misbehaving drivers or applications."
Firrrrrsssst P Po Po sssst
When an application can make the soundsystem stop working for all other applications, than there is a bug in the soundsystem, not just the application that caused the problem.
------ Take away the right to say fuck and you take away the right to say fuck the government.
The idea is great. PulseAudio is an excellent solution for networked audio and thin unix clients. Now the problem is the people and the distros installing it by default on a desktop where it is utterly useless. No matter how close to bug-free it is, it is an unneeded source of bugs in that case.
This is not entirely true.
Now, I don't know what the exact bugs are that are causing problems. But the API should be stable no matter what happens to the outside. There should be no way to destabilize or crash the audio layer from a usermode application. So, if by "expect more correct behavior from the apps" he means "garbage in, garbage out", then that's fine. But if by "expect more correct behavior from the apps" he means "no error checking and if any app screws up then everything melts", then that's not fine.
I don't know which he means, but I've seen instances of both.
Breaking Into the Industry - A development log about starting a game studio.
The problem is that the implementation sucks, and that bugs are being ignored.
I'll perhaps reconsider my stance when pulseaudio starts using less CPU than the JVM when playing Puzzle Pirates. Finally something more bloated than Java, I guess.
Finally! A year of moderation! Ready for 2019?
While Poettering admits PulseAudio itself is not bug-free, he believes the majority of issues are being triggered by misbehaving drivers or applications.
Well, the way I see it, I can either use alsa and have (as far as I can tell) no bugs, or I can use PulseAudio and have more features and more bugs.
That might not be PulseAudio's fault, but it still means that if I use PulseAudio I will have a buggy sound system. Why do I want that? Why do I want it even if it's only buggy until all the applications get fixed?
Also, the promise of networked sound is kinda... meh... maybe I'd be happy if all my laptop sound got moved to my desktop box (which is connected to my stereo) automatically whenever my laptop is connected to my home access point (and, conversely, my desktop's sound automatically gets routed to my laptop whenever my laptop does an ssh home and is not around my home access point). But as far as I can tell, this is a bitch to set up, and I'm really not inclined to go clicking around some unintuitive menu system to set my sound up right every time I leave home or go back.
So what's the benefit of PulseAudio again?
I've read the background articles (but not the featured rebuttal about PulseAudio yet), and I was wondering why OSS was "deprecated" in favor of ALSA and whether (and if not why not) there's a possibility of OSSv4 being put back into the kernel. Anyone know?
If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
Now the problem is the people and the distros installing it by default on a desktop where it is utterly useless.
In fact it's worse than useless (on Ubuntu): whenever I move away from my wireless access point at home (i.e. I'm on my bike on my way to the university), my sound stutters; this is probably PulseAudio spending too much time on making a new map of the network and too little time on actually handling sound waves (but I'm speculating).
Did no one test this? Am I the only person using a "ThinkPod" as a portable music player? Oh, I guess it's not one of those 95% most common use cases, so it's no biggie if it isn't handled properly.
Except that there are twenty disjoint chunks of 5% least common use cases not being fixed because they don't affect that many people, except everyone is affected by one... grr... </hyperbole> <apology/>
here: http://colin.guthr.ie/2009/08/sound-on-linux-anti-fud-calm-certainty-and-confidence/
The largest problem with Linux audio is not really any particular driver model / sound server. OSS, ALSA, PulseAudio and Jack all work when set up properly, with supporting hardware, and supporting software. But it's never a given that a particular app will support whatever you're using, or give you the choice to select your output device if you have multiple sound cards.
I've been running Ubuntu for a long time now, and recently installed Windows as a dual boot for making music. Why? I can spend X hours on setting stuff up, or I can spend X hours on making music. I can simply count on any app that matters supporting ASIO or DirectSound on Windows.
While I actively try to convert people to Ubuntu for regular desktop apps I still tell people who plan to do audio/video stuff to go for Windows/OS X. While it's totally doable to set up a working environment in Linux if you know what you want and which apps you want, I like to play with stuff for fun. I'd rather invest my time in having fun creating content than trying to get stuff to work.
(And yes, I've tried Ubuntu Studio. Nice, but not there yet for me.)
.: Max Romantschuk
Lady Gaga apparently uses Linux.
Breakfast served all day!
I've read in several places that the main problem with PulseAudio is not its design and implementation, but its instantiation. Many distributions apparently do not properly set up PulseAudio, causing it to behave unexpectedly. I found this to be the case with Ubuntu 9.04. PulseAudio worked like crap until I followed the following directions to get it set up. It's been working like a dream ever since:
http://ubuntuforums.org/showthread.php?t=789578
LS
There is a fine line between being a cultivated citizen and being someone else's crop. - A. J. Patrick Liszkie
If you disagree with this guy, you're OBVIOSULY not "technical" and CERTAINLY not part of this mythical "vast majority".
Look, if you have a nice idea and it involves stacks and stacks of layers and drivers and the whole introduces a nice fat latency by design, and that nice idea pertains to something potentially very latency sensitive such as the audio to VoIP, then perhaps the nice idea wasn't so nice after all. And then there's the rest of the complaints.
I think "vast majority of technical people" is poetteringspeak for "yes men". Either that or he can show us wrong by patching all those drivers that he's pointing to. No, merely pointing elsewhere is not enough. Show us the code.
I disagree with the original article: ALSA is the way to go, I have drivers for all cards I've thrown at it, all applications imaginable that support ALSA work just fine for me, and no, as a OSS-to-ALSA changeover survivor, I don't want to change everything to another frigging API yet again (much less back to OSS), thank you very much. And while PulseAudio is less than perfect right now, I recognise it has uses.
But that's just that - it has uses. In its current state, I'm not using it for plain-ordinary music playing on my Debian system. I don't think it's ready enough as a common day-to-day audio routing thing. Still too many problems.
An example case: I was really disappointed when I upgraded Ubuntu on an older computer (600Mhz Pentium III with 256M memory and ESS Solo 1 onboard audio, plenty good enough for OpenOffice.org and web browsing, even ran Compiz at very good performance on GeForce 2 MX =) and sound playback started to just plain suck, when it previously worked just fine with straight-up app-to-ALSA playback. The machine just wasn't fast enough to route stuff through an application, plain and simple. And now Ubuntu foisted PulseAudio in. Uninstall PulseAudio = uninstall entire frigging GNOME desktop. I kept trying to tell it "no, I just want ALSA playback" in sound settings. No dice, pulseaudio kept respawning and hogging audio device all to itself. I kept disabling shit from all places imaginable. No dice, pulseaudio kept respawning. Now, I'm going insane (an unrelated story). I'll be armed with GCC and some dummy binaries. Mheheh. Muahaha. MUAHAHAHAHA. ...any better ideas?
Shockingly, I know, but I actually went and read your bug reports. You were specifically asked to file separate bug reports for separate issues. The original report was closed on the assumption that you would do so. Whether that is a good approach or not? One can debate that. But you were not ignored...
Enjoy life! This is not a dress rehearsal.
Even if he may be 100% right about that: way not to get the point!
I don't care whether problems are caused by the kernel, a driver, an application, the phase of the moon, or whatever. The thing is, if some "trivial" piece of hardware which has been part of mostly every computer since about 1990, still *does not fucking work* correctly today, I don't give a rat's ass whose fault that is. Especially if it appears the same "problems" have been solved satisfactorily at least 10 years ago on every other OS in mainstream use.
In the meantime, Linux has changed both the audio driver model (ALSA, OSS, who knows what else), and in addition to that, the "application interfaces" (arts, esd, PulseAudio, etc.) so frequently, that it is hardly any wonder that application developers are taking the piss and not updating their software to match the bugs/workarounds to whatever the current "flavor of the week" API for audio interfacing is.
Perhaps PulseAudio is just getting most of the "blame" because it is the most recently changed part of the audio subsystem, so if things used to work before, and now they don't, of course you're going to blame PulseAudio. Even if it is not by itself the "real" culprit.
Every expression is true, for a given value of 'true'
Do more than .0001% of linux users need autoforwarding, or network transparency at all? Or should we focus on what the other 99.9999% want, which is high performance, low latency, non-crashing sound like the other two major OSs have.
I never thought I'd see a Linux advocate use the Vista Defense! It's the drivers, it's the software, it's something, but it's not my code!
At least with Vista the problems with video drivers, and various other hardware devices was sorted out within a couple of months. In Linux the way audio is handled is an absolute mess.
I knew as soon as I read the headline here that this article would be jumped on by numerous "alsa is fine on it's own", "Why not OSS" and "PulseAudio is buggy blah blah" type posts but I didn't think that even the general slashdot hordes were that ignorant about what the hell PA is all about. I was sorely mistaken.
PulseAudio is very little to do about "networked audio" which everyone and their dog seems to use as an example to reason "I do not need networked audio, therefore I do not need pulseaudio". It's just ignorance in the extreme.
PulseAudio as an architecture is fast becoming the defacto standard on Linux, companies such as Intel, Nokia and Palm are putting significant resources into PA just now.
OSSv4 or older flavours simply does not have the API to deal with a modern linux desktop, plain and simple. We can maybe get some of the more userspace stuff such as bluetooth or airtunes support (the support for which I added to PA myself) using some kind of CUSE support but that's only just landed in the kernel just now, and it really wouldn't be a proper solution (and guess what? it would need a daemon running anyway!!)
As a PA developer and supporter, I've written up various articles explaining what PA is all about before and posted similar comments to mailing lists etc.
You can read some of them here:
http://colin.guthr.ie/2009/08/sound-on-linux-anti-fud-calm-certainty-and-confidence/
and
http://thread.gmane.org/gmane.comp.kde.amarok.devel/15356
I'll outline some of these things here to save you killing my poor server!
More and more audio device *are* network based. Apple Airport Express devices are pretty popular these days. I have two bluetooth headsets and my hifi system also support bluetooth connections and my Playstation 3 supports uPNP. So lots of things relating to network Audio are popping up (which is nothing to do with pulse->pulse network connections which is arguably a toy, even if I do personally use it a lot!). I don't think these should be ignored. PulseAudio supports all of these devices right now (although I've not had time to try the uPNP stuff on my PS3 specifically so don't quote me on that!)
In addition, rights access and management is a big issue. Today any modern linux desktop uses console kit to keep track of user sessions. When you switch from one user to another, console-kit ensures that the currently "active" user session is set to inactive, and it triggers udev callouts to remove the currently active users ACL on the /dev/snd/* nodes. (I seriously hope no one adds their user to the "audio" group these days!). This allows a new user to log in and get access to the sound hardware because they are now the "active" user. Switching between the two sessions triggers these ACL rewrites. Something has to manage this in applications so that they don't just bail out with EPERM errors. The sound has to go to /dev/null automatically without the application being aware of what is going on. Perhaps it can cork/uncork applications that listen for such signals so that music is paused etc. This is something that cannot be done without some kind of userspace daemon handling things.
Then on to power consumption. What most people quite often fail to realise is that Latency is Good. If you can pump 20 seconds worth of audio into a buffer and then switch off until you're woken up 19.5 seconds later then this is great for power consumption. You need to disable hardware interrupts and use kernel level timing constructs to deal with this, and automatically reduce your wakeup time on the event of an underrun to reduce the likelihood of a future underrun occurring. You also have to have accurate timing information reported such that a/v applications can handle things like lipsyncing etc. (and remember that hoping for a low latency audio output is
The FPU works perfectly fine in a Linux kernel. The RAID code can even use MMX, SSE, AltiVec, and so on. Observe:
kernel_fpu_begin();
do_stuff();
kernel_fpu_end();
The same goes for pretty much anything else, Bluetooth included if you actually care.
Even better, in the kernel I can get the ultimate in real-time performance. I can get working fine-grained security like SE Linux instead of crap like that offered by the X server.
Win, win, win. Kernel code rules.
http://ubuntuforums.org/showthread.php?t=789578
TL;DR. Here's a slightly shorter guide to a great pulseaudio setup on Ubuntu:
apt-get remove --purge pulseaudio
In my experience it works flawlessly ;-)
A lot of the problems with Pulseaudio are caused by the misconfiguration of Ubuntu's default kernel. It seems that they will be making the upcoming Karmic Koala even worse, according to a small rant on Lennart's blog today.
My other account has a 3-digit UID.
The sound on my =bare metal= install of Fedora 10 didn't work.
After much forum-searching, config tweaking, and pounding-of-keyboard, I eliminated PulseAudio.
The sound worked.
Tell me again about PA's awesomeness.
That was on 486 hardware and even worse!
The problems started with ESD or esound, the Enlightenment Sound Daemon. Prior to that, sound daemons were unusual. Nobody actually ran one. Enlightenment (the insane game-inspired window manager) got one, GNOME briefly used Enlightenment, and we've been stuck with sound daemons ever since.
The OSS to ALSA transition was the other botch. It used to be that an app just did open() on /dev/audio or /dev/dsp and made sound. Any competant UNIX programmer could handle that. Now we have a kernel API that is essentially unusable, so you have to use ALSA libraries to do anything. Actually, those are **barely** usable.
Really, it wasn't always like this. My 486 DX4-75 with 8 MB RAM (slackware, fvwm-1.x) could handle audio. Back then, programmers didn't fuck around adding bugs and bloat. They wrote stuff that worked, nice and solid, on the hardware that we had.
Sometimes mplayer will have sound, and totem will not, and other times, the opposite is true. Since the switch to pulseaudio, I have never seen a time when they both worked. Just a half hour ago there was no sound in miro. The volume slider in miro was turned up, the system volume was turned up, and my speaker volume was turned up. When I right clicked on my sound icon, went to preferences, and flipped to the "applications" tab, I found yet another volume slider labeled "miro" that was turned all the way down.
A few months ago I bought new speakers and a new sound card because my sound stopped working. The new hardware still didn't work, and a few days later, I found some random profile or device or something that was muted, but to even see that menu I had to change the default device in some gui I had never seed before, and then change it back. Starting about a month ago, whenever I play a youtube video, sound will not work for anything but flash (even after I close firefox) until I killall npviewer.bin
For some reason, when "surround" is muted on my laptop, my headphones don't work, but everything else does like normal, and if PCM gets muted, I will only get sound back if I turn the volume all the way down for a second, then turn it back up. Also, my USB headphones and USB speakers have never worked in linux.
The new surprises with every upgrade is also pretty fun. It used to be that I could just do a killall "pulseaudio" then /etc/init.d/alsasound restart, and everything would be back to the old way of working, but recently it just breaks everything even worse, requiring a reboot to fix. I'm hoping that a clean wipe of everything, and installation of ubuntu 9.10 may magically fix some of these random idiosyncrasies, but I'm not holding my breath for it.
I've looked at GNOME, I've looked at ALSA, (indeed, Ubuntu in particular in general terms) I've looked at the bloated instability of Compiz, I've looked at FreeBSD by comparison, (which I use on a daily basis) and at some of OpenBSD's source...and I've come to an important realisation.
When it comes to both design philosophy and code quality, Linux developers suck; and I'm talking black hole level, here. The BSDs leave Linux so far behind that it isn't funny.
What is even worse than the poor code quality, is the level of denial. The GNOME developers in particular have been told on numerous occasions what an abomination their baby is, yet they continue to insist on defending it, rather than actually listening to the feedback they are given, and trying to improve.
The single main problem is what I called the Starbucks generation; self-righteous, latte-sipping yuppie CS graduates, who as said in another post, worship C++ and various hell-spawned forms of RPC, and use such to code bloated monoliths of a magnitude that would give Microsoft nightmares.
They think they know better than the 30 years of UNIX experience that has come before them, including the very authors of the initial operating system itself.
Although I haven't used Pulse, I have used ALSA, and I've used enough other Linux software to know that the Pulse author most likely shouldn't be defending himself; but should be humbly acknowledging that his software is terrible, and appealing to the community for help and insight into how he can do better.
He can start by reading this, and gaining a real appreciation of the system he is writing for.
There are a lot of programmers in the Linux community who badly need some humility. They need to study the designers and authors of early UNIX; they need to learn how those people thought, and they need to emulate said designers' thinking and behaviour.
Above all, more than anything else, there needs to be a return to implementation, rather than interface, simplicity. As priorities, faddishness, popularity, and most of all, the end user, need to die.
One problem that many forget looking back on the "good old days" of sound is that you couldn't get sound from more than one thing. On single task OSes like DOS this wasn't a problem, you only ran one app. However for multi-tasking OSes it meant that whatever opened the soundcard first had control until it gave it up. This was problematic for many reasons. Meant that you couldn't even do something simple like play an alert sound from the OS if someone was playing MP3s (not such a problem in the 486 days since those were hard pressed to decode MP3s in realtime).
Well, that's where sound daemons come in. The OS mixes sounds from multiple apps and sends it to the soundcard. Thus you can have multiple programs using sound, just like video. What's more, it'll let you do things like control the volume if an app neglects a volume control. Firefox doesn't seem to have a volume control, but the Windows 7 mixer has no problem adjusting its volume, independent of the system.
There is no reason why this should be a problem. Windows and OS-X do it just fine. There is a sound layer the OS has that you write drivers for an all apps can interface with. You can extend/bypass that with your own APIs if needed (like OpenAL or ASIO). It works really well. For that matter on Windows now they have created the concept of Universal Audio Architecture which is a standard way for devices to expose their functions to Windows, and thus work without device specific drivers.
There is no reason Linux can't do this as well. You can have an audio daemon, and should. What need to happen is time send to be spent designing things in an intelligent way first, and then implement them so that they don't change all the time. Have a standard ABI that the driver writers develop for, and a standard API(s) that the software developers write for. Have standard mechanisms for people to add to or override that if needed.
It'll work fine, if designed well, implemented well, and not fucked with. You can't change the spec every other week. It needs to be laid out and stuck with.
This isn't theoretical, as I said OS-X and Windows do it, and have been doing it for some time.
Comment removed based on user account deletion
Latency is Good
No its not. Video playback with an audio lag of several seconds? Not good. Playing games with an audio lag of several seconds? Not good.
As for the networked audio stuff, you mention UPnP. All you need for UPnP to work is a dedicated UPnP server like Mediatomb to stream your audio to the client. You do NOT need an audio daemon for this.
This sig does not contain any SCO code.
The funny part is that if you have what the 99.9..% want, accessed through a reasonably thin shared library, it becomes pretty easy to forward it over a network. You end up with higher latency, but PA certainly seems to be putting the cart before the horse.
A lot of devices stream data over a network and play it locally as audio. That does not necessarily make any of them a "network based" audio device in the sense that they can be driven by PA.
Audio is not unique in needing device ACLs adjusted; it should not need a unique solution for doing that. In fact, having an audio server handle ACL adjustments when something else does that is a violation of the Unix philosophy of chaining together simple tools that focus on one thing.
Application-controlled latency is good. Library-enforced latency is bad. Sending audio from one user-space process to another is a case of the latter.
After reading your post made "as a PA developer", I'm even more down on it than before.
It's all about keeping the issues list organised and neat.
Some of your stuff wasn't related to PA, so he told you were to file them.
Some of your stuff was duplicates, so he told you were to discuss that, so he and other people could help you out, and in the long run get a more stable system released.
Some of your stuff was already fixed, so he told you that it would most likely get included in an update of the next major version of your distro.
Think about it, he might have a lot of issues he has to keep in organised. Having ONE "issue" with several unrelated problems will make it a hell to try and fix. The inconsistent flow of unrelated comments and discussions would only make it worse.
I don't think there is even one large open source project that excepts multiple problems as one "issue", and would most likely respond in a similar maner.
Some project take it even further and replying "File separate issues. Closed."
This is a "problem" with the open source community as whole, and not with Lennart (or any one else) ignoring your reports.
Mark Shuttleworth shaped Ubuntu up to be the ONLY decent desktop linux distro
Flamewar starting in 3....2....1....
SSC
I believe the solution to any *PROFESSIONAL* Linux Audio Production issue is to just go buy a Mac.
Technology -- No Place For Wimps! Grateful Dead and Jerry Garcia Chatroom -- http://www.wemissjerry.org
latency sucks... If I play a note on my guitar or keyboard, then I do not want to hear the sound more than a couple of milliseconds late... this is precisely why I still do my music recording on a windows box... I still can't get rid of it much as I really want to... I did have a perfectly good Ubuntu Studio setup going back on the LTS (Dapper Drake) before the current one, but certain issues pushed me into upgrading to the next LTS (Hardy Heron) and boom... pulseaudio screwed it all up... I was completely dumbfounded when I discovered it was an experimental sound system just dumped into the LTS without any attempt to get the default settings correct. I expect the LTS version of Ubuntu to actually work out of the box. So as a result, I got my XP box out of mothballs and went back to using XP for recording.
Donald 'Duck' Dunn: We had a band powerful enough to turn goat piss into gasoline.
You're confusing synchronization and latency. There's no particular reason you can't buffer up a few seconds of audio, yet make sure that audio is played exactly when the video calls for it.
"next LTS (Hardy Heron) and boom... pulseaudio screwed it all up..."
Dude, Ubuntu's integration of PA in that version totally sucks. They didn't even try to get things right there and this then reflects badly on PA. Ubuntu have made a *lot* of mistakes with pulse and are continuing to do so, so please don't use this as the benchmark to judge.
We released Mandrvia around the same time with our first PA-by-default version, and it was received very well. So don't blaming the carpenter just because the stable boy left the door open while the horse bolted.
I was using PulseAudio for a while. Every time I booted up I'd have to manually restart pulse. Then one day it just stopped working entirely. So then every time I booted I'd have to manually stop pulse and start alsa. Then that stopped working entirely. Finally I just completely removed PulseAudio, and everything has been working perfectly ever since.
The point of my first sentence is that it's stupid to point at the PS3 or Airport Express and say "that's like PA's network support!" because they work quite differently. They send almost arbitrary audio files over the network; PA sends audio bit streams.
The point about ACLs is precisely that it should be centrally managed. If PulseAudio is applying its own policies independent of the other ACLs that get adjusted when I start a session, it's wrong.
So you have a buzzword compliant core. Are there any copies from application buffers to device buffers, or vice versa? How does it select output block sizes, for the kind of low-latency things that advocate_one is talking about? How does PA handle output stream mixing between applications? (Maybe it doesn't -- MPlayer on my machine is unable to open the audio device if I have a browser open that ever looked at a YouTube video. If it worked, that's a feature I would use a lot more than dynamically switching an audio stream between devices. It worked fine under ALSA.)
I've had three systems with audio problems. Two Ubuntu-based (8.04, 9.04), a third OpenSuSE-based. All with PulseAudio. All had oddities- ranging from the sound working only during X session startup/shutdown (and not in-between), through to the audio skipping, repeatedly, when changing the current desktop. These were on reasonably decent machines, by the way. Machines that should gobble up and spit this data so fast that it barely dents CPU usage.
In each case, disabling PulseAudio and using, well, anything else, caused the problem to go away. OSS, ALSA, didn't matter, they both worked. Sometimes it was easy to remove PulseAudio, and sometimes it took a bit of work. Ubuntu 9.04 was a challenge. No, scratch that, it was a fight.
I look around, I see horror stories and widespread problems with PulseAudio.
I see claims that it works, if you configure it "properly". You know, I heard the same vague defence regarding Windows' instability. I didn't believe it for Windows either.
I've heard that PulseAudio has a great set of features. However, I have no interest in digging into what these features might be. The core feature that I want above all else isn't supported by PulseAudio. That feature?
Playing seamless audio.
PulseAudio can't even get that right. Stutters and skips are the norm, audio systems that worked previously no longer do, and the backers of this abomination are in abject denial about it. There are widespread complaints about it across multiple applications and multiple operating systems, and still it "isn't configured properly". You can't be serious. Complaints about PulseAudio are not really shared by the majority of technical people? Oh, yes they are.
If you want to provide a reasonable sound system, a *core* focus has to be on providing a working sound system. Get the core functionality right, then move onto features. Stability, correctness. Get the basics right. Also understand that API users may stuff things up, and falling over and dying is not the correct thing to do. The infrastructure needs to be resilient, not fragile.
PulseAudio did *not* do this. Any of this.
The order of the day seems to be to blame everything *but* PulseAudio. The apps are broken, the drivers are broken, the operating system maintainers didn't integrate it properly, it's not configured properly for the user's machine, the people complaining wouldn't be complaining if they were more technical, a lot of distros have adopted it so it must be good. Did I miss anything here? This has been the argument thus far.
I'm going to be different. I'm not going to blame the developers, the applications, the users, the knowledge of the users, the operating system developers, or anyone else. I'm going to blame the one at fault, the *cause* of these problems. The one thing in common with this incredible list of problems.
PulseAudio is completely and utterly broken- in design, in implementation, and in application. It is horrendous, shameful, and embarrassing.
Dude, I'm not talking about lag, I'm talking about latency. Latency is the time it takes from inserting the data into the buffer for it to be heard. Lag may be bad, but high latency is certainly good.
Mediatomb is a deamon in itself and it's a totally different use case than the UPnP support in PA, so please don't compare apples to oranges.
Yes there is: you don't want to be playing a game, and only seeing responses to your inputs seconds after you do things. Any noticeable input lag in a game ruins the experience. Ideally, you want no more than one frame of latency between reading inputs, running an iteration of your engine and getting it out to the display/speakers/haptics. Not all content is pre-recorded.
One of the nice things about PulseAudio's design is that it allows you to combine large buffers for some tasks with very low latency for others.
Whatever happened to GStreamer? I thought that "circuit/pipeline" model for building audio systems would make it easy for developers, and foster a whole new generation of interfacing audio to apps, and people to each other by audio. Where did that catchy future go?
--
make install -not war
That's the biggest load of crap I've seen. So it uses system timers and its own buffer management? That's sure looks to me like an overly complicated way of trying to get around poor primary interrupt latency in the OS kernel.
(That's one thing Apple got horribly wrong with MacOS, but fixed properly with OSX. MacOS didn't have predictable interrupt latency, and running any real-time applications was asking for trouble. How Avid, DigiDesign and Opcode succeeded is beyond me. However, OSX has the best primary interrupt latency of any OS right now, and the best audio stack. I really wish someone would leap-frog them to give them some incentive to make it better.)
It's [PA] structured the same way the audio systems on Windows and OS X are.
Like hell it is, and I say that as someone who has programmed audio and MIDI apps for OS X, Linux and NetBSD.
There should be no such distinction. Any "lower level" API should be an implementation detail of the application-level audio system, just as the PCI configuration space is an implementation detail as far as X clients are concerned. As for the traditional distinction between the audio deamon interface and the "lower level" one: it's an accident of history that we lived with that split so long. PA is a better world.
Last time I checked, PCI configuration was not time critical. As for the "accident of history", fact is you've got too much functionality in userspace.
As for POSIX real time scheduling? Just because the API exists doesn't mean it's implemented or configured on any of the major distributions, as it requires patches to the regular Linux kernel that would be detrimental to most peoples requirements. And my comment on switching users is no more anecdotal than Poettering's unsupported assertion that PA does what most users want.
Then on to power consumption.
Why is this being done by PA not by ALSA? It really seams this should be implemented in ALSA not in a userspace tool
OSSv4 or older flavours simply does not have the API to deal with a modern linux desktop
Instead of getting into flamewars over APIs, could you explain why OSSv4's API can't handle the modren linux desktop.
...it really wouldn't be a proper solution (and guess what? it would need a daemon running anyway!!)
Audio APP->kernel-> seams like a nice solution, then IF something needs to be pushed back out into userspace, do it
Audio->userspace->kernel just adds more problems for 90% of users, it makes sense to me to have audio->kernel->userspace->kernel when required, the 10% that regularly use stuff that needs userspace action configure it themselves (much like people install jack if they need it).
One final point regarding APIs. Why should the standard API cover stuff like position dependent events when this could be handled by a wrapper/app?
More and more audio device *are* network based.
Then there is the whole concept of thin-clients.
Most users don't care, we've simply gone from something that worked to something that doesn't, but generally speaking most desktop audio is coming out of the speakers, this path should be a priority and if that means stuff gets a bit uglier for these devices/setups so be it. If the only way to handle them while keeping desktop audio sane is too ugly then the people that use these devices should configure PA when needed (or hal should), so that 90% of the time desktop audio (usually single app(+random event sounds)->speakers) is as simple as possible.
Then of course there is the mixer.
This is partly inherited from alsa but dear god do audio devs not understand that 0 = mute? If you must have an infinite scale then don't tell me my audio is at 0!
PulseAudio as an architecture is fast becoming the defacto standard
Terrible argument as soo many de facto standards suck. (not that it matters but de facto is two words, much like de jure)
In addition, rights access and management is a big issue.
I think this is a major strength of PA, however I am the only person that uses my desktop and when I switch to a root TTY I still want to listen to my audio alerts, is there an easy way to disable this feature. (e,g the bug that existed in alsa was a feature not a bug)
You've probably being using a distro that doesn't care to integrate PA properly
Funny i use Fedora, which AFAIK has it's PA maintained by Lennart, yet it still has many problems.
p.s thank you for the informative posts, while I disagree with parts of PA i do appreciate it and can't stand the level of FUD around it.
IranAir Flight 655 never forget!
Use "pinfo" to read info pages: apt-get install pinfo
pinfo is the opposite of "info" in almost every respect:
And as a bonus, you can use it to read man pages too:
In terms of playback, the digital side of things should be limited such that it can never clip out. Digital clipping sounds extremely bad, and can damage speakers if it happens at high playback levels. Your computer should function such that 100% on the volume slider is equivalent to 0dBFS, no attenuation. All volume should be attenuation only in the digital domain.
So how do you make things louder? Turn up the volume on your amp. Computer speakers have a volume dial, receivers have a volume dial, etc. Use that, control the volume on the amp, not the digital levels. People shouldn't have to worry about setting their controls such that it results in digital clipping.
PA is not designed for being used when you are recording and need low latency. Lennart will tell you (and has told me) to use JACK for recording situations where you can set the system for ridiculously low latencies. I do not want to be seen as defending PA (I think it was released to the masses long before it was close to the level of functionality of its predecessor) , but the devs have been working recently to make PA play nicely with JACK. When I start JACK, PA releases those devices and I do my recording, When I finish, I stop JACK and PA takes them over again. Its not perfect yet, but its working for me. I have my Zoom H4 usb microphone as audio input, usb midi for keyboard input and the ALC888 as the audio output and it works fine with no discernible lag for me. Still need to compile a reatime kernel, but thats next week. Matt
but I do have to say that Pulse Audio... well I have nothing good to say about it. OSS worked for me back in the day and I rarely had any issues. ALSA worked for me after some fidgeting but things got stable quite fast. Pulse Audio.... nothing but trouble since Fedora 9 and onward. Is it getting better? Possibly it is, but on all machines that I have used it on it always becomes excruciatingly painful with its odd volumes and.... ok I feel a rant coming along here and I don't want to really diss anything that I didn't actually pay for. But daym... I do have to say that if the rest of GNU/Linux was done this way we would not be here today PERIOD.
If JACK can handle low latency and it works, what is the point of PA?
The only case where latency does not matter is media player ... and then only when the media is audio, and even then there are limits (~200-300ms max). Video must be pausable and seekable - without delay. VoIP is killed with 50ms delay as the codec will create additional delay.
An interesting side note on audio APIs: http://blogs.adobe.com/penguin.swf/linuxaudio.png
Man, not that bullshit again...
Let's break this down.
First you have platform independence layers - things like ClanLib, SDL, libao, PortAudio, Allegro, and Open AL. These would be present on any platform. That's the point of them. The diagram seems to go out of its way to mix these in with lower-level technologies, as if to make it less obvious that they're just included to pad out the diagram.
Then there's the trio of obsolete network audio servers: NAS, ESD, and aRts... I suppose if I were to fire up a quick game of xpilot then I might want NAS, but otherwise one can usually assume these days that these three servers aren't installed and don't need to be.
There's FFADO - which is relevant if you're using a firewire audio device... How many people do this? I guess it could be popular among musicians and sound techs - have audio hardware outside the computer's case, accessed via a bus that isn't USB... But this is a driver layer, not an API layer - and these days it seems FFADO provides an ALSA interface, so I think the complaint here is obsolete.
That leaves three modern sound servers (Jack, Pulse, and GStreamer) and two low-level APIs (Alsa and OSS). This is still a bit of an unfortunate mess IMO but nowhere near the rat's nest implied by the diagram.
Bow-ties are cool.
Look, I understand that getting this stuff right is a hard problem and takes some effort to get resolved, and that' s not necessarily the fault of the developer. But it's not my fault either. I don't have time for this kind of thing - while there was a day when I really enjoyed spending a bunch of time fiddling around with my computer to get it to work right, those days are mostly over for me now. I need sound to "just work", and if Pulseaudio doesn't, then I'm not using it.
Hi all... FreeBSD user, not really a Linux guy. What's the difference between our sound system and Linux, anyways? IIRC we're based on Open Sound System, but I could be mistaken. Sound still isn't configured by default in FreeBSD, but it seems to work quite nicely once the right kernal module is loaded. I can have any number of sound-using apps open. They all open /dev/dsp and get their own sound channel.
Anyways, just curious is someone who's familiar with both OS's can fill me in. This conversation has been really interesting.
The problem with PA's low latency set up is that it consumes and inordinate amount of CPU. Lennart has admitted that. The problem with sound servers doing too much is that they will inevitably add latency. Paradox.
PulseAudio isn't perfect, but the basic ideas behind it are sound, which is why the whole Linux world is adopting it.
I call BS, here.
Things don't get adopted by Linux distributions because they're technically sound; they get adopted if, for whatever other reason, they become the fad flavour of the month.
I tried for nearly two months to use Ubuntu Intrepid Ibex; audio was dying constantly, and I was having kernel panics randomly from the video card drivers as well. Then there was the nightmare when I made the mistake of trying to use another window manager beside GNOME.
Linux in technical terms is crap, currently, and I'm fed up with the denial. I'm using FreeBSD, and have been since January; I wanted to use Linux, but aside from maybe Slack, Arch, and LFS, none of the major distributions are usable without giving me endless problems. It's either package management, or hardware drivers, or the DE is fused with everything else and can't be removed, etc...it's hell.
Stop claiming things are fine when they're not. Stop writing propogandist garbage like this, where you're basically just trying to force people to hold their noses and drink the Kool Aid, when they're telling you in droves that real problems exist.
The denial needs to stop, and the problems need to be acknowledged and fixed.
* We need a sound daemon that doesn't try and have a heap of other features which hardly anyone ever needs, but that just plays audio. THAT'S ALL IT NEEDS TO DO. No client/server crap. No being able to play files while changing the sound card. None of that shit. All it needs to do is play audio files.
* GNOME needs to be scrapped entirely, and replaced with something that isn't committed to simply reproducing all of Windows' design mistakes. We need a window manager that is genuinely designed according to the UNIX philosophy. That means dotfiles for configuration, not a centralised registry which just bogs everything down. It also means use of the pre-existing sockets system for IPC; NOT abominations like XML-RPC. It also means something which is genuinely modular, not where if you install any one single piece, you then HAVE to install all of the rest.
* Init/Upstart both need to be scrapped, and replaced with FreeBSD's init system. It is simple, clear, sane, and WORKS.
* Ubuntu's insane mess for kernel module loading also needs to be annihilated as well, and the standard module loading programs need to be used.
* This is something which I know will never happen, because Canonical are too stupid and delusional, but if they truly were intelligent, they would drop Debian as a base. They need to use something cleaner, like Slack, Arch, or LFS, and they could then save a lot more work for themselves by adopting pkgsrc (which is being maintained by NetBSD) as their package management system. Ports systems are a lot more robust than dkpg/apt, and I don't want to hear the contrary from the usual Debian fanboys, either. YOU ARE WRONG, and Ubuntu's upgrade routine trashing systems is the proof. For ONCE, sit down, shut the hell up, and accept it.
If you really mean any of the talk that you keep endlessly engaging in about wanting to be competitive, Linux community, then fucking lift your game.
The first step to doing that is ending the denial, once and for all. The second is to cease mindlessly aping Windows, and establish your own identity; ideally one based on the very UNIX design principles that you've been so enthusiastically throwing away.
Let's see how many of the Generation Y, amateur, snot nosed brats I get making a response to this post; people like the idiot who wrote the post that I'm replying to, here. People who think that everything with Linux is just fine, and who continue churning out bloated, inefficient, unstable crap, because they don't know how to do everything else, yet still see themselves as an avatar of Neo inside their own heads.
Mod me down, instead of refuting me, as well. Use every lame Slashdot trick in the book for posts you don't agree with.
This is the truth, Linux developers. You might not like it, but you need to fucking hear it.
Yes... Pulseaudio doesn't see the S/PDIF output used to send audio to the video card.
Math is beautiful... e^(pi*i)+1=0
I see two possibilities here. Either you are just trolling, in which case shame on you for wasting our time; or else you really believe all this ranting stuff you wrote, in which case you need to gain some technical maturity.
Except you're not going to be any more specific here, are you? You'll call me immature, but you don't define what maturity means in that context.
I'm by no means the only person who has had problems with Ubuntu; if you think that, you might want to hang out on their support forums sometime.
And you don't offer any facts or even reasoned debate about any of this.
FFS; I keep hearing this over and over again, too. Go and look at my comment history. Read the comment I made there, only about two posts ago, about exactly what is wrong with GNOME. No, I'm not going to write all of that out again.
You asking for more and more and more "facts," is also BS. The only thing you're really asking for is ammunition that you can use to refute me, because on a completely emotive, subjective basis, you don't want to listen to me at all.
You don't understand why PulseAudio is designed the way it is, therefore it must be the work of an idiot, and anyone who defends it must be an idiot.
I understand that Pulse has a lot of features in it which it doesn't need, for the purpose of playing audio files. The other stuff might be nice, but there's a difference between something being nice, and something being necessary, especially if it doesn't work.
Regardless, this is yet more denial. There are so many people using and writing for Linux who think that the way things are done with it, is the only way things can or should be done, and what that usually translates to fairly directly is imitation of Microsoft, as closely as possible. Hence, when excessively, needlessly complex, bad software is written, you keep defending it, because you don't know any better, and you also falsely associate Microsoft's own history of writing bad code, with their popularity. Which, of course, leads us back to the real heart of the problem.
Attempting to achieve mainstream popularity at virtually any cost, is the only thing that Linux developers really care about at this point. Technical integrity or correctness don't enter into the discussion at all; or when they do, it's even worse. You've redefined what technical integrity means in your own heads, such that said definition always leads back to what will simply make Linux more popular. Not what is conducive to actual stability or efficiency with the system.
What would be the point of that? FreeBSD is doing a good job of being FreeBSD. You like it, go use it and stop ear-bashing.
Translation: "FreeBSD works, and you want something that works, you say? Then go use FreeBSD. With Linux, we continue to support elitist incompetence. When critical operating system infrastructure doesn't function, we don't fix it; instead we make excuses for the developers who are responsible for the mess. We also try and humiliate and/or discredit users who complain about this state of affairs, and tell them to stop being such big meanies.
We also insist that we know better than the authors of the initial UNIX operating system, even though their software worked, and ours doesn't."