Bug? Strange crash with snd_hdspm and RME RayDAT on MIDI-input
Hello there,
I've tried to find some insights in a weird problem I have with snd_hdspm. I guess it is an error-report/bug-posting.
Audio-wise everything is super-duper, so don't worry. However... MIDI only works outbound from the on-board MIDI interface.
MIDI-out always works perfectly from the card during normal operations.
Whenever I connect anything to the MIDI-in and start feeding some MIDI-data, it seems ALSA crashes on me. here's a more detailed description:
* I'm running linux-rt 6.0.5.14.realtime1-3-rt #1 SMP PREEMPT_RT (Arch)
* When i give it a stream of MIDI data on the MIDI-in while playing some audio that application (e.g. mplayer or live inputs) logs:
ALSA: poll time out, polled for 1999005 usecs, Retrying with a recovery, retry cnt = 1 (2, 3, 4, 5, and so on)
And ALSA seem stuck in looping the last buffer over and over.
* Nothing in journal, nothing in dmesg tells anything more about it
What did I run in to?! :)
Kind regards, AiO
On Fri, 27 Jan 2023 16:41:42 +0100, AiO wrote:
Hello there,
I've tried to find some insights in a weird problem I have with snd_hdspm. I guess it is an error-report/bug-posting.
Audio-wise everything is super-duper, so don't worry. However... MIDI only works outbound from the on-board MIDI interface.
MIDI-out always works perfectly from the card during normal operations.
Whenever I connect anything to the MIDI-in and start feeding some MIDI-data, it seems ALSA crashes on me. here's a more detailed description:
I'm running linux-rt 6.0.5.14.realtime1-3-rt #1 SMP PREEMPT_RT (Arch)
When i give it a stream of MIDI data on the MIDI-in while playing some audio that application (e.g. mplayer or live inputs) logs:
ALSA: poll time out, polled for 1999005 usecs, Retrying with a recovery, retry cnt = 1 (2, 3, 4, 5, and so on)
And ALSA seem stuck in looping the last buffer over and over.
Nothing in journal, nothing in dmesg tells anything more about it
What did I run in to?! :)
Possibly it went into the endless loop to flush the MIDI input bytes where the hardware doesn't return the right value (likely returning 0xff constantly).
Could you check the patch below?
thanks,
Takashi
-- 8< -- --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -1838,7 +1838,9 @@ static inline int snd_hdspm_midi_output_possible (struct hdspm *hdspm, int id)
static void snd_hdspm_flush_midi_input(struct hdspm *hdspm, int id) { - while (snd_hdspm_midi_input_available (hdspm, id)) + int count; + + for (count = 0; snd_hdspm_midi_input_available(hdspm, id) && count < 256; count++) snd_hdspm_midi_read_byte (hdspm, id); }
Den 2023-01-31 kl. 16:02, skrev Takashi Iwai:
On Fri, 27 Jan 2023 16:41:42 +0100, AiO wrote:
Hello there,
I've tried to find some insights in a weird problem I have with snd_hdspm. I guess it is an error-report/bug-posting.
<snip>
What did I run in to?! :)
Possibly it went into the endless loop to flush the MIDI input bytes where the hardware doesn't return the right value (likely returning 0xff constantly).
Could you check the patch below?
thanks,
Takashi
-- 8< -- --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -1838,7 +1838,9 @@ static inline int snd_hdspm_midi_output_possible (struct hdspm *hdspm, int id)
static void snd_hdspm_flush_midi_input(struct hdspm *hdspm, int id) {
- while (snd_hdspm_midi_input_available (hdspm, id))
- int count;
- for (count = 0; snd_hdspm_midi_input_available(hdspm, id) && count < 256; count++) snd_hdspm_midi_read_byte (hdspm, id); }
Hi again! Thank you for your fast reply. Despite it was like 20 years since i built a Linux-kernel, i compiled a kernel (not linux-rt tho) with this applied, sadly it still seems like it crashes on me like before... (If i got everything right :D )
It seems I receive "seldom occurring events", but if i am a bit more brutal, feeding events faster (randomly banging on a MIDI keyboard e.g.) it hangs.
I did also create an issue in GitHub on this about the same time wrote to the list:
https://github.com/alsa-project/alsa-lib/issues/297
How to go forward?
participants (3)
-
AiO
-
Joakim Ekblad
-
Takashi Iwai