@dse said:
..., driver should provide a transparent way to multiplex between users (with potential quality drop, but with clever zero copy it actually is most of the time Ok). But if there is absolutely no way, it should throw an file access error
when open
ing /dev/video0
This is what happened with the old OSS sound thingy. /dev/dsp or whatever it was on Linux didn't do multiplexing or anything if the sound hardware didn't have hardware mixing and opening it more than once at the same time threw the busy error. If you were one of the fortunate ones with something like SoundBlaster Live! that had real hardware mixing you could mostly ignore all sound related issues because that shit just worked damn well.
Then there were two or more attempts (arts, esd, insert more) at solving this by having odd sound servers with shitty APIs and even shittier OSS emulation and laggy throughput where the sound server did software mixing and applications were wrapped with the (broken) OSS emulation layer which usually resulted in distortion and lag. Even though all servers had some "native" API no app really ever used it except some special cases because you'd need to have like four different ways to output some fucking sound.
The came ALSA, another kernel API that was complex, even shittier than OSS and new hardware didn't support OSS anymore and old apps didn't support ALSA. It had broken software mixing (dmix) and an API that usually caused some sort of distortion and again OSS emulation that caused even more distortion. This shit pile was used for around 10 years or so.
Now ALSA is still there, not-too-old applications have slowly dropped support for all legacy sound servers and only have ALSA support. Though, because ALSA is still as shitty as it was before, PulseAudio was born to give us AGAIN a new sound server. It has broken ALSA emulation yet again and all legacy-ish applications that only have OSS/ALSA support go through that. Fortunately it's relatively lag free and at best just works. Switching output per application and controlling volume level actually works if for god sake you have PA output support in your app it works relatively well.
It took like 20 years to go full circle and we again have a shitty kernel API and a sound server that does software mixing hiding all the shittiness of the kernel API.
I've had to use all incarnations of this shit and can at least say the current situation it A LOT better than anything before, even though it still works around the official Linux sound API...