Skip to contentSkip to conversation

snd_mpu401_uart: hang when trying to play .mid

DISCUSSION Domen Puncer 3 participants 9 messages Sep 5, 2004 – Sep 10, 2004

lore
Share & tools
lore
#0 lore raw

Hi.

"hang" here means: not even alt+sysrq+p responds

I tried to play some .mid files with kmid, I wouldn't be suprised if it didn't work, but it *hanged* the computer!

2 messages appeared on console (retyped):
cmd: 0xff failed at 0x20 (status = 0x50, data = 0x0)
cmd: 0x3f failed at 0x20 (status = 0x3f, data = 0x3)

These messages come from mpu401_uart.c:snd_mpu401_uart_cmd It seems like commands MPU401_RESET and MPU401_ENTER_UART fail, but code continues, ignoring that.

At this point it might be clear to alsa developers why/when hang occours, if not I'll provide more data next weekend.

kernel: 2.6.9-rc1-bk7

modules:

snd_trident            42344  1 
snd_util_mem            3904  1 snd_trident
snd_mpu401_uart         7040  1 snd_trident
snd_ens1371            22760  0 
snd_rawmidi            22820  2 snd_mpu401_uart,snd_ens1371
snd_ac97_codec         66064  2 snd_trident,snd_ens1371

(don't have the ens1371 card inside, at the moment)

domen@masina:~/kernel/a$ cat /proc/asound/cards 
0 [SI7018         ]: SI7018 - SiS SI7018
                     SiS SI7018 PCI Audio at 0xd800, irq 11
domen@masina:~/kernel/a$ cat /proc/asound/devices 
  1:       : sequencer
  0: [0- 0]: ctl
  8: [0- 0]: raw midi
 17: [0- 1]: digital audio playback
 16: [0- 0]: digital audio playback
 24: [0- 0]: digital audio capture
 33:       : timer

Domen

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#1 lore raw

At Sun, 5 Sep 2004 11:22:35 +0200,

Quoted 12 lines · Domen Puncer

Hi.

"hang" here means: not even alt+sysrq+p responds

I tried to play some .mid files with kmid, I wouldn't be suprised if it didn't work, but it *hanged* the computer!

2 messages appeared on console (retyped):
cmd: 0xff failed at 0x20 (status = 0x50, data = 0x0)
cmd: 0x3f failed at 0x20 (status = 0x3f, data = 0x3)

Quoted 6 lines

These messages come from mpu401_uart.c:snd_mpu401_uart_cmd It seems like commands MPU401_RESET and MPU401_ENTER_UART fail, but code continues, ignoring that.

At this point it might be clear to alsa developers why/when hang occours, if not I'll provide more data next weekend.

Does your hardware really a MPU401 device?
If not, you can remove the call of snd_mpu401_uart_new() in snd_trident_probe().

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#2 lore raw
Quoted 14 lines · Takashi Iwai

At Sun, 5 Sep 2004 11:22:35 +0200,

Quoted 12 lines · Domen Puncer

Hi.

"hang" here means: not even alt+sysrq+p responds

I tried to play some .mid files with kmid, I wouldn't be suprised if it didn't work, but it *hanged* the computer!

2 messages appeared on console (retyped):
cmd: 0xff failed at 0x20 (status = 0x50, data = 0x0)
cmd: 0x3f failed at 0x20 (status = 0x3f, data = 0x3)

Quoted 8 lines
Quoted 6 lines

These messages come from mpu401_uart.c:snd_mpu401_uart_cmd It seems like commands MPU401_RESET and MPU401_ENTER_UART fail, but code continues, ignoring that.

At this point it might be clear to alsa developers why/when hang occours, if not I'll provide more data next weekend.

Does your hardware really a MPU401 device?

I don't know, probably not.

Quoted 2 lines

If not, you can remove the call of snd_mpu401_uart_new() in snd_trident_probe().

Or just never start kmid again :-)
My point is: user can hang the computer; this is a bug.

Quoted 2 lines

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#3 lore raw

At Mon, 6 Sep 2004 17:48:19 +0200,

Quoted 25 lines · Domen Puncer
Quoted 14 lines · Takashi Iwai

At Sun, 5 Sep 2004 11:22:35 +0200,

Quoted 12 lines · Domen Puncer

Hi.

"hang" here means: not even alt+sysrq+p responds

I tried to play some .mid files with kmid, I wouldn't be suprised if it didn't work, but it *hanged* the computer!

2 messages appeared on console (retyped):
cmd: 0xff failed at 0x20 (status = 0x50, data = 0x0)
cmd: 0x3f failed at 0x20 (status = 0x3f, data = 0x3)

