Skip to content

Commit

Permalink
ALSA: bebob: fix rx packet format for Yamaha GO44/GO46, Terratec Phas…
Browse files Browse the repository at this point in the history
…e 24/x24

commit 6b6c17f upstream.

Below devices reports zero as the number of channels for external output
plug with MIDI type:

 * Yamaha GO44/GO46
 * Terratec Phase 24/X24

As a result, rx packet format is invalid and they generate silent sound.
This is a regression added in v5.13.

This commit fixes the bug, addressed at a commit 1bd1b3b ("ALSA:
bebob: perform sequence replay for media clock recovery").

Cc: <stable@vger.kernel.org>
Fixes: 5c6ea94 ("ALSA: bebob: detect the number of available MIDI ports")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210618040447.113306-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
takaswie authored and gregkh committed Jul 14, 2021
1 parent 146017a commit 4448de6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sound/firewire/bebob/bebob_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,11 @@ static int detect_midi_ports(struct snd_bebob *bebob,
err = avc_bridgeco_get_plug_ch_count(bebob->unit, addr, &ch_count);
if (err < 0)
break;
// Yamaha GO44, GO46, Terratec Phase 24, Phase x24 reports 0 for the number of
// channels in external output plug 3 (MIDI type) even if it has a pair of physical
// MIDI jacks. As a workaround, assume it as one.
if (ch_count == 0)
ch_count = 1;
*midi_ports += ch_count;
}

Expand Down Expand Up @@ -961,12 +966,12 @@ int snd_bebob_stream_discover(struct snd_bebob *bebob)
if (err < 0)
goto end;

err = detect_midi_ports(bebob, bebob->rx_stream_formations, addr, AVC_BRIDGECO_PLUG_DIR_IN,
err = detect_midi_ports(bebob, bebob->tx_stream_formations, addr, AVC_BRIDGECO_PLUG_DIR_IN,
plugs[2], &bebob->midi_input_ports);
if (err < 0)
goto end;

err = detect_midi_ports(bebob, bebob->tx_stream_formations, addr, AVC_BRIDGECO_PLUG_DIR_OUT,
err = detect_midi_ports(bebob, bebob->rx_stream_formations, addr, AVC_BRIDGECO_PLUG_DIR_OUT,
plugs[3], &bebob->midi_output_ports);
if (err < 0)
goto end;
Expand Down

0 comments on commit 4448de6

Please sign in to comment.