[alsa-devel] MIDI on ice1724 - real-time kernel problem

Pavel Hofman pavel.hofman at insite.cz
Wed Apr 30 22:07:42 CEST 2008

Takashi Iwai wrote:
> At Fri, 25 Apr 2008 09:06:19 +0200,
> Pavel Hofman wrote:
>> Takashi Iwai wrote:
>>>> I do not know the reason for MPU401_INFO_NO_ACK. You removed it from the
>>>> original patch, but without it I always get the input/output error.
>>> Ah, thanks, I overlooked it.
>>> Fixed now.
>> Takashi, thanks, but the patch I sent you sets MPU401_INFO_INPUT and 
>> MPU401_INFO_OUTPUT flags too. They enable the actual input/output 
>> methods in mpu401_uart.c.
> They aren't needed if you create full-duplex streams.
> Could you check whether the latest code still causes any errors?

The code works fine on standard kernel.

But in the RT kernel of Ubuntu 7.10 (2.6.22-14-rt, 1000HZ compared to
250HZ of the -generic kernel), MIDI interrupts get thrown continuously,
hogging CPU with the IRQXX "process".

When playing 44.1kHz audio with buffer size of 32768,
snd_vt1724_interrupt is called every 185ms. With the buffer size of 
4096, it is every 23ms. So far so good.

But when I try to output some midi, the routine gets called every 24us
(i.e. 1000 times faster). Comparing the time difference between my
several debug printk's in snd_vt1724_interrupt (approx. 5us between each
printk record a few lines of code apart) and between each call of the
method (24us), I thought there would be a loop somewhere in the
interrupt handler calling code. But /proc/interrupts really shows over
40k interrupts a second for ICE1724.

Changing the watermarks up to 0x1f makes no difference.

Masking the MIDI interrupts works, snd_vt1724_interrupt is called only
during VT1724_IRQ_MTPCM interrupts, with the MIDI status bits
MPU_TX/MPU_RX set when reading/writing with amidi.

My HW: ancient AMD Duron 900MHz.

The interrupt flood occurs no matter whether the MIDI input is connected 
to my MIDI keyboard or not.

Thanks a lot to anyone for suggestions.


More information about the Alsa-devel mailing list