summaryrefslogtreecommitdiffstats
path: root/sound/firewire/dice/dice-pcm.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-10-07 20:05:20 +0900
committerTakashi Iwai <tiwai@suse.de>2019-10-17 12:02:42 +0200
commit94c8101a2717a96457b474580e47142a0ef933c9 (patch)
tree27a22dd4d8bb0f96de033f025275b43a74ae5063 /sound/firewire/dice/dice-pcm.c
parent1d6a722c4a0146ac20fd0daa541a177279adcbb2 (diff)
downloadlinux-94c8101a2717a96457b474580e47142a0ef933c9.tar.bz2
ALSA: dice: register the size of PCM period to AMDTP domain
This commit is a preparation to share the size of PCM period between PCM substreams on AMDTP streams in the same domain. At this time, the size of PCM period in PCM substream which starts AMDTP streams in the same domain is recorded. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20191007110532.30270-6-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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c
index 94a4dccfc381..570456a7751d 100644
--- a/sound/firewire/dice/dice-pcm.c
+++ b/sound/firewire/dice/dice-pcm.c
@@ -243,9 +243,14 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
unsigned int rate = params_rate(hw_params);
+ unsigned int events_per_period = params_period_size(hw_params);
mutex_lock(&dice->mutex);
- err = snd_dice_stream_reserve_duplex(dice, rate);
+ // For double_pcm_frame quirk.
+ if (rate > 96000)
+ events_per_period /= 2;
+ err = snd_dice_stream_reserve_duplex(dice, rate,
+ events_per_period);
if (err >= 0)
++dice->substreams_counter;
mutex_unlock(&dice->mutex);