public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: Takashi Iwai <tiwai@suse.de>, Ingo Molnar <mingo@elte.hu>,
	alsa-devel@alsa-project.org, Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] 2.6.26.[6|7]-rt11, alsa rawmidi, seq hang
Date: Fri, 07 Nov 2008 17:14:44 -0800	[thread overview]
Message-ID: <1226106884.7647.25.camel@localhost.localdomain> (raw)
In-Reply-To: <1226105286.7647.21.camel@localhost.localdomain>

On Fri, 2008-11-07 at 16:48 -0800, Fernando Lopez-Lezcano wrote:
> On Fri, 2008-11-07 at 15:12 -0800, Fernando Lopez-Lezcano wrote:
> > On Fri, 2008-11-07 at 10:12 -0800, Fernando Lopez-Lezcano wrote:
> > > On Fri, 2008-11-07 at 10:12 +0100, Clemens Ladisch wrote:
> > > > Fernando Lopez-Lezcano wrote:
> > > > > I'm seeing a realtime patch related hard hang in the kernel alsa
> > > > > subsystem (MIDI input/output). In a nutshell:
> > > > >
> > > > > - alsa rawmidi works (ie: "rawmidi -v -i hw:0" outputs a stream of
> > > > > messages when pointed to a midi capable card that has an external
> > > > > keyboard connected).
> > > > >
> > > > > - the alsa sequencer interface works (ie: aplaymidi connected to
> > > > > aseqdump transfers data just fine).
> > > > >
> > > > > - BOTH combined do NOT work (ie: use aconnect to connect the port that
> > > > > corresponds to the external midi interface to aseqdump: aseqdump hangs
> > > > > forever after transferring the first message and the only way out is a
> > > > > reboot).
> > > > 
> > > > Please try the snd-virmidi driver, then we'd have a test case that does
> > > > not require MIDI hardware.
> > > > 
> > > > > ... including the output of a "echo t >/proc/sysrq-trigger" that
> > > > > should show where aseqdump currently hangs (or so I think).
> > > > 
> > > > It hangs in tasklet_kill(), which gets called while it tries to close
> > > > the rawmidi port.
> > > > 
> > > > The rawmidi framework uses this tasklet to notify the sequencer that new
> > > > MIDI data is available.  The handler function is
> > > > snd_rawmidi_input_event_tasklet() in sound/core/rawmidi.c; the sequencer
> > > > callback that gets called from there is snd_midi_input_event() in
> > > > core/seq/seq_midi.c.
> > > > 
> > > > You say that the first event gets delivered, so it might be possible
> > > > that the tasklet never finishes executing.  Please check whether the
> > > > call to snd_seq_kernel_client_dispatch() in snd_midi_input_event()
> > > > ever returns.
> > > 
> > > I added a printk before and after the call, it looks like it gets called
> > > and it returns (but only _once_... aseqdump hangs in an unkillable state
> > > as before).
> > 
> > Just in case, the tasklet keeps getting called as long as midi bytes are
> > received. So the tasklet runs once, snd_midi_input_event gets called
> > once and the tasklet keeps running again and again, but nobody runs
> > snd_midi_input_event. Who should?
> 
> I normally use rtirq to tune realtime priorities for realtime kernel
> processes, as I looked around and noticed tasklets seem to be related to
> (or are) software interrupts and those have priorities, so I disabled
> rtirq and rebooted (which leaves the default priority of 50 for all
> realtime kernel processes). 
> 
> Now I get __two__ midi bytes instead of one (active sensing messages
> from the keyboard) and the whole thing stalls as before. 

This is repeatable. 

> ??
> So is this a priority inversion problem?

And for that matter, what _should_ be the priority order of all the
realtime little tasks of rt kernels?? Names have changed and there's a
lot more of those...

(I can readily hang the whole machine if I change the wrong one to a
higher priority!)

Any help appreciated...
-- Fernando



  reply	other threads:[~2008-11-08  1:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-07  0:58 2.6.26.[6|7]-rt11, alsa rawmidi, seq hang Fernando Lopez-Lezcano
2008-11-07  9:12 ` Clemens Ladisch
2008-11-07  9:37   ` Clemens Ladisch
2008-11-07 18:12   ` [alsa-devel] " Fernando Lopez-Lezcano
2008-11-07 18:36     ` Fernando Lopez-Lezcano
2008-11-07 23:12     ` Fernando Lopez-Lezcano
2008-11-08  0:48       ` Fernando Lopez-Lezcano
2008-11-08  1:14         ` Fernando Lopez-Lezcano [this message]
2008-11-13 21:01   ` Fernando Lopez-Lezcano
2008-11-13 22:56     ` [alsa-devel] " Fernando Lopez-Lezcano
2008-11-14  0:12       ` [alsa-devel] 2.6.26.[6|7]-rt11, alsa rawmidi, seq hang (tasklet_hi_schedule?) Fernando Lopez-Lezcano
2008-11-14  8:15         ` Clemens Ladisch
2008-11-14  8:46           ` Takashi Iwai
2008-11-14 18:57           ` Fernando Lopez-Lezcano
2008-11-19 11:44             ` Takashi Iwai
2008-11-27 16:50               ` Takashi Iwai
2008-12-11 11:58                 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226106884.7647.25.camel@localhost.localdomain \
    --to=nando@ccrma.stanford.edu \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox