[alsa-devel] issue at 44.1 Khz capturing
james.dutton at gmail.com
Mon Aug 10 12:14:44 CEST 2009
2009/8/10 Harsha, Priya <priya.harsha at intel.com>:
> I am using arecord for capturing data. When I try to record at 8 or 48 KHz, it's perfectly fine. But when I try to record at 44.1 Khz, there are spikes in the recorded data for every buffer. When I tried to tap the data captured at the firmware/hardware end, it's smooth but the same data when is checked from the user space after being recorded, it has spikes. On further analysis, looks like for every buffer recorded there is either 1 sample recorded extra or 1 sample dropped. But when I printed out the values passed from the pointer function, they are exactly at the intervals of 5513 bytes.
> Can anyone give me any clue as to what is going wrong? I am using indirect_* functions in the driver code. Is there any buffer size round off that is giving this error? Can I handle something in the driver to avoid this?
A lot of sound card hardware cannot work at anything other than 48kHz.
alsa is therefore resampling to the applications rate. In this case
trying to get 44.1kHz.
It is very difficult with the current alsa architecture to get good
I would advise you to record at 48kHz and use something like SOX
afterwards, to get 44.1kHz. Note that also sound cards are not good at
playing 44.1kHz because the same resampling happens. So keeping
everything at 48kHz now days is probably best.
More information about the Alsa-devel