Open ykcirtsyb opened 3 years ago
Hi David,
I've just added a branch with the updates to support your "MIDEX C" with PID 1000. Please see/download it at https://github.com/sgorpi/midex8/tree/new_midex8_pid1000 and let me know if it works! If so then I'll merge the branch to master.
Nice to see the other two devices are working on a Raspberry Pi though :D what's the use-case for so many midi ports?
Best regards, Hedde // Sgorpi
Hi Hedde,
thanks for your work, but unfortunately this does not work. Raspi crashes immediately after connecting "MIDEX C". According to the information from dmesg, a USB device was connected, but there was a problem with snd_usb_midex in the sb_midex_drv_probe function.
Best regards, David
Hi David,
I've added a new commit with an extra nullpointer check, as I noticed in your initial lsusb/dmesg the midex C didn't show it's product name. I hope that resolves the crash... If not, then it'll be very difficult to debug it. Are you in a position to get raw usb logs (with for example wireshark) from a windows machine with official drivers?
I currently have very limited time on my hands due to the corona situation and family, so I can't promise much...
Best, Hedde
Hi Hedde, this is perfect. At this point, the driver recognizes the device and tries to communicate with it, but another problem has appeared.
$ dmesg
///
[531.212818] usb 1-1.3: new full-speed USB device number 3 using ehci-pci
[531.321456] usb 1-1.3: New USB device found, idVendor = 0a4e, idProduct = 1000, bcdDevice = 0.01
[531.321462] usb 1-1.3: New USB device strings: Mfr = 0, Product = 0, SerialNumber = 0
[531.322096] usb 1-1.3: snd-usb-midex: Recognized MIDEX:
[531.322354] usb 1-1.3: snd-usb-midex: usb_submit_urb: -2 at sb_midex_init_device
[531.322361] usb 1-1.3: snd-usb-midex: error during probing
[531.322394] snd-usb-midex: probe of 1-1.3: 1.0 failed with error -2
///
It doesn't like the initialization data? Or something.
As I wrote before, in this type of midex, other connections and different uC are used. This uC does not have a large EEPROM memory with firmware, and according to the first byte in memory, its bootloader waits for data sent from the host.
Connected to the laptop USB port (midex driver not installed)
USB device: 16\ VID: 0x0A4E\ PID: 0x1000
Details
$ dmesg
[ 6034.220641] usb 2-1: new full-speed USB device number 16 using xhci_hcd
[ 6034.369025] usb 2-1: New USB device found, idVendor=0a4e, idProduct=1000, bcdDevice= 0.01
[ 6034.369028] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
root$ cat /sys/kernel/debug/usb/devices
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 16 Spd=12 MxCh= 0
D: Ver= 1.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs= 1
P: Vendor=0a4e ProdID=1000 Rev= 0.01
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 0 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I: If#= 0 Alt= 1 #EPs=13 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=10ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=86(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=06(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=88(I) Atr=01(Isoc) MxPS= 16 Ivl=1ms
E: Ad=08(O) Atr=01(Isoc) MxPS= 16 Ivl=1ms
E: Ad=89(I) Atr=01(Isoc) MxPS= 16 Ivl=1ms
E: Ad=09(O) Atr=01(Isoc) MxPS= 16 Ivl=1ms
E: Ad=8a(I) Atr=01(Isoc) MxPS= 16 Ivl=1ms
E: Ad=0a(O) Atr=01(Isoc) MxPS= 16 Ivl=1ms
I: If#= 0 Alt= 2 #EPs=13 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=10ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=86(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=06(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=88(I) Atr=01(Isoc) MxPS= 256 Ivl=1ms
E: Ad=08(O) Atr=01(Isoc) MxPS= 256 Ivl=1ms
E: Ad=89(I) Atr=01(Isoc) MxPS= 16 Ivl=1ms
E: Ad=09(O) Atr=01(Isoc) MxPS= 16 Ivl=1ms
E: Ad=8a(I) Atr=01(Isoc) MxPS= 16 Ivl=1ms
E: Ad=0a(O) Atr=01(Isoc) MxPS= 16 Ivl=1ms
Connected to VM Win10 (Original Win driver installed)
USB device: 17\ VID: 0x0A4E\ PID: 0x1001
Disconnected from VM -> connected back to the Linux (midex driver installed)
USB device: 17\ VID: 0x0A4E\ PID: 0x1001
$ dmesg
[ 8505.125202] usb 2-1: snd-usb-midex: Recognized MIDEX:
$ amidi -l
Dir Device Name
IO hw:2,0,0 MIDEX Port 1
IO hw:2,0,1 MIDEX Port 2
IO hw:2,0,2 MIDEX Port 3
IO hw:2,0,3 MIDEX Port 4
IO hw:2,0,4 MIDEX Port 5
IO hw:2,0,5 MIDEX Port 6
IO hw:2,0,6 MIDEX Port 7
IO hw:2,0,7 MIDEX Port 8
But without this Linux - Win reconnection it doesn work. So fully initialized device with PID 0x1001 work and empty device with PID 0x1000 not.
I tried to record USB communication with the original Win driver. MIDEX_C.pcapng.zip
Thank you for your time. I try to get into it myself, but these things about USB and kernel modules are completely new to me, so I'm pretty lost in it. But it's a challenge.
If I succeed, I will return the meaning of these three converters and try to connect them to the rest of our studio via RTP MIDI. But this is another chapter.
Best regards, David
Hi David,
Good that it now doesn't crash at least hehe. Thanks for the analysis effort! The problem becomes more clear... I hadn't implemented firmware updates because mine also worked without. But indeed I noticed the windows driver updates firmware and then it lists with pid 1001. This firmware will stay active until a power cycle I believe. Maybe time to implement the firmware update then... Given my current availability that won't be before summer though... Hope you can wait that long...
Best, Hedde
Hi Hedde, If it succeeds, it will be great. For now, I will try to complete my plan with at least two functional converters.
If there's anything else I can do to help you, let me know. I'll try to help as best I can.
Hi Hedde, I found some free time and I managed to find a sequence of data sent by the original Win driver to update the firmware in Midex. fw_data.json.zip
I replicated the process using a Python script and it really works for all three units. After sending the data, it is immediately reported as a new device with PID 1001 for the entire time of connection or power supply.
So I temporarily solved my situation and I have a Python script that checks the newly connected USB devices, if it detects some of the not updated Midex, it sends an FW update. Then the driver recognize them.
It's a mix of a kernel module with a user-space script, but it works. For now, I don't know much about how your module code works, so I don't dare add the FW update there.
Best regards, David
Hi David,
Nice work-around solution!
If you're interested, you're welcome to contribute the python script to this repository, maybe someone else is helped with it until I manage to find time to implement the process in the driver. I'll let you know when I have updated the driver.
Wkr, Hedde
Hello,
I bought a cheap second-hand Steinberg Midex 8 after seeing this driver was available here (thanks Hedde for you work and for sharing it) Unfortunately I ran into the same problem described here, PID 1000...
dmesg: [ 172.741847] usb 1-8: snd-usb-midex: Recognized MIDEX: [ 172.742017] usb 1-8: snd-usb-midex: usb_submit_urb: -2 at sb_midex_init_device [ 172.742021] usb 1-8: snd-usb-midex: error during probing [ 172.742029] snd-usb-midex: probe of 1-8:1.0 failed with error -2
@ykcirtsyb if you care to share your python script I would gladly try and use it for my unit, at least as a workaround solution...
Thanks
Hi @ruigominho you can find my script here.
I originally wrote it just for testing, but in the end it works perfectly for me. So feel free to try and if it helps, I'll be happy.
Hi David,
Thank you very much, it works now!
I will keep an eye on this repository hoping that Hedde finds the time to implement the firmware update feature. I have a programming background but I feel now so rusty/lazy that I would take me eons to get up to shape now :)
Thank you both for your work and for sharing it
Im experiencing the same issue here
For my own convenience I decided to re implement @ykcirtsyb solution in go
as a systemd service
.
If you are interested you can find it here
Obviously all creds go @ykcirtsyb for doing spectacular job on packet capture and original solution
Hi, I have three pieces of MIDEX8 and I try to put them into operation using this driver.
My HW:
My SW:
midex8 Driver
The build of the driver went well with a few warnings, but it is loaded in the kernel and functional.
List of MIDEXs without drivers installed:
MIDEX A + B (A Dev = 8/ B Dev = 9)
MIDEX C
So, as you can see, MIDEX A and B are both same, but MIDEX C is different. It has a slightly different look, but especially there is a different PCB and USB chip inside.
List of MIDEXs with drivers installed:
MIDEX A + B
MIDEX C - does not work. Of course, its ID is not in the module.
Is it possible to add it?
Best regards, David Bystricky