All of lore.kernel.org
 help / color / mirror / Atom feed
* How to get ac97_t pointer from snd_pcm_substream_t?
@ 2005-10-10 17:31 Bill Gatliff
  2005-10-11 10:25 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Gatliff @ 2005-10-10 17:31 UTC (permalink / raw)
  To: alsa-devel

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.

-- 
Bill Gatliff
bgat@billgatliff.com



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to get ac97_t pointer from snd_pcm_substream_t?
  2005-10-10 17:31 How to get ac97_t pointer from snd_pcm_substream_t? Bill Gatliff
@ 2005-10-11 10:25 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2005-10-11 10:25 UTC (permalink / raw)
  To: Bill Gatliff; +Cc: alsa-devel

At Mon, 10 Oct 2005 12:31:22 -0500,
Bill Gatliff wrote:
> 
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-11 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-10 17:31 How to get ac97_t pointer from snd_pcm_substream_t? Bill Gatliff
2005-10-11 10:25 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.