From: Takashi Iwai Subject: Re: snd_usb_caiaq bug? Date: Wed, 07 Jan 2009 17:35:17 +0100 Message-ID: References: <31e66c9e0901040829y4bedc1ebgcf91afe10d80341a@mail.gmail.com> <31e66c9e0901070741i2f6f363l9dc023223954ce2@mail.gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 0FFDE243CC for ; Wed, 7 Jan 2009 17:35:18 +0100 (CET) In-Reply-To: <31e66c9e0901070741i2f6f363l9dc023223954ce2@mail.gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Marco Santamaria Cc: alsa-devel@alsa-project.org, Daniel Mack List-Id: alsa-devel@alsa-project.org At Wed, 7 Jan 2009 16:41:21 +0100, Marco Santamaria wrote: > > I applied the patch (or I think so...). I just removed the line: > > dev->midi_out_substream = NULL; > > from the function snd_usb_caiaq_midi_output_done in the file caiaq-midi.c. > Then I recompiled the driver. > > The main issue is sorted out: I can start and shut down jackd without big > problems. > > But with dmesg I still have the following message: > > ALSA /home/marco/build/linux-2.6.24-19-rt/alsa-1.0.17/driver-patched/ > alsa-driver-1.0.17/acore/rawmidi.c:196: rawmidi drain error (avail = 4095, > buffer_size = 4096) > > Not sure if it is safe to ignore it. Hmm, what about the patch below? Takashi --- diff --git a/sound/usb/caiaq/caiaq-midi.c b/sound/usb/caiaq/caiaq-midi.c index 30b57f9..9557635 100644 --- a/sound/usb/caiaq/caiaq-midi.c +++ b/sound/usb/caiaq/caiaq-midi.c @@ -69,7 +69,8 @@ static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *dev, dev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; dev->midi_out_buf[1] = 0; /* port */ - len = snd_rawmidi_transmit_peek(substream, dev->midi_out_buf+3, EP1_BUFSIZE-3); + len = snd_rawmidi_transmit(substream, dev->midi_out_buf + 3, + EP1_BUFSIZE - 3); if (len <= 0) return; @@ -87,16 +88,12 @@ static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *subs { struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; - if (dev->midi_out_substream != NULL) - return; - - if (!up) { + if (up) { + dev->midi_out_substream = substream; + snd_usb_caiaq_midi_send(dev, substream); + } else { dev->midi_out_substream = NULL; - return; } - - dev->midi_out_substream = substream; - snd_usb_caiaq_midi_send(dev, substream); } @@ -169,8 +166,6 @@ void snd_usb_caiaq_midi_output_done(struct urb* urb) if (!dev->midi_out_substream) return; - snd_rawmidi_transmit_ack(dev->midi_out_substream, buf[2]); - dev->midi_out_substream = NULL; snd_usb_caiaq_midi_send(dev, dev->midi_out_substream); }