Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1297402

Re: [PATCH 1/2] usb: gadget: f_midi: refactor state machine

From Felipe Ferreri Tonello <eu@felipetonello.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] usb: gadget: f_midi: refactor state machine
Date 2015-12-23 13:00 +0100
Message-ID <qIQfg-G2-11@gated-at.bofh.it> (permalink)
References <qIxFE-694-31@gated-at.bofh.it> <qIyLn-6NF-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi Clemens,

On 22/12/15 17:10, Clemens Ladisch wrote:
> Felipe F. Tonello wrote:
>> This refactor includes the following:
>>  * Cleaner state machine code;
> 
> It does not correctly handle system real time messages inserted between
> the status and data bytes of other messages.

True, thanks for pointing that out. I fixed that on next revision of
this patch.

> 
>>  * Reset state if MIDI message parsed is non-conformant;
> 
> Why?  In a byte stream like "C1 C3 44", where the data byte of the first
> message was lost, the reset would also drop the second message.

True. That was fixed as well.

> 
>>  * Fixed bug when a conformant MIDI message was followed by a non-conformant
>>    causing the MIDI-USB message to use old temporary data (port->data[0..1]),
>>    thus packing a wrong MIDI-USB request.
> 
> Running status is feature.

What do you mean by that? I don't qualify writing a *wrong* MIDI-USB
packet because of a previous MIDI message as a feature.

For instance, try this MIDI message:
"8A 54 24 00 40"

It will be converted to MIDI-USB as "08 8A 54 24 08 8A 00 40" which is
wrong. It should only be "08 8A 54 24" and ignore the "00 40" MIDI bytes.

On every state byte the message should basically reset data[0..1] to
zero overwriting previous data. This should also be true when a MIDI-USB
packet is complete.

Felipe

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] usb: gadget: f_midi: refactor state machine "Felipe F. Tonello" <eu@felipetonello.com> - 2015-12-22 17:10 +0100
  Re: [PATCH 1/2] usb: gadget: f_midi: refactor state machine Clemens Ladisch <clemens@ladisch.de> - 2015-12-22 18:20 +0100
    Re: [PATCH 1/2] usb: gadget: f_midi: refactor state machine Felipe Ferreri Tonello <eu@felipetonello.com> - 2015-12-23 13:00 +0100
      Re: [PATCH 1/2] usb: gadget: f_midi: refactor state machine Clemens Ladisch <clemens@ladisch.de> - 2015-12-23 23:00 +0100
  Re: [PATCH 1/2] usb: gadget: f_midi: refactor state machine Felipe Balbi <balbi@ti.com> - 2015-12-22 18:50 +0100
    Re: [PATCH 1/2] usb: gadget: f_midi: refactor state machine Felipe Ferreri Tonello <eu@felipetonello.com> - 2015-12-23 10:30 +0100

csiph-web