Quoted 8 lines
Quoted 6 lines

These messages come from mpu401_uart.c:snd_mpu401_uart_cmd It seems like commands MPU401_RESET and MPU401_ENTER_UART fail, but code continues, ignoring that.

At this point it might be clear to alsa developers why/when hang occours, if not I'll provide more data next weekend.

Does your hardware really a MPU401 device?

Quoted 7 lines

I don't know, probably not.

Quoted 2 lines

If not, you can remove the call of snd_mpu401_uart_new() in snd_trident_probe().

Or just never start kmid again :-)
My point is: user can hang the computer; this is a bug.

Sure. Removing the unneeded creation of mpu401 interface is _the_ solution if you really don't have mpu401.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#4 lore raw
Quoted 29 lines · Takashi Iwai

At Mon, 6 Sep 2004 17:48:19 +0200,

Quoted 27 lines · Domen Puncer
Quoted 14 lines · Takashi Iwai

At Sun, 5 Sep 2004 11:22:35 +0200,

Quoted 12 lines · Domen Puncer

Hi.

"hang" here means: not even alt+sysrq+p responds

I tried to play some .mid files with kmid, I wouldn't be suprised if it didn't work, but it *hanged* the computer!

2 messages appeared on console (retyped):
cmd: 0xff failed at 0x20 (status = 0x50, data = 0x0)
cmd: 0x3f failed at 0x20 (status = 0x3f, data = 0x3)

Quoted 8 lines
Quoted 6 lines

These messages come from mpu401_uart.c:snd_mpu401_uart_cmd It seems like commands MPU401_RESET and MPU401_ENTER_UART fail, but code continues, ignoring that.

At this point it might be clear to alsa developers why/when hang occours, if not I'll provide more data next weekend.

Does your hardware really a MPU401 device?

I don't know, probably not.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

If not, you can remove the call of snd_mpu401_uart_new() in snd_trident_probe().

Or just never start kmid again :-)
My point is: user can hang the computer; this is a bug.

Sure. Removing the unneeded creation of mpu401 interface is _the_ solution if you really don't have mpu401.

Umm... you mean removing this for linus tree? Then why it was there in the first place?

Quoted 3 lines

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#5 lore raw
Quoted 13 lines · Domen Puncer
Quoted 12 lines · Takashi Iwai

At Mon, 6 Sep 2004 17:48:19 +0200,

Quoted 10 lines · Domen Puncer
Quoted 3 lines · Takashi Iwai

At Sun, 5 Sep 2004 11:22:35 +0200,
Domen Puncer wrote:
Does your hardware really a MPU401 device?

I don't know, probably not.

Quoted 2 lines

If not, you can remove the call of snd_mpu401_uart_new() in snd_trident_probe().

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Or just never start kmid again :-)
My point is: user can hang the computer; this is a bug.

Sure. Removing the unneeded creation of mpu401 interface is _the_ solution if you really don't have mpu401.

Umm... you mean removing this for linus tree? Then why it was there in the first place?

No, Takashi-san is telling you to try commenting this out and recompile and see if the problem goes away. If so then we can figure out how to detect this MPU-less device and fix it in ALSA CVS. He probably does not have access to the hardware to test it himself.

This is a pretty common issue with ALSA because a lot of cards that purport to be the same as another have small differences, and the alsa devs can't possibly test every single device.

Lee

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#6 lore raw

At Mon, 06 Sep 2004 16:18:25 -0400,

Quoted 21 lines · Lee Revell
Quoted 19 lines · Domen Puncer
Quoted 17 lines · Takashi Iwai

At Mon, 6 Sep 2004 17:48:19 +0200,

Quoted 5 lines · Domen Puncer
Quoted 3 lines · Takashi Iwai

At Sun, 5 Sep 2004 11:22:35 +0200,
Domen Puncer wrote:
Does your hardware really a MPU401 device?

Quoted 7 lines

I don't know, probably not.

Quoted 2 lines

If not, you can remove the call of snd_mpu401_uart_new() in snd_trident_probe().

Or just never start kmid again :-)
My point is: user can hang the computer; this is a bug.

Sure. Removing the unneeded creation of mpu401 interface is _the_ solution if you really don't have mpu401.

Quoted 7 lines
Quoted 2 lines

Umm... you mean removing this for linus tree? Then why it was there in the first place?

No, Takashi-san is telling you to try commenting this out and recompile and see if the problem goes away. If so then we can figure out how to detect this MPU-less device and fix it in ALSA CVS. He probably does not have access to the hardware to test it himself.

Exactly. Thanks for interpretation ;)

Quoted 3 lines

This is a pretty common issue with ALSA because a lot of cards that purport to be the same as another have small differences, and the alsa devs can't possibly test every single device.

