I have been trying for a week to determine what is wrong with my AHI recording code when in fact it is the AC97 driver that is buggy, it seems.
I was trying to record at 44100Hz stereo using the device.
AHI settings for my unit was set to 44100Hz HiFi Stereo++.
Result: The audio I got was pitch bent. It was obvious that I was getting 48000Hz data from AHI although I had told it I wanted 44100.
I change the AHI settings to 48000Hz HiFi Stereo++ but still reading 44100Hz from the device.
Result: The pitch was correct but there seemed to be gaps in the data.
The gaps seemed to have a size corresponding of upsampling 44100 to 48000, but the conversion was the other way around so there simply seems to be a conversion calculation bug in the driver or something.
Now using the CMI8738 driver instead in 44100, 44100 mode.
The problem using the CMI is that it has automatic analog loopback from Line In to Line Out which is undesirable because I want the sound to go through my program only. Sadly there seem to be no way around this which is why I wanted to use the AC97 for recording and CMI for playback
