• Welcome to the Pipe Organ Forum! This is a part of the open community Magle International Music Forums focused on pipe organs (also known as "church organs"), organists, organ music and related topics.

    This forum is intended to be a friendly place where technically advanced organists and beginners (or even non-organists) can feel comfortable having discussions and asking questions. We learn by reading and asking questions, and it is hoped that the beginners (or non-organists) will feel free to ask even the simplest questions, and that the more advanced organists will patiently answer these questions. On the other hand, we encourage complex, technical discussions of technique, music, organ-building, etc. The opinions and observations of a diverse group of people from around the world should prove to be interesting and stimulating to all of us.

    As pipe organ discussions can sometimes become lively, it should be pointed out that this is an open forum. Statements made here are the opinion of the poster, and not necessarily that of the forum itself, its administrator, or its moderators.

    In order to post a new topic - or reply to existing ones - you may join and become a member by clicking on Register New User. It's completely free and only requires a working email address (in order to confirm your registration - it will never be given away!). We strive to make this a friendly and informative forum for anyone interested in pipe organs and organ music.

    (Note: If you wish to link to and promote your own website please read this thread first.)

    Many kind regards
    smile.gif

    Frederik Magle
    Administrator

    Krummhorn
    Co-Administrator

Grandorgue on Linux Latency Problem

bwv582

New member
It looked like this was the place to ask GrandOrgue questions...

I recently installed GrandOrgue on a new Lenovo laptop (Core i5, 4GB RAM) running Ubuntu Linux 12.04 64-bit. I'm trying to play it from a Hammond 825 console, but when I press a key, there's about a three second delay before the note sounds. I'm not sure where the bottleneck is. I'm using a Midisport 2x2 MIDI to USB box between the manuals and the computer. Sound server is ALSA using the onboard audio chip. I realize it's probably not the best audio hardware for doing this and maybe ALSA isn't the best choice either, but a three second delay seemed abnormal anyway.

Any ideas on how I can run down this latency issue?
 

e9925248

New member
I would install kmidimon and check, that the MIDI events arrive in time.

GO itself will not produce such delays - even with the worst on board sound cards.
Specific impulse response in the GO reverb engine can also delay the sound - for the moment just make sure, that reverb is disabled.
 

bwv582

New member
I installed kmidimon as suggested. Sure enough, I press a key and the "note on" event doesn't register until about three seconds later. Could the MIDI to USB box be the problem-- or the Linux kernel driver interacting with it? When I press a key, the lights on the converter box blink immediately, suggesting to me that the console keyboards are sending the signal right away, but then it's not getting to the computer quickly enough. Is that a reasonable hypothesis? Any ideas how to fix or troubleshoot this further?
 

bwv582

New member
Well, I think I'm getting closer to a solution. I discovered that there is a Debian package called midisport-firmware. I installed that, and now the latency between the keyboards and the computer seems to be resolved. kmidimon receives an event simultaneus with a keypress and in GrandOrgue, the key on the virtual keyboard highlights as soon as a I press it on the console. But ... now GrandOrgue does not play the note as soon as it shows it highlighted on the screen. So I'm getting latency somewhere in the software now. Even when I press a key with the mouse, it highlights, but does not play immediately. I didn't see that behavior before. So it must be somehow related to the driver/firmware package I installed (?)

Perhaps someone could just share with me a MIDI to USB converter/cable that is known to work with GrandOrgue on Linux. Does anybody know of anything that works out of the box? I'd get rid of the Midisport 2x2 I'm trying to use if I knew of something else that was already proved to work well.
 

L.Palo

New member
Strange with such delays in GrandOrgue! Have you tried different audio device settings and samples/buffer numbers to see what happens? The default settings are very conservative and does introduce some latency...

When it comes to USB and MIDI you can basically trust anything that's class compliant to work in Linux too. I use the umi1x1 from MIDI Gadgets Boutique (they also have a 2x2), but there are much cheaper products available that work fine. On my work I previously used a ESI Midi Mate II that also worked well.

Kind regards

Lars P
 

e9925248

New member
Just to be sure: Reverb in GO is not enabled (or even not pressent in your version)?

So lets first check the audio output subsystem.
Install audacity, load any sound file and try to play it using a device with the same name as in GO (For this test, devices with PA in its GO name should be more audacity likely). Is there also such a latency?
 

bwv582

New member
In the version I'm using, I don't see an option to shut off reverb entirely. I can turn it down to 175ms, but not off. Maybe I'm not looking in the right place?
 

erikds

New member
Well, I think I'm getting closer to a solution. I discovered that there is a Debian package called midisport-firmware. I installed that, and now the latency between the keyboards and the computer seems to be resolved. kmidimon receives an event simultaneus with a keypress and in GrandOrgue, the key on the virtual keyboard highlights as soon as a I press it on the console. But ... now GrandOrgue does not play the note as soon as it shows it highlighted on the screen. So I'm getting latency somewhere in the software now. Even when I press a key with the mouse, it highlights, but does not play immediately. I didn't see that behavior before. So it must be somehow related to the driver/firmware package I installed (?)

Perhaps someone could just share with me a MIDI to USB converter/cable that is known to work with GrandOrgue on Linux. Does anybody know of anything that works out of the box? I'd get rid of the Midisport 2x2 I'm trying to use if I knew of something else that was already proved to work well.

