Page 1 of 1

MidiLink REALLY wants to use USB serial

Posted: Mon Feb 22, 2021 9:39 pm
by hernan43
I have a Roland UM-ONE USB MIIDI adapter that has worked great for me for a long time now. However recently it stopped working. I thought maybe it had died, but hooking it up to another computer shows it is working fine.

Tooling around on the command line I noticed that MidiLink is trying to use serial USB instead of the Roland interface. There is this file: /tmp/ML_SERMIDI that seems to force USB serial. If I delete that file, MIDI stuff starts working again. I don't even have to restart MidiLink, it just works fine after that.

The issue is that that file comes back every time I turn the Mister back on. I'd like to say it "just stopped working" but I had not tried the MIDI stuff in 2-3 weeks so maybe something happened within that time that crunked it.

I have the ao486 core set to:

UART mode(MIDI)
Connection: MIDI
MidiLink: USB
Baud: 31250

The only issue seems to be that file mucking up the works. I trash it and everything works fine as usual. Any ideas? Has anyone come across this before? Searching the forums for "ML_SERMIDI" yields nothing.

EDIT

I did a little bit more investigation and it looks like the ML_SERMIDI file doesn't get created until ao486 is started.

EDIT #2

If I run "midilink" with no arguments while the core is running, MIDI works fine.

