diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2016-03-07 14:35:45 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-03-09 16:20:58 +0100 |
commit | 7cafc65b3aa1b6970f92211c55712f115d876cfc (patch) | |
tree | 639f2a0953885e915a123745d950f190b170e156 /sound/firewire/dice/dice-pcm.c | |
parent | ALSA: dice: handle several PCM substreams when any isochronous streams are av... (diff) | |
download | linux-7cafc65b3aa1b6970f92211c55712f115d876cfc.tar.xz linux-7cafc65b3aa1b6970f92211c55712f115d876cfc.zip |
ALSA: dice: force to add two pcm devices for listed models
Some models reduce the number of available isochronous streams for higher
sampling transfer frequency. Such models bring an issue about how to add
PCM substreams. When at lower sampling transfer frequency, the
models reports whole available streams, thus this driver can add enough
number of PCM substreams at probing time. On the other hand, at higher
sampling transfer frequency, this driver can just add reduced number of
PCM substreams. After probed, even if the sampling transfer frequency is
changed to lower rate, fewer PCM substreams are actually available. This
is inconvenience.
For the reason, this commit adds a list so that this driver assume models
on the list to have two pairs of PCM substreams. This list keeps the name
of model in which the number of available streams differs depending on
sampling transfer frequency.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/dice/dice-pcm.c')
-rw-r--r-- | sound/firewire/dice/dice-pcm.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c index 05e2e18b4c30..4aa0249826fd 100644 --- a/sound/firewire/dice/dice-pcm.c +++ b/sound/firewire/dice/dice-pcm.c @@ -332,16 +332,22 @@ int snd_dice_create_pcm(struct snd_dice *dice) int err; /* Check whether PCM substreams are required. */ - max_capture = max_playback = 0; - err = snd_dice_transaction_read_tx(dice, TX_NUMBER, ®, sizeof(reg)); - if (err < 0) - return err; - max_capture = min_t(unsigned int, be32_to_cpu(reg), MAX_STREAMS); + if (dice->force_two_pcms) { + max_capture = max_playback = 2; + } else { + max_capture = max_playback = 0; + err = snd_dice_transaction_read_tx(dice, TX_NUMBER, ®, + sizeof(reg)); + if (err < 0) + return err; + max_capture = min_t(unsigned int, be32_to_cpu(reg), MAX_STREAMS); - err = snd_dice_transaction_read_rx(dice, RX_NUMBER, ®, sizeof(reg)); - if (err < 0) - return err; - max_playback = min_t(unsigned int, be32_to_cpu(reg), MAX_STREAMS); + err = snd_dice_transaction_read_rx(dice, RX_NUMBER, ®, + sizeof(reg)); + if (err < 0) + return err; + max_playback = min_t(unsigned int, be32_to_cpu(reg), MAX_STREAMS); + } for (i = 0; i < MAX_STREAMS; i++) { capture = playback = 0; |