I use the MidiSport 4x4 "old style", i.e. the model before the anniversary edition, on Ubuntu 10.10 using the midisport-firmware package that is provided in the Ubuntu repository. You install this using System/Administration/Synaptic Package Manager.
It has been very reliable all the time.
I have no latency problems using any of the GrandOrgue versions, or any other midi software.
Therefore i doubt it that the root cause of your latency problem is the Midisport 2x2, all be it that this is a different model from the one i use.

Are you sure you installed the right midisport-firmware package for your Midisport 2x2 model and for your Ubuntu 12.04 64 bit platform?
Maybe removing what the .deb package installed and reinstall from Ubuntu's repository gives better results?

All the best.

Erik.
 

bwv582

New member
I have the Midisport 2x2 Anniversary Edition. I don't know if that makes a difference from the one you have. I did install midisport-firmware from the repos, and it definitely improved the original problem I was having of the computer not receiving the signal until three seconds after a keypress. But now even though the keyboard on GO seems to be lighting up as I press the keys on the console, it's just not sounding in time. Anytime I play even a slower scale, the notes sound very sluggishly or not at all even though the keys light up in GO in real time. Most strangely, when I press a key on the GO console using the mouse, it does not sound right away then either. I never saw this behavior before installing the firmware package. So it seems I solved one problem only to create another.

It is the case that I have only been using one MIDI cable (an output) from the Hammond console to GO. Would I need to have a cable running the other way too (an input)? I didn't figure that I would, since I don't really need the computer to communicate back to the organ right now, but maybe that is holding things up because GO is expecting a path back to the console too? I really don't know.

Good to hear that someone is using the Midisport with success, though. There must be something yet in my particular configuration that is wrong. Thanks for everyone who has been helping me with this.
 

L.Palo

New member
Would I need to have a cable running the other way too (an input)?

This should not be necessary.

Do try changing the audio device/backend (try for instance one without the (PA), or if using the PA versions set the desired latency to around 10 ms maximum) and set the samples/buffer to 128 or at most 256. If you're not sure how to do it spend some time to watch my first screencast http://youtu.be/JoF1DxtoS3g. If you still have a very high latency after making those changes you should check that overall audio on your system is working as it should without delays.

Kind regards

Lars P
 

e9925248

New member
In the version I'm using, I don't see an option to shut off reverb entirely. I can turn it down to 175ms, but not off. Maybe I'm not looking in the right place?

This is a different "reverb" control. Newer GOs feature a reverb tab in the Audio settings. So you can't suffer from a configuration bug (reverb enabled with a IR, that causes delays).

So can you please test your audio output with audacity?
 

astazou

New member
I'll put in my 2 cents.
I use time and again a linux rig. Last time, it was Ubuntu 9.10 I believe and GrandOrgue 0.3.0.3 or 0.3.0.4.
Hardware: currently a Dell Latitude E6410 w/ 8 GB of RAM, intel core i7, the one before was a Lenovo T400 w/ 4GB RAM, I don't remember the processor.
All using the onboard sound device.

I've always had bad latency using the Alsa driver, and usually good to very good latency using Jack with and without an external reverb.
You might want to install Jack, set it with realtime capabilities and give it a try.
 

bwv582

New member
Here's the latest on my GO project... First, I tested audio output with audacity and all was normal. No latency issues there when playing an audio file. Then I noticed I was having trouble again with the original three second delay. So it didn't seem the midisport-firmware had loaded correctly after I rebooted the computer. I couldn't figure out how to load it manually with fxload, so I purged the firmware package and reinstalled it. Then in GO I checked on every MIDI device that was detected. I set the samples/buffer to 128 as suggested, then unplugged and replugged the USB connection a couple times trying to coax the firmware driver to load. All of a sudden... it all started working! And GO was playable in real time! It was very nice!

So, I know now that the hardware I have can work. What I don't know exactly is which of my fiddling around got it going. I don't know if I'm going to have to purge and reinstall the device firmware each time or what. Or maybe when I plug in the USB makes a difference. Whatever the right combination of events and settings is, I have a strange feeling that the next time I boot the computer it's not going to work and I'll have to try a similar routine again. But we'll see. At least I've seen now a bit of what GO is capable of and that was exciting.
 

e9925248

New member
I've always had bad latency using the Alsa driver, and usually good to very good latency using Jack with and without an external reverb.
Latency reported by GO or did you notice the latency during playing?

The by GO reported latency is in my option just a number, which must not match the reality. PA based drivers take more care of calculating a better latency value, while RT based just ignore facts, that contribute to the latency. I even know a case of a ASIO driver, which supplied a latency value, which is technically not possible.

Jack connects via ALSA to the sound card. So routing audio via Jack adds latency compared to directly connecting GO to ALSA.
If you are running Jack with a samples per buffer of 1024, you have a worst case latency of at least 40 ms.
 

astazou

New member
Latency reported by GO or did you notice the latency during playing?

Latency while playing.

Jack connects via ALSA to the sound card. So routing audio via Jack adds latency compared to directly connecting GO to ALSA.
If you are running Jack with a samples per buffer of 1024, you have a worst case latency of at least 40 ms.
I don't really remember which version of GO I was using, but I believe it was before the audio settings page allowed to set the number of buffers (r937?)
I don't have time these days to upgrade my external dual boot disk to a reasonably recent Ubuntu and to move to a reasonably recent Linux build, so I can't tell if my ALSA settings vs Jack settings were bad.
 
Top