Skip to contentSkip to conversation

AC97 Codec Rate Problem

DISCUSSION Manuel Lauss 2 participants 3 messages May 12, 2006

lore
Share & tools
lore
#0 lore raw

Hello folks,

I've developed an ALSA driver for the Renesas SH7760 (a SH-4 SoC) AC97 component, following Takashi Iwai's howto document.

Right now, I call snd_ac97_set_rate() in the drivers' prepare() callback; but since I don't know which rates the attached codec actually supports, I thought maybe there is a way to let ALSA itself handle setting the rates?

If anyone wants to have a look at the source, I've put it up at
http://140.78.4.77/~mano/camelot-ac97.c

(The driver works pretty well on my devel platform, LM4549 codec)

Thanks!

Signature · 8 lines
 Manuel Lauss


-------------------------------------------------------
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
#1 lore raw

At Fri, 12 May 2006 19:15:45 +0200,

Quoted 10 lines · Manuel Lauss

Hello folks,

I've developed an ALSA driver for the Renesas SH7760 (a SH-4 SoC) AC97 component, following Takashi Iwai's howto document.

Right now, I call snd_ac97_set_rate() in the drivers' prepare() callback; but since I don't know which rates the attached codec actually supports, I thought maybe there is a way to let ALSA itself handle setting the rates?

The supported rates are detected at ac97 probing time and stored in ac97->rates[] array. For example, ac97->rates[AC97_RATES_FRONT_DAC] corresponds to the front playback rates. It's bit flags consisting of SNDRV_PCM_RATE_* bits.

Usually, at a PCM open callback, write this value to runtime->hw.rates, then call snd_pcm_limit_hw_rates(runtime) for adding a hw_params constraint.

Takashi

-------------------------------------------------------
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

#2 lore raw
Quoted 5 lines · Takashi Iwai
Quoted 4 lines

Right now, I call snd_ac97_set_rate() in the drivers' prepare() callback; but since I don't know which rates the attached codec actually supports, I thought maybe there is a way to let ALSA itself handle setting the rates?

Quoted 8 lines

The supported rates are detected at ac97 probing time and stored in ac97->rates[] array. For example, ac97->rates[AC97_RATES_FRONT_DAC] corresponds to the front playback rates. It's bit flags consisting of SNDRV_PCM_RATE_* bits.

Usually, at a PCM open callback, write this value to runtime->hw.rates, then call snd_pcm_limit_hw_rates(runtime) for adding a hw_params constraint.

Thanks, I'm going to implement that.

Signature · 8 lines
 Manuel Lauss


-------------------------------------------------------
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