3 ms·
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?
by dalke 15y ago
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?
- EdiX 15y agoI'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.
- batista 15y agoThe 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.
- ori_b 15y agoEach process gets it's own namespace in plan9.
- angersock 15y agoEach 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.
- dalke 15y agoThanks 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?