Yes, indeed, the trident code is shared among several different chips (trident 4D DX, 4D NX and SI7018), and MPU401 handling seems hitting on SI7018 only. I guess SI7018 is equipped mostly on laptops, which unlikely have MPU401 connectors. So, removing the mpu401 support for SI7018 may be the simplest and safest solution.

Of course, we can track down the hang-up point (perhaps in the interrupt handler, snd_mpu401_uart_interrupt()) and fix it, too.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#7 lore raw
Quoted 26 lines · Takashi Iwai

At Mon, 06 Sep 2004 16:18:25 -0400,

Quoted 24 lines · Lee Revell
Quoted 21 lines · Domen Puncer
Quoted 9 lines · Takashi Iwai

At Mon, 6 Sep 2004 17:48:19 +0200,

Quoted 7 lines · Domen Puncer
Quoted 3 lines · Takashi Iwai

At Sun, 5 Sep 2004 11:22:35 +0200,
Domen Puncer wrote:
Does your hardware really a MPU401 device?

I don't know, probably not.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

If not, you can remove the call of snd_mpu401_uart_new() in snd_trident_probe().

Or just never start kmid again :-)
My point is: user can hang the computer; this is a bug.

Sure. Removing the unneeded creation of mpu401 interface is _the_ solution if you really don't have mpu401.

Umm... you mean removing this for linus tree? Then why it was there in the first place?

Quoted 6 lines
Quoted 4 lines

No, Takashi-san is telling you to try commenting this out and recompile and see if the problem goes away. If so then we can figure out how to detect this MPU-less device and fix it in ALSA CVS. He probably does not have access to the hardware to test it himself.

Exactly. Thanks for interpretation ;)

Oh... ok, will try this weekend.

Quoted 9 lines
Quoted 3 lines

This is a pretty common issue with ALSA because a lot of cards that purport to be the same as another have small differences, and the alsa devs can't possibly test every single device.

Yes, indeed, the trident code is shared among several different chips (trident 4D DX, 4D NX and SI7018), and MPU401 handling seems hitting on SI7018 only. I guess SI7018 is equipped mostly on laptops, which unlikely have MPU401 connectors. So, removing the mpu401 support for SI7018 may be the simplest and safest solution.

FWIW, it's not a laptop motherboard in my case. Will look at connectors this weekend.

Quoted 5 lines

Of course, we can track down the hang-up point (perhaps in the interrupt handler, snd_mpu401_uart_interrupt()) and fix it, too.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#8 lore raw
In reply to Takashi Iwai

Found an easier way to reproduce: echo 1 > /dev/midi :-)

Quoted 9 lines · Takashi Iwai

At Mon, 06 Sep 2004 16:18:25 -0400,

Quoted 7 lines · Lee Revell
Quoted 5 lines · Domen Puncer
Quoted 4 lines · Takashi Iwai

At Mon, 6 Sep 2004 17:48:19 +0200,

Quoted 2 lines · Domen Puncer
Quoted 1 line · Takashi Iwai

Does your hardware really a MPU401 device?

It has MIDI/Joystick port.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If not, you can remove the call of snd_mpu401_uart_new() in snd_trident_probe().

This helps.

Quoted 8 lines

Yes, indeed, the trident code is shared among several different chips (trident 4D DX, 4D NX and SI7018), and MPU401 handling seems hitting on SI7018 only. I guess SI7018 is equipped mostly on laptops, which unlikely have MPU401 connectors. So, removing the mpu401 support for SI7018 may be the simplest and safest solution.

Of course, we can track down the hang-up point (perhaps in the interrupt handler, snd_mpu401_uart_interrupt()) and fix it, too.

That would be nice.

I tried nmi_watchdog=1, but it didn't trigger on hang!?

Enabled sound debugging messages, added some printk's and got:

XXX: snd_mpu401_uart_output_open: 269
XXX: snd_mpu401_uart_cmd: 204
ALSA sound/drivers/mpu401/mpu401_uart.c:217: cmd: tx timeout (status = 0x50)
XXX: snd_mpu401_uart_cmd: 236
ALSA sound/drivers/mpu401/mpu401_uart.c:238: cmd: 0xff failed at 0x20 (status = 0xff, data = 0x1)
XXX: snd_mpu401_uart_cmd: 204
ALSA sound/drivers/mpu401/mpu401_uart.c:217: cmd: tx timeout (status = 0xff)
XXX: snd_mpu401_uart_cmd: 236
ALSA sound/drivers/mpu401/mpu401_uart.c:238: cmd: 0x3f failed at 0x20 (status = 0x3f, data = 0x1)
XXX: snd_mpu401_uart_output_trigger: 416
XXX: snd_mpu401_uart_add_timer: 164
XXX: snd_mpu401_uart_add_timer: 175
XXX: snd_mpu401_uart_output_write: 389
XXX: snd_mpu401_uart_remove_timer: 184
XXX: snd_mpu401_uart_remove_timer: 193
double fault, gdt at c1206260 [255 bytes]
NMI Watchdog detected LOCKUP on CPU0, eip c010e3b2, registers:

