Re: [Line6linux-devel] (no subject)
Status: Pre-Alpha
Brought to you by:
mgrabner
From: Andrej K. <de...@an...> - 2013-05-04 11:18:09
|
On Fri, May 3, 2013 at 12:40 AM, Markus Grabner <gr...@ic...>wrote: > On Thursday 02 May 2013 22:51:04 Stefan Hajnoczi wrote: > > On Thu, May 2, 2013 at 7:51 PM, Andrej Kruták <de...@an...> wrote: > > > On Thu, May 2, 2013 at 4:39 PM, Stefan Hajnoczi <ste...@gm...> > > >> Can you explain what you mean regarding volume sent as a float? Do > > >> you have a traffic capture? > > > > > > This is how the frames look like, either incoming or outcoming. > > > > > > OUT: 1C 00 01 00 | 06 00 0A 40 01 03 00 | 15 00 00 00 00 00 00 03 00 > 01 00 > > > 00 00 05 00 10 3F CE 66 33 3F > > > IN: 1C 00 01 00 | 06 00 0A 03 00 40 00 | 15 00 00 00 00 00 00 03 00 > 01 00 > > > 00 00 05 00 10 3F 70 BE 79 3F > > > > > > My guess is that the first 4 bytes is frame header (more frames can be > > > combined into single packet, first byte is frame len - 4). The second > part > > > is the packet header (with type and source/destination flags of some > kind, > > > or so it seems - the 40/03 bytes there). I'm not sure if some part of > the > > > last thing could be a MIDI message - as I said, I don't know too much > in > > > this regard. Anyhow, the last 4 bytes is an IEEE 754 float (seems like > > > it's > > > in big endian). The 05 byte means the volume knob id. > > > > > > So... you said MIDI is extensible - do you think the last part of the > > > above > > > (or last two parts?) could be somehow directly used in the userspace? > > > > The CE and BE bytes indicate this is not part of a MIDI message. MIDI > > data is 7-bit, the top bit must be clear. Therefore this cannot be > > MIDI. > Damn :-( This makes things more complicated in two ways: > > *) My previous proposal to use raw values won't work since not only the > parameter range, but also the data type differs among devices. So a > mapping to > the most expressive data type (float in this case) is desirable. > *) Technically it is possible to map a virtual MIDI device to the USB > interface (just as it is done by the PODxt driver) and then send arbitrary > (not necessarily MIDI-conforming) data to that device. However, this is at > least confusing since such device would be listed among available MIDI > devices > although it doesn't follow the MIDI standard. I tried to use libusb to > directly access the USB interface in user-space code, but this requires to > claim the interface, which is not possible if PCM data is transmitted over > the > interface at the same time by the kernel driver. This raises two questions: > -) Is it possible to access a USB interface by libusb which is currently > claimed by a kernel driver? > -) If MIDI is not appropriate, which other interface can be used by the > kernel > driver as a "link" between the USB interface and user-space code? > Hmm, if it's possible to use arbitrary (number) formats in MIDI, and send some custom data, I'd go this way. To me it makes sense - I would like to be able to change/automate the device's settings by some standard way, and I doubt there's any better standard for this than MIDI. I'll try to figure out the basics of the X3 USB protocol - how to upload/download profiles, and how to set individual knobs (and e.g. input/output ports). All this would be exported via virtual MIDI. The meaning of all the knobs would be up to the userspace, since (as you said), it may change depending on the current settings and requires parsing of the l6f files or whatever. I guess we'll talk once/if I figure it out. I'll have a look on MIDI/SysEx, maybe it will fit somehow? How is the setup of the device "profile" done currently (e.g. changing AMP type) - also via some MIDI command with encoded file attached? The GearBox downloads all the settings from X3 during the start, which are some chunks of data. Also, when AMP type is changed on PC, it seems like the complete profile is uploaded (didn't check the opposite way, maybe it will be simpler). The profiles also are 8-bit (bytes >= 0x80 are present)... We could recode this somehow, to fit it into MIDI (if needed) - or we could export some files into /sys (like profile0...profile32), which would read/write the setting from/to the device. Depends on how it's done now - probably it's not worth rewriting everything (again). BUT. Currently, my device (w/o any intervention) just stopped working even under Windows (gearbox won't talk to it properly, even though I can see USB messages coming from the device like before). I hope it's just some USB cable problem, I'll try it on some other machine, we'll see... This Line6 hardware is very flimsy :-( -- Andrej |