If I run "midilink MENU QUIET" like the core seems to do I get:
/root# midilink MENU QUIET
midilink: /lib/libasound.so.2: no version information available (required by midilink)
MiSTer MidiLink 3.3 BB7
CORE --> 'AO486'
Checking for --> '/media/fat/linux/MidiLink.INI' : TRUE
Settings:
- MIDILINK_PRIORITY --> -20
- MUNT_OPTIONS --> ''
- MUNT_ROM_PATH --> '/media/fat/linux/mt32-rom-data'
- MP3_VOLUME --> Default (don't set)
- MUNT_VOLUME --> Default (don't set)
- MUNT_CPU_MASK --> 1
- FSYNTH_CPU_MASK --> 1
- FSYNTH_VOLUME --> Default (don't set)
- MODEM_VOLUME --> Default (don't set)
- MIXER_CONTROL --> Master
- FSYNTH_SOUNTFONT --> '/media/fat/linux/soundfonts/SC-55.sf2'
- UDP_SERVER --> '192.168.1.130'
- UDP_SERVER_PORT --> 1999
- UDP_BAUD --> 38400
- UDP_BAUD_ALT --> Undefined
- MIDI_BAUD --> 31250
- UDP_SERVER_FILTER --> FALSE
- UDP_FLOW --> (0) Diasble Flow-control
- TCP_BAUD --> Default (don't change)
- TCP_BAUD_ALT --> Default (don't change)
- MIDI_BAUD --> 31250
- UDP_SERVER_FILTER --> FALSE
- UDP_FLOW --> (0) Diasble Flow-control
- TCP_BAUD --> Default (don't change)
- TCP_BAUD_ALT --> Default (don't change)
- TCP_DTR --> (1) Normal
- TCP_QUIET --> (0) Normal
- TCP_FLOW --> (3) RTS/CTS
- TCP_ATH_DELAY --> 900
- TCP_SERVER_PORT --> 23
- TCP_TERM_ROWS --> 23
- TCP_TERM_UPLOAD --> '/media/fat/UPLOAD'
- TCP_TERM_DOWNLOAD --> '/media/fat'
- TCP_TERM_MP3 --> '/media/fat/MP3'
- TCP_TERM_MIDI --> '/media/fat/MIDI'
- TCP_TERM_SYNTH --> FluidSynth
- TCP_TERM_TRANS --> NONE
- TCP_SOUND --> TRUE
- TCP_SOUND_DIAL --> Software
- TCP_SOUND_RING --> Software
- TCP_SOUND_CONNECT --> Software
- USB_SERIAL_BAUD --> Default (don't change)
- USB_SERIAL_MODULE --> ''
- DELAYSYSEX --> TRUE
- MT32_LCD_MSG --> 'MiSTer MidiLink! BB7'

Setting task priority --> -20
Checking for --> '/tmp/ML_MUNT' : FALSE
Checking for --> '/tmp/ML_MUNTGM' : FALSE
Checking for --> '/tmp/ML_FSYNTH' : FALSE
Checking for --> '/tmp/ML_UDP' : FALSE
Checking for --> '/tmp/ML_TCP' : FALSE
Checking for --> '/tmp/ML_UDP_ALT' : FALSE
Checking for --> '/tmp/ML_TCP_ALT' : FALSE
Checking for --> '/tmp/ML_USBMIDI' : FALSE
Checking for --> '/tmp/ML_SERMIDI' : TRUE
Checking for --> '/tmp/ML_USBSER' : FALSE
Killing --> mpg123
Killing --> aplaymidi
Killing --> fluidsynth
Killing --> mt32d
Got BAUD from MENU --> 31250
Setting /dev/ttyS1 to 31250 baud.
Checking for --> '/dev/ttyUSB0' : FALSE
ERROR: You have no '/dev/ttyUSB0' device! --> maybe set 'USB_SERIAL_MODULE = ' in '/media/fat/linux/MidiLink.INI'?

Re: MidiLink REALLY wants to use USB serial

Posted: Tue Feb 23, 2021 1:22 am
by patamar4
I have the same problem, it's been a long time since I didn't use the core ao486 and now it's no longer working using my SC-55 module

Re: MidiLink REALLY wants to use USB serial

Posted: Tue Feb 23, 2021 2:20 am
by hernan43
It’s like the MidiLink program is not reading the Menu settings.

Glad to know I’m not crazy.

Re: MidiLink REALLY wants to use USB serial

Posted: Tue Feb 23, 2021 2:26 am
by bbond007
Sorry, did not catch this in testing :(

I put in a PR for the fix --> https://github.com/MiSTer-devel/Main_Mi ... a199daec4b



Also please make sure you have run this update -->
https://misterfpga.org/viewtopic.php?p=17936#p17936

Re: MidiLink REALLY wants to use USB serial

Posted: Tue Feb 23, 2021 5:12 am
by ryanvb
I decided this morning to play some Space Quest 1 VGA and use my real MT32 for good measure. 8 hours of hair-pulling later, I discovered this exact same problem and found the exact same solution (manually deleting /tmp/ML_SERMIDI and manually creating /tmp/ML_USBMIDI). I've got to tell you it feels so good to realize I'm not alone!

Another tip, SQ1 requires me to set the CPU speed to 15mhz to not get checksum errors on my MT-32. Does anyone know a better solution to this? 15mhz is definitely on the slower side than I'd like to use.

Re: MidiLink REALLY wants to use USB serial

Posted: Tue Feb 23, 2021 1:37 pm
by hernan43
bbond007 wrote: Tue Feb 23, 2021 2:26 am Sorry, did not catch this in testing :(

I put in a PR for the fix --> https://github.com/MiSTer-devel/Main_Mi ... a199daec4b

MiSTer.zip

Also please make sure you have run this update -->
https://misterfpga.org/viewtopic.php?p=17936#p17936
If this forum software let me "thank" you a 1000 times I would. Thank you for your hard work.

Re: MidiLink REALLY wants to use USB serial

Posted: Tue Feb 23, 2021 5:58 pm
by bbond007
ryanvb wrote: Tue Feb 23, 2021 5:12 am Another tip, SQ1 requires me to set the CPU speed to 15mhz to not get checksum errors on my MT-32. Does anyone know a better solution to this? 15mhz is definitely on the slower side than I'd like to use.
There are three solutions to buffer overflow on Rev0 MT-32:
  • Run at slower speed - as you discovered
  • Use SoftMPU with /DELAYSYSEX switch
  • Put "DELAYSYSEX = TRUE" in MidiLinl.INI

Re: MidiLink REALLY wants to use USB serial

Posted: Wed Feb 24, 2021 2:28 am
by ryanvb
After many more hours of testing today, here’s what worked for me for perfect MT-32 playback on Space Quest 1 and 4 (and possibly other Sierra games of that generation). This balances game performance with perfect music performance, with no buffer errors or checksum errors:

Performance settings:

56 or 90mhz CPU (30mhz gets stuttering in game, 90mhz may make animations a bit faster than acceptable so 56mhz is probably a good middle ground)
L1 cache off
L2 cache on

Only the L2 cache can be enabled, otherwise the game runs too fast and generates buffer overflows and / or checksum errors on the MT32.

Config Settings:

DELAYSYSEX FALSE in MidiLink.ini. If it’s TRUE then music starts playing late, after the Sierra logo has displayed for a while. So there’s no need to have MidiLink slow down the transmission, disabling L1 cache already seems to do that well enough.

EMM386 MUST be enabled. With just HIMEM, the MT32 checksum error occurs at startup of both SQ1 and SQ4 (regardless of whether DELAYSYSEX is set in SoftMPU or MidiLink.INI, unfortunately).

Notes:

I'm using the official Roland UM-ONE mk2 USB cable from my Mister to a first-gen MT-32. I'm using the software from the Top 300 DOS games pack.

Re: MidiLink REALLY wants to use USB serial

Posted: Wed Feb 24, 2021 3:57 am
by patamar4
bbond007 wrote: Tue Feb 23, 2021 2:26 am Sorry, did not catch this in testing :(

I put in a PR for the fix --> https://github.com/MiSTer-devel/Main_Mi ... a199daec4b

MiSTer.zip

Also please make sure you have run this update -->
https://misterfpga.org/viewtopic.php?p=17936#p17936
I tested and at least with me remains the same problem :|

Re: MidiLink REALLY wants to use USB serial

Posted: Wed Feb 24, 2021 4:00 pm
by hernan43
Roland UM-ONE is working again after today's MiSTer update. Thanks again bbond007!

Re: MidiLink REALMENTE quer usar série USB

Posted: Wed Feb 24, 2021 11:24 pm
by patamar4
Yes, now working again, thanks bbond007 :D