Hi Matthew, Matthew van Eerde skrev 2011-10-27 18:06:
WASAPI will use the default format specified in the Sound control panel, which can be anything the driver supports. The inbox HD Audio class driver supports 24 bits per sample only in 32-bit containers.
That makes sense, specially due to the possible 128 byte alignment, which is hard to achieve with a 24 bit container...
The 128-byte alignment requirement comes from Intel's spec: http://www.intel.com/content/www/us/en/standards/standards-high-def-audio-specs-general-technology.html 4.5.1 Stream Data in Memory "Each individual buffer must contain an integer number of samples, but blocks and packets may be split across multiple buffers. The buffer must start on a 128-byte boundary and must contain at least one sample of data. For highest efficiency, the following guidelines should be met in buffer allocation: The buffer should have a length which is a multiple of 128. The buffer should contain at least one full packet of information."
It does say "should have a length which is a multiple of 128", which means it is not mandatory, and obviously the MS driver has no problem with the buffer length not being a multiple of 128 bytes. But I can see that HD audio driver developers will indeed adhere to the recommendation, thus my "problem".
A 5.1 stream will thus have a buffer size which is a multiple of 128*3 = 384 bytes; a 5.1 stream of 24-bit samples in 24-bit containers will have a buffer size which is a multiple of 128*3*3 = 1152 bytes. (I suspect it is for this reason that hdaudio.sys favors 24-bit samples in 32-bit containers, but usbaudio.sys favors 24-bit samples in 24-bit containers.)
Yes, makes sense. Thank you Matthew for very useful information. Best regards, /Rob
-----Original Message----- From: wdmaudiodev-bounce@xxxxxxxxxxxxx [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Robert Bielik Sent: Wednesday, October 26, 2011 11:22 PM To: wdmaudiodev@xxxxxxxxxxxxx Subject: [wdmaudiodev] Re: WaveRT weird problem Robert Bielik skrev 2011-10-27 06:15:But that's an interesting point though, the 128 byte alignment issue. Where is that documented on MSDN ? I.e. it would be good to have a link to the relevant HD audio spec with regard to the RequestedBufferSize field of KSRTAUDIO_BUFFER_PROPERTY...I'm curious though, since I query the buffer for 5292 bytes (6 byte nBlockAlign), I don't see how that'll work, since GCD(5292,128) = 4. How does the WASAPI backend handle this, does it use wBitsPerSample=32& wValidBitsPerSample=24 ? TIA /Rob ****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.com/ ****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.com/
****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.com/