FrankBuss/kerberos

Kerberos App for Linux

Opened this issue · 15 comments

Feature request to compile the Kerberos App for Linux. would be best to bundle the Qt libraries, or static link. Someone started already, see this branch: https://github.com/igorangst/kerberos/tree/linux-build

The file name of the binary should also differ in the Linux version.
I think kerberos.bin would be ok, since there is already a folder called kerberos.
The Windows binary should be then called kerberos.exe
Everything is configured in kerberos.pro.

OK, I have received the hardware (thanks for the fast shipping!). This is the current status with the linux build:

good news:

  • It compiles and links with libasound, the ALSA library, which is readily supported by RtMidi.
  • The app starts up and I can connect to the cartridge (I use an M-AUDIO MIDISPORT 2x2 USB interface)
  • Playing over MIDI works fine (e.g. with cynthcart)
  • In transfer mode, I managed to download a disc image from the cartridge to PC

bad news:

  • Uploading programs (.prg) to the cartidge does not work, it stops (deterministically) in the middle of the transfer and blocks. Restarting the transfer results in "checksum error" on commodore side.

At this time, I have no idea how to debug this, since the problem could be anywhere between the application, the midi driver, my OS, the MIDI interface, the cables, the cartridge or my C64. If anyone could try to build the app for linux to test is, this would certainly help.

As for the release question:

A static build might be convenient for the users, however qt5 is not shipped with static libraries per default. This means that whoever wants to build the software will need to build qt5 from sources beforehand.

So for now I will try the LD_LIBRARY_PATH option and see if can produce a portable build.

As soon as i will receive my USB2MIDI adapter, i will also test this. The qt application compiles successfully here.

Do you have a Windows installation? You could test the uploading mechanism here and if it succeeds, the problem as to be found within the linux build.

I tried the windows version on another laptop and there everything works fine, using the same USB interface. At least this confirms that there might be an issue with the Linux MIDI system. It seems like the transfer loses sync after some time, at different percentages of the transfer for different files, but reproducable.

This sounds interesting, maybe some kind of EOF or escape character problem, which is not transferred, because of binary/ASCII file mode problems? I don't have a native Linux here and have problems to use the USB MIDI adapter in Oracle Virtual Box, but maybe you can output the MIDI data for a PRG upload to a file (you need to change sendNoteOff, only) and then try to send it with the "cat" command to the MIDI dev, to eliminate the Qt app as the source of the problem. And if you have two Linux systems, you could receive it from the dev device on another system and compare the files, to eliminate the Kerberos cartridge as the source of the problem. With such a file, debugging for the ALSA developers would be easier, too.

I found a first fix for the transfer problems: It turned out that ALSA dropped parts of the MIDI data when too many stuff was coming in too fast. A quick and dirty workaround is to insert a short delay after each byte in order to artificially slow down the MIDI traffic. At this time, it works for me. I do not know if this is a general problem with ALSA or with RtMidi or maybe only with my setup. It does not seem to be related to the USB interface though, since redirecting the MIDI traffic to a file does also result in message drops. So someone else needs to figure out if my version works for them. So far, I am happy with the result, even if the fix is not very satisfactory.

Build script added. Somebody please test it. Libraries are installed in the release directory (kerberos/lib), a startup script is created that sets LD_LIBRARY_PATH. I do not know if I missed some libraries, I basically chose the one that are in the windows build.

Today i finnaly found the time to test your changes.
I compiled the kerberos app using your buildscript and just fired up kerberos.bin.
Tada - uploading works like a charm.
Then i commented out your delay call and same here - checksum error at 7%.

Thanks for testing, meonwax! I will send a pull request as soon as I have figured out if the changes are consistent with FrankBuss's latest commits.

Today i tried to flash an Easy Flash image on my cartridge. I got checksum errors all the way. The same happened on a Windows 7 box from a friend with same catridge but different C64 and MIDI setup.

I increased the g_senddelay value to 1000ms and recompiled. The following transfer took quite a long time (at least the image is approx. 1 MB), but it was transfered and flashed successfully this way.

Perhaps the QT application should get a spinner for configuring this delay for every flash.
It seems that this will also be a benefit for some Windows setups.

Any news on this?
@igorangst: already sent a pull request?

Sorry, I was becoming a father in the meantime :-) I just sent the pull request to Frank. Have fun!

Thanks, will try to create a new release next weekend.

@igorangst: Congrats and thank you!
@FrankBuss: Thanks you, looking forward.