thinking about some edits of the AC97 page
Posted: Mon Dec 27, 2021 8:19 pm
I've noticed a possible error on the AC97 page, but would like to first make sure that I did understand it correctly myself.
The sample count field indeed means sample count, not (sample_count / channel_count) - 1 as described above.
For example, 0xFFFE actually means 0xFFFE samples. If playing in stereo, the dma will consume them 2 at a time and run through them in 0x7FFF/sample_rate seconds.
What's more troublesome, is that if you program it to an odd value 0xFFFF and run it in stereo mode, the dma will hang at the end and the status/interrupts will still reflect that it is going.
Would appreciate someone to help confirm whether my understanding is correct and the page should be updated.
Also thinking about adding some descriptions about the producer consumer operations which should be helpful for managing the buffers.
My findings are:Buffer have 32 entries. Every entry can transfer max 0xFFFF samples(write value 0xFFFE to length entry), but you must have in mind that one sample mean samples of all channels whose are use. So if you have 2 channels 16 bit audio, value 0xFFFE means that (2 bytes pre sample*2 channels*0xFFFF)=256 KB is transfered.
The sample count field indeed means sample count, not (sample_count / channel_count) - 1 as described above.
For example, 0xFFFE actually means 0xFFFE samples. If playing in stereo, the dma will consume them 2 at a time and run through them in 0x7FFF/sample_rate seconds.
What's more troublesome, is that if you program it to an odd value 0xFFFF and run it in stereo mode, the dma will hang at the end and the status/interrupts will still reflect that it is going.
Would appreciate someone to help confirm whether my understanding is correct and the page should be updated.
Also thinking about adding some descriptions about the producer consumer operations which should be helpful for managing the buffers.