Modules linked in: ipv6 uhci_hcd ehci_hcd stv680 videodev ohci_hcd snd_trident snd_util_mem snd_mpu401_uart 8139too mii crc32
parport_pc ppdev parport snd_ens1371 snd_rawmidi snd_ac97_codec rtc
CPU:    0
EIP:    0060:[<c010e3b2>]    Not tainted VLI
EFLAGS: 00004002   (2.6.9-rc1-bk7-kjt2)

EIP is at doublefault_fn+0x42/0x110
eax: 0120625f ebx: c1206260 ecx: c041acd8 edx: 0000406e
esi: 00000000 edi: 00000000 ebp: c04fd85c esp: c04fd838
ds: 007b es: 007b ss: 0068

Unable to handle kernel NULL pointer dereference at virtual address 00000068
 printing eip:
c0118ab1
*pde = 00000000
Oops: 0000 [#1]
PREEMPT SMP DEBUG_PAGEALLOC
Modules linked in: ipv6 uhci_hcd ehci_hcd stv680 videodev ohci_hcd snd_trident snd_util_mem snd_mpu401_uart 8139too mii crc32
parport_pc ppdev parport snd_ens1371 snd_rawmidi snd_ac97_codec rtc
CPU:    0
EIP:    0060:[<c0118ab1>]    Not tainted VLI
EFLAGS: 00010017   (2.6.9-rc1-bk7-kjt2)

EIP is at do_page_fault+0x51/0x562
eax: c04ed000 ebx: c04fd000 ecx: 0000007b edx: 00000000
esi: 00000000 edi: c0118a60 ebp: c04ed16c esp: c04ed0cc
ds: 007b es: 007b ss: 0068
Process bash (pid: 3382, threadinfo=c04ec000 task=ca5e0a40)

Stack: 00000000 00000000 00000000 00000068 00000000 00000000 00000000 00030001
       00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
       00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Call Trace:
Stack pointer is garbage, not printing trace
Code: ff 21 e0 81 bd 6c ff ff ff ff ff ff bf 8b 10 c7 85 7c ff ff ff 01 00 03 00 89 95 70 ff ff ff 0f 87 bc 04 00 00 8b 95 70

ff ff ff <8b> 5a 68 8b 50 14 8b 00 81 e2 ff ff ff fb 8b 40 14 f7 d0 c1 e8
<0>Kernel panic - not syncing: Fatal exception in interrupt

-----

Then i removed/added some printk's and got:

XXX: snd_mpu401_uart_output_open: 266
XXX: snd_mpu401_uart_cmd: 202
ALSA sound/drivers/mpu401/mpu401_uart.c:215: cmd: tx timeout (status = 0x50)
ALSA sound/drivers/mpu401/mpu401_uart.c:235: cmd: 0xff failed at 0x20 (status = 0x50, data = 0x0)
XXX: snd_mpu401_uart_cmd: 202
ALSA sound/drivers/mpu401/mpu401_uart.c:215: cmd: tx timeout (status = 0x50)
ALSA sound/drivers/mpu401/mpu401_uart.c:235: cmd: 0x3f failed at 0x20 (status = 0x50, data = 0x0)
XXX: snd_mpu401_uart_output_trigger: 413
XXX: snd_mpu401_uart_add_timer: 164
XXX: snd_mpu401_uart_output_write: 386
XXX: snd_mpu401_uart_timer: 146
XXX: snd_mpu401_uart_timer: 152
XXX: _snd_mpu401_uart_interrupt: 95
ALSA sound/drivers/mpu401/mpu401_uart.c:89: cmd: clear rx timeout (status = 0x50)
XXX: _snd_mpu401_uart_interrupt: 105
XXX: snd_mpu401_uart_output_write: 386
XXX: _snd_mpu401_uart_interrupt: 115
XXX: snd_mpu401_uart_timer: 146
XXX: snd_mpu401_uart_timer: 152
XXX: _snd_mpu401_uart_interrupt: 95
ALSA sound/drivers/mpu401/mpu401_uart.c:89: cmd: clear rx timeout (status = 0x50) (last 7 lines seem to be repeating forever)

-----

Something else i could try?

Domen

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php