Re: question about sampling rate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 
Yes I am referring to the audio class driver. I actually would want to understand about this:
 
/*
 * convert a sampling rate into USB high speed format (fs/8000 in Q16.16)
 * this will overflow at approx 4 MHz
 */
inline static unsigned get_usb_high_speed_rate(unsigned int rate)
{
 return ((rate << 10) + 62) / 125;
}
 
and
 
/*
 * convert a sampling rate into our full speed format (fs/1000 in Q16.16)
 * this will overflow at approx 524 kHz
 */
inline static unsigned get_usb_full_speed_rate(unsigned int rate)
{
 return ((rate << 13) + 62) / 125;
}
 
I have no clue as to why rate was shifted by 13 then added by 62 then divided by 125.
I will be writing an embedded linux audio class driver and would like to simplify the alsa since it is a bit complex and many features may not be applicable for our use.
 
Thank you for any help extended.
 


 
On 7/12/06, Adrian McMenamin <adrian@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On Wed, July 12, 2006 9:05 am, Grace Baldonasa wrote:
> Hi all,
>
> I have a very simple question regarding the convertion of sampling rate to
> usb full/high speed rate, is this the right mailing list to throw the
> question?
>
> any reply will be greatly appreciate.
> Thanks.
>
You need to be a bit clearer about what it is you want to do. I assume you
are referring to a sound device.

ALSA will automatically handle the sample rate - converting between the
sample rate of the sound you want to play and the capabilities of your
device as specified by the driver.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux