summaryrefslogtreecommitdiff
path: root/sound/firewire/motu/motu-stream.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-10-18 00:54:20 +0900
committerTakashi Iwai <tiwai@suse.de>2019-10-18 04:35:51 +0200
commit0f5482e7875bc2d507e6d92fcc8de22ff75fbdda (patch)
treeae74dc4a92c23f828a700972d21a4ef49d2d6b61 /sound/firewire/motu/motu-stream.c
parent128307d5f947d43a89e68dd8357879a0f111821d (diff)
ALSA: firewire-motu: share PCM buffer size for both direction
This commit allows ALSA firewire-motu driver to share PCM buffer size for both capture and playback PCM substream. When AMDTP domain starts for one of the PCM substream, buffer size of the PCM substream is stores to AMDTP domain structure. Some AMDTP streams have already run with the buffer size when another PCM substream starts, therefore the PCM substream has a constraint to its buffer size. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20191017155424.885-9-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/motu-stream.c')
-rw-r--r--sound/firewire/motu/motu-stream.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/firewire/motu/motu-stream.c b/sound/firewire/motu/motu-stream.c
index 97245c670732..9975770c9b1f 100644
--- a/sound/firewire/motu/motu-stream.c
+++ b/sound/firewire/motu/motu-stream.c
@@ -134,7 +134,8 @@ int snd_motu_stream_cache_packet_formats(struct snd_motu *motu)
}
int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate,
- unsigned int frames_per_period)
+ unsigned int frames_per_period,
+ unsigned int frames_per_buffer)
{
unsigned int curr_rate;
int err;
@@ -174,7 +175,7 @@ int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate,
}
err = amdtp_domain_set_events_per_period(&motu->domain,
- frames_per_period, 0);
+ frames_per_period, frames_per_buffer);
if (err < 0) {
fw_iso_resources_free(&motu->tx_resources);
fw_iso_resources_free(&motu->rx_resources);