All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@kernel.org>,
	Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Subject: Re: How to handle stream rates if CPU supports many channels ?
Date: Wed, 7 Jun 2017 00:22:01 +0900	[thread overview]
Message-ID: <39b056b5-2085-5583-d440-9fa075db04d1@sakamocchi.jp> (raw)
In-Reply-To: <874lvtzjo5.wl%kuninori.morimoto.gx@renesas.com>

On 2017年06月06日 16:04, Kuninori Morimoto wrote:
>> Furthermore, PCM runtime require constraints for channels and
>> rates. In ALSA SoC part, this is done by 'soc_pcm_init_runtime_hw()'
>> in 'sound/soc/soc-pcm.c'. Your driver should have proper values in
>> data of 'struct snd_soc_pcm_stream' as the constraints.
>>
>> ```
>> (struct snd_soc_dai_driver.playback or capture?)
>> struct snd_soc_pcm_stream.channels_min = 2
>> struct snd_soc_pcm_stream.channels_max = 8
>> struct snd_soc_pcm_stream.rate_min = 48000
>> struct snd_soc_pcm_stream.rate_max = 192000
>> struct snd_soc_pcm_stream.rates =
>>      SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_192000
> 
> Here, I'm not yet 100% understanding about these value.
> I think, above are constraints of whole driver (= it supports both 2ch, 8ch).

It's not my intension. I don't know exactly where you implement 'struct 
snd_soc_pcm_stream' data in your driver. Perhaps as a part of 'struct 
snd_soc_dai_driver' data.

> About rate_min/max and rates.
> is this "rate_min" 48000 (= maximum rate of min case = 8ch) ?? not 8000 ?
> (For example, if 2ch supports 8000-192000, 8ch supports 8000-48000)
> 
> And is .rates "SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_192000" ?
> not SNDRV_PCM_RATE_8000_192000 ?

In my code snippets, I assumed that the hardware supports just two 
modes; 8ch/48.0kHz and 2ch/192.0kHz. You can expand the snippets as your 
case. Even if using SNDRV_PCM_RATE_8000_192000, role of the 
'hw_rule_rate()' and the 'hw_rule_channels()' is invariant. The former 
checks channels parameters and constrains rate parameter with valid 
interval. The latter checks and constraints vice versa with valid list.


Regards

Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2017-06-06 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06  0:48 How to handle stream rates if CPU supports many channels ? Kuninori Morimoto
2017-06-06  3:41 ` Takashi Sakamoto
2017-06-06  7:04   ` Kuninori Morimoto
2017-06-06 15:22     ` Takashi Sakamoto [this message]
2017-06-06 23:41       ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39b056b5-2085-5583-d440-9fa075db04d1@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hiroyuki.yokoyama.vx@renesas.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.