FrankBuss / kerberos

C64/C128 MIDI flash interface
73 stars 17 forks source link

Kerberos App for Linux #1

Open FrankBuss opened 9 years ago

FrankBuss commented 9 years ago

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

meonwax commented 9 years ago

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.

igorangst commented 9 years ago

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

good news:

bad news:

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.

igorangst commented 9 years ago

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.

meonwax commented 9 years ago

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.

igorangst commented 9 years ago

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.

FrankBuss commented 9 years ago

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.

igorangst commented 9 years ago

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.

igorangst commented 9 years ago

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.

meonwax commented 9 years ago

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%.

igorangst commented 9 years ago

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.

meonwax commented 9 years ago

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 _gsenddelay 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.

meonwax commented 9 years ago

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

igorangst commented 9 years ago

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

FrankBuss commented 9 years ago

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

meonwax commented 9 years ago

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