Skip to contentSkip to conversation

How to get ac97_t pointer from snd_pcm_substream_t?

DISCUSSION Bill Gatliff 2 participants 2 messages Oct 10, 2005 – Oct 11, 2005

lore
Share & tools
lore
#0 lore raw

Guys:

I want to call snd_ac97_set_rate() from my PCM prepare() handler.

I can't seem to figure out how to get the codec pointer (ac97 in my case) from a snd_pcm_substream_t. Is it possible?

Thanks!

b.g.

Signature · 9 lines
Bill Gatliff
[email protected]



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
#1 lore raw

At Mon, 10 Oct 2005 12:31:22 -0500,

Quoted 7 lines · Bill Gatliff

Guys:

I want to call snd_ac97_set_rate() from my PCM prepare() handler.

I can't seem to figure out how to get the codec pointer (ac97 in my case) from a snd_pcm_substream_t. Is it possible?

There are several ways.

In most cases, retrieve the chip instance via snd_pcm_substream_chip() (assuming that pcm->private_data = chip), and get ac97 instance from it.

You can assign substream->runtime->private_data for your own purpose, too. It's independent from pcm or substream->private_data.

pcm->private_data and substream->private_data are usually identical. substream->private_data is copied from pcm->private_data at open time. But you can override this value if you want.
For example, isa/cmipci.c uses this trick to support different codecs.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl