News for hackers. Stuff that matters.
Re:Plan 9: The way the future was by dalke on Wednesday February 01, 2012 @09:35AM (#3538057)
That API seems so clunky. What if I have two different programs, with different sample rates, which I want to play back at the same time?
Re:Plan 9: The way the future was by angersock on Wednesday February 01, 2012 @01:23PM (#3539214)
Each program sees its own copy of /dev/dsp. Behind the scenes, that copy is backed by some magic on the OS's part that handles state tracking, mixing, etc.

The program only ever sees a dumb bit bucket with some flags on how to handle it--that's why we have OSs, after all: to avoid having to write hardware driver code for all our programs (see the bad old days of DOS game programming).

The program still needs to manage sound mixing in userland to fill that buffer. That's nothing new, however, and you can use PortAudio, FMOD, XACT, whatever to do that mixing for you, or roll your own.

This abstraction would greatly simplify that process.

Re:Plan 9: The way the future was by dalke on Wednesday February 01, 2012 @08:45PM (#3541053)
Thanks to you and others who pointed out that plan9 exposes private copies to each program. I did not know that, and it would solve the issue I wondered about.

But that doesn't solve the underlying issue. If my program uses two libraries, both of which play sounds, then how does each library get its own configuration filesystem? Is there a way to create a new view, so that the two libraries can be disconnected from what the main program needs?

Re:Plan 9: The way the future was by EdiX on Wednesday February 01, 2012 @11:38AM (#3538680)
I'm not an expert in plan9 stuff but I think each process sees its own version of some parts of the file system (IIRC mounts are also process specific), so, maybe those commands would only apply to the current process.
Re:Plan 9: The way the future was by ori_b on Wednesday February 01, 2012 @12:37PM (#3538980)
Each process gets it's own namespace in plan9.
Re:Plan 9: The way the future was by batista on Wednesday February 01, 2012 @11:53AM (#3538760)
The same things that happens now with any regular sound API.

There are calls (similar to the above example) to just play a sound, and there are different calls to schedule multiple sounds to play simultaneously.