summaryrefslogtreecommitdiff
path: root/sound/firewire/bebob/bebob_stream.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-10-17 18:54:14 +0300
committerTakashi Iwai <tiwai@suse.de>2019-10-18 05:35:43 +0300
commit1fde7a447a7f423b893ac3fcac0ba65893924189 (patch)
treec916ac8d05c7a78f8b897e84f0be1437f88baf5b /sound/firewire/bebob/bebob_stream.c
parenta0e023317e2d55c6b2fbf342c12d8a59797e1cff (diff)
downloadlinux-1fde7a447a7f423b893ac3fcac0ba65893924189.tar.xz
ALSA: bebob: share PCM buffer size for both direction
This commit allows ALSA bebob 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-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/bebob/bebob_stream.c')
-rw-r--r--sound/firewire/bebob/bebob_stream.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
index e8e9eca6f116..5e4a61458be2 100644
--- a/sound/firewire/bebob/bebob_stream.c
+++ b/sound/firewire/bebob/bebob_stream.c
@@ -555,7 +555,8 @@ static int keep_resources(struct snd_bebob *bebob, struct amdtp_stream *stream,
}
int snd_bebob_stream_reserve_duplex(struct snd_bebob *bebob, unsigned int rate,
- unsigned int frames_per_period)
+ unsigned int frames_per_period,
+ unsigned int frames_per_buffer)
{
unsigned int curr_rate;
int err;
@@ -610,7 +611,7 @@ int snd_bebob_stream_reserve_duplex(struct snd_bebob *bebob, unsigned int rate,
}
err = amdtp_domain_set_events_per_period(&bebob->domain,
- frames_per_period, 0);
+ frames_per_period, frames_per_buffer);
if (err < 0) {
cmp_connection_release(&bebob->out_conn);
cmp_connection_release(&bebob->in_conn);