2011-08-28 23:08:02     Does ALSA support 192000Hz sample rate?

Document created by Aaronwu Employee on Aug 27, 2013
Version 1Show Document
  • View in full screen mode

2011-08-28 23:08:02     Does ALSA support 192000Hz sample rate?

Zhi Qiang Zhang (CHINA)

Message: 103173   

 

Hi,

 

I made a dummy ASoc driver that used to check how the ASoc driver work.

 

In snd_soc_ops.hw_params I print out the audio setting,

 

printk(KERN_INFO "hw_params. rate=%d, format=%d\n", params_rate(params), params_format(params));

 

I used ALSA function snd_pcm_hw_params_set_rate to set the sample rate to 44100, 48000, or 96000, the above statement can print out the appropriate sample rate, when setting to 44100 it prints

 

hw_params. rate=44100, format=6

 

when setting to 48000 it prints hw_params. rate=48000, format=6

 

when setting to 96000 it prints hw_params. rate=96000, format=6

 

it is correct. but when setting to 22050, it prints hw_params. rate=44100, format=6

 

when setting to 192000, it prints hw_params. rate=96000, format=6, it is out of control,

 

Dose ALSA support 192000Hz sample rate?

 

 

 

Regards,

 

ZhangZQ

QuoteReplyEditDelete

 

 

2011-08-29 01:39:37     Re: Does ALSA support 192000Hz sample rate?

Scott Jiang (CHINA)

Message: 103175   

 

the sample rate is defined in your struct snd_soc_dai_driver, you should check the dai capabilities.

QuoteReplyEditDelete

 

 

2011-08-29 02:50:45     Re: Does ALSA support 192000Hz sample rate?

Zhi Qiang Zhang (CHINA)

Message: 103177   

 

I already have this definition,

 

#define MYRATE_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |    \

                       SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |    \

                        SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000)

 

#define MYFMT_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)

 

static struct snd_soc_dai_driver my_dai = {

        .name = "my-hifi",

        .playback = {

                .stream_name = "Playback",

                .channels_min = 1,

                .channels_max = 2,

                .rates = MYRATE_RATES,

                .formats = MYFMT_FORMATS,

        },

        .ops = &my_dai_ops,

};

 

 

 

Regards,

 

ZhangZQ

Attachments

    Outcomes