|
Takashi Iwai |
6beb75 |
From d2b6f15bc18ac8fbce25398290774c21f5b2cd44 Mon Sep 17 00:00:00 2001
|
|
Takashi Iwai |
6beb75 |
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
|
|
Takashi Iwai |
6beb75 |
Date: Sun, 21 Mar 2021 12:28:31 +0900
|
|
Takashi Iwai |
6beb75 |
Subject: [PATCH] ALSA: bebob: enable to deliver MIDI messages for multiple ports
|
|
Takashi Iwai |
6beb75 |
Git-commit: d2b6f15bc18ac8fbce25398290774c21f5b2cd44
|
|
Takashi Iwai |
6beb75 |
Patch-mainline: v5.13-rc1
|
|
Takashi Iwai |
6beb75 |
References: git-fixes
|
|
Takashi Iwai |
6beb75 |
|
|
Takashi Iwai |
6beb75 |
Current implementation of bebob driver doesn't correctly handle the case
|
|
Takashi Iwai |
6beb75 |
that the device has multiple MIDI ports. The cause is the number of MIDI
|
|
Takashi Iwai |
6beb75 |
conformant data channels is passed to AM824 data block processing layer.
|
|
Takashi Iwai |
6beb75 |
|
|
Takashi Iwai |
6beb75 |
This commit fixes the bug.
|
|
Takashi Iwai |
6beb75 |
|
|
Takashi Iwai |
6beb75 |
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
|
|
Takashi Iwai |
6beb75 |
Link: https://lore.kernel.org/r/20210321032831.340278-4-o-takashi@sakamocchi.jp
|
|
Takashi Iwai |
6beb75 |
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
Takashi Iwai |
6beb75 |
|
|
Takashi Iwai |
6beb75 |
---
|
|
Takashi Iwai |
6beb75 |
sound/firewire/bebob/bebob_stream.c | 12 +++++++-----
|
|
Takashi Iwai |
6beb75 |
1 file changed, 7 insertions(+), 5 deletions(-)
|
|
Takashi Iwai |
6beb75 |
|
|
Takashi Iwai |
6beb75 |
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
|
|
Takashi Iwai |
6beb75 |
index 23579a73e038..b612ee3e33b6 100644
|
|
Takashi Iwai |
6beb75 |
--- a/sound/firewire/bebob/bebob_stream.c
|
|
Takashi Iwai |
6beb75 |
+++ b/sound/firewire/bebob/bebob_stream.c
|
|
Takashi Iwai |
6beb75 |
@@ -517,20 +517,22 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob)
|
|
Takashi Iwai |
6beb75 |
static int keep_resources(struct snd_bebob *bebob, struct amdtp_stream *stream,
|
|
Takashi Iwai |
6beb75 |
unsigned int rate, unsigned int index)
|
|
Takashi Iwai |
6beb75 |
{
|
|
Takashi Iwai |
6beb75 |
- struct snd_bebob_stream_formation *formation;
|
|
Takashi Iwai |
6beb75 |
+ unsigned int pcm_channels;
|
|
Takashi Iwai |
6beb75 |
+ unsigned int midi_ports;
|
|
Takashi Iwai |
6beb75 |
struct cmp_connection *conn;
|
|
Takashi Iwai |
6beb75 |
int err;
|
|
Takashi Iwai |
6beb75 |
|
|
Takashi Iwai |
6beb75 |
if (stream == &bebob->tx_stream) {
|
|
Takashi Iwai |
6beb75 |
- formation = bebob->tx_stream_formations + index;
|
|
Takashi Iwai |
6beb75 |
+ pcm_channels = bebob->tx_stream_formations[index].pcm;
|
|
Takashi Iwai |
6beb75 |
+ midi_ports = bebob->midi_input_ports;
|
|
Takashi Iwai |
6beb75 |
conn = &bebob->out_conn;
|
|
Takashi Iwai |
6beb75 |
} else {
|
|
Takashi Iwai |
6beb75 |
- formation = bebob->rx_stream_formations + index;
|
|
Takashi Iwai |
6beb75 |
+ pcm_channels = bebob->rx_stream_formations[index].pcm;
|
|
Takashi Iwai |
6beb75 |
+ midi_ports = bebob->midi_output_ports;
|
|
Takashi Iwai |
6beb75 |
conn = &bebob->in_conn;
|
|
Takashi Iwai |
6beb75 |
}
|
|
Takashi Iwai |
6beb75 |
|
|
Takashi Iwai |
6beb75 |
- err = amdtp_am824_set_parameters(stream, rate, formation->pcm,
|
|
Takashi Iwai |
6beb75 |
- formation->midi, false);
|
|
Takashi Iwai |
6beb75 |
+ err = amdtp_am824_set_parameters(stream, rate, pcm_channels, midi_ports, false);
|
|
Takashi Iwai |
6beb75 |
if (err < 0)
|
|
Takashi Iwai |
6beb75 |
return err;
|
|
Takashi Iwai |
6beb75 |
|
|
Takashi Iwai |
6beb75 |
--
|
|
Takashi Iwai |
6beb75 |
2.26.2
|
|
Takashi Iwai |
6beb75 |
|