>> We have been unable to find a way to tell ALSA, through 
>> snd_pcm_mmap_begin(), where we want to write data when using the mmap 
>> api. OSS doesn't have this restriction and this is the only documented 
>> way we can see to support sound engines which mix in new sounds using 
>> looping buffers and "randomly" writing ahead of the playing position. We 
>> have seen that there are undocumented ways to support this functionality 
>> and we are leery of using undocumented functionality since it could 
>> disappear or change. Can you suggest a documented way to achieve the 
>> desired effect or would you be in favour of modifications to the API?

although i agree that from a pragmatic perspective, it would be good
to understand how to use ALSA to do this.

however, this model of audio programming is not portable, and has
gotten people into trouble before, not just under Linux.

making the assumption that direct access at all times to the full
hardware buffer is not a valid assumption to make. there is a very
popular audio interface API (ASIO) that explicitly denies this
possibility, and there are audio interfaces out there that are not
designed in a way that makes it possible to do what you are trying to
do (i know that game programmers generally don't use ASIO).

its just my personal opinion of course, but i think it very
unfortunate that game programmers have fallen into this model. by all
means setup your *own* buffer and write anywhere into it. then
transfer the relevant parts of your buffer to the device at interrupt
time (i.e. when poll returns or when write is possible). but assuming
that you can access the h/w buffer directly and more - that you can
access all of it at any time, i don't believe that this is a good
model.

i can understand that you don't like having to sync to the audio
device interrupt. but not doing so leads to other problems as well.

just my $0.02, or perhaps less.

--p





-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to