Page 1 of 1

Latency

Posted: Thu Jan 02, 2014 5:58 pm
by Veerstryngh Thynner
Greetings all!

To start with -on the second day of 2014 - best wishes for each and every musician frequenting Linux Musicians.

And next I'd like to appeal to all those of you who don't reject offhand a combination of Ubuntu & Windows notation software. Some seem to consider this as sheer blasphemy.

I have an issue with latency here which I don't know how to solve. That is to say: I'm not sure at which end to go in in order to sort it out, in the first place.

My current set-up is as follows:

- PC: IBM Intel (R) Core (TM) i-53740 CPU @ 320 GHz 3.20 GHz;
- RAM: 4 GB
- sound card: Realtek (more chip than sound card, actually, as previously advised);
-operational system: Ubuntu DreamStudio 12:04 LTS, with Windows 7 Professional - as auxiliary - in VirtualBox;
- Audacity is my audio recorder of preference, since I find it extremely user-friendly;
- the musical instrument "hardware" in use: electric ukulele, electric tenor banjo, electric guitar, electric bass, small GEM digital piano (with MIDI IN & OUT).

The only application in Windows VirtualBox is Sibelius (notation software). The general idea now is to use this as a musical instrument generator, as it were, in order to enlarge my musical instrument palette. So if I'd need, say, a clarinet - in addition to banjo, guitar and bass in my Audacity score (I don't play wind instruments) - I simply open Sibelius, choose 'Bb Clarinet' from Instruments and create a single clarinet staff. Even without highlighting the first bar, my MIDI-enhanced digital piano will now act as MIDI controller and produce the clarinet sound desired for my Audacity score. Subsequently, the Sibelius audio thus acquired will just as easily be transferred to my Audacity score - even with Audacity and Sibelius in different workspaces!

I very much believe in simple and functional - especially with respect to audio recording. Often, less is more. And here, it seems, is an excellent way of avoiding all manner of nightmare. It works for me, anyway.

But for one sole thing: latency is truly horrendous (at least 5 seconds between hitting a controller key and the corresponding note being produced) - and I'd need to screw this back, in one way or another. But I can't figure out as to whether it is coming from the Ubuntu end or from Windows'. In other words: since VirtualBox serves as a mere auxiliary of Ubuntu, the problem may just as well derive from Ubuntu (my main platform), for all I know - but I'm not really sure.

How best to get around this? I'd be grateful for any suggestions.

tnob

Re: Latency

Posted: Thu Jan 02, 2014 9:53 pm
by raboof
tnob wrote:best wishes for each and every musician frequenting Linux Musicians.


Warm best wishes to you and everyone else, too!

tnob wrote:And next I'd like to appeal to all those of you who don't reject offhand a combination of Ubuntu & Windows notation software. Some seem to consider this as sheer blasphemy.
(...)
I very much believe in simple and functional - especially with respect to audio recording. Often, less is more.


While I wouldn't reject introducing Windows applications 'offhand', I too am a firm believer in Keeping it Simple. Unless the Windows program you're using does something very unique, running 2 operating systems and trying to integrate them does not seem so 'simple' to me...

tnob wrote:The only application in Windows VirtualBox is Sibelius (notation software). The general idea now is to use this as a musical instrument generator, as it were, in order to enlarge my musical instrument palette. So if I'd need, say, a clarinet - in addition to banjo, guitar and bass in my Audacity score (I don't play wind instruments) - I simply open Sibelius, choose 'Bb Clarinet' from Instruments and create a single clarinet staff. Even without highlighting the first bar, my MIDI-enhanced digital piano will now act as MIDI controller and produce the clarinet sound desired for my Audacity score. Subsequently, the Sibelius audio thus acquired will just as easily be transferred to my Audacity score - even with Audacity and Sibelius in different workspaces!


Are you using Sibelius purely as a "MIDI in / sound out" application here, or do you also use the sequencing ('recording the MIDI events') or notation features?

If just doing 'MIDI in, sound out', something like QSynth with the Fluid R3 soundfont would seem to be a simpler solution. Though most people use QSynth with JACK, if you want to avoid JACK I think it also supports ALSA. Without JACK, I'm not entirely sure what would be the easiest way to get that back into audacity, but that's probably not different from what you're doing with VirtualBox now.

Anyway, probably not really the answer you were looking for, but to me this seems like an easier route compared to getting low-latency audio between linux and virtualbox...

Re: Latency

Posted: Thu Jan 02, 2014 11:49 pm
by AnthonyCFox
The common wisdom is that virtual machines don't work for pro-audio applications because of, specifically, the problem you are having - latency issues. I've never tried it myself, but I have searched for ways to do it on several occasions and the closest I've found is someone that runs two separate boxes, one Linux and the other Windows, but even that requires considerable technical sophistication to pull off.

Musescore, Labrejo, and Rosegarden are native Linux alternatives to Sibelius. Unless you are satisfied with only GM sf2 fonts, in which case you can also try AriaMaestoso and TuxGuitar (it's not just for guitarists!). A quick web search doesn't show anyone successfully running Sibelius in Wine, and I've never seen anyone claim any real success using a virtual machine in pro-audio.

Re: Latency

Posted: Fri Jan 03, 2014 7:14 am
by Thad E Ginathom
There is an expectation that virtualisation will work magic. This is partly because it is a technology that has been sold heavily into commercial situations as working magic. Running three machines? Virtualise two of them and throw away the "unwanted" hardware.

True, my understanding is surface level, but it is that virtualisation works well (and has done for a long time) on systems such as mainframes, that were built for it, hardware and software. PCs were not. It is not efficient on a PC: too much has to be duplicated.

This is not at all to say that it is not useful. It certainly is, for testing new distros, running other OSs experimentally, or when some piece of non-native software has to be used. I run XP in a virtual machine. For my sparse but regular use (a couple of times a month, maybe) it is actually simpler and faster than rebooting.

Bottom level VM audio is that the VM software emulates the lowest-common-denominator sound card on the mother board, which then has to communicate with the audio system in the host PC. The VM software itself is using a substantial proportion of the host PC's resources. It is not a recipe for good things!

Re: Latency

Posted: Fri Jan 03, 2014 7:30 am
by AnthonyCFox
Thad E Ginathom wrote:Bottom level VM audio is that the VM software emulates the lowest-common-denominator sound card on the mother board, which then has to communicate with the audio system in the host PC. The VM software itself is using a substantial proportion of the host PC's resources. It is not a recipe for good things!


I was thinking you might get away with doing pro-audio in a VM if it all took place in the guest machine. But, what's the point in that? Might as well dual-boot.

Re: Latency

Posted: Fri Jan 03, 2014 9:37 am
by khz
Computer && _stable_ MIDI clock is the worst thing!
http://www.innerclocksystems.com/New%20ICS%20Questions.html

Re: Latency

Posted: Sat Jan 04, 2014 10:31 am
by Veerstryngh Thynner
Thanks very much, guys, for your thoughts.

And in reply to Raboof particularly: I'm only interested in "catching" musical instrument audio, as far as Sibelius is concerned, so I go for the simple MIDI in/MIDI out option. Nothing else.

Sibelius musical instrument audio is, in this fashion, indeed what I'm getting back over my headphones. And inserting said musical instrument audio into Audacity shouldn't be a problem either. As explained before: even with Audacity in one workspace and Windows VirtualBox in another (with Sibelius opened within, of course),transferring Sibelius audio to Audacity is easily done. The go-between for this is simply my preamp.

This works - believe it or not. Audacity will record Sibelius input without a hitch, in this manner. The only snag spoiling my joy is this atrocious latency issue I can't get sorted.

I have already been looking at Sonatina Symphony Orchestra, as possible alternative to Sibelius (to keep orchestral sound a bit more 'in the family', as it were). But SSO instruments (individually as well as in ensemble) come across as a bit 'muddy' (to my ear, anyway). And the amount of reverb in SSO is something I definitely don't like.

This very morning, however, I came across Total Composure Symphony Orchestra (4-part introduction on http://www.youtube.com/watch?v=QT-OJYQmDyM). I'm not sure, though, if it's going to work on Ubuntu DreamStudio. Since there was mention of KXStudio, it probably should, I reckon. And it runs on Kontakt sample, if I remember correctly.

TCSO contains really good musical instrument audio. So chances are that this may blow away some of the difficulties I currently have with Sibelius. Anyone familiar with it, I wonder?

If yes, I'd like to learn more about your experiences.

tnob

Re: Latency

Posted: Sat Jan 04, 2014 11:48 am
by nilshi
Why don't you just run everything, Sibelius and Kontakt AND Audacity on the same system? Be it a real windows or a virtual machine one. Then copy the recorded audio tracks .wav files to your main project.

Re: Latency

Posted: Sat Jan 04, 2014 12:52 pm
by Veerstryngh Thynner
An addition in reply to contributions from Raboof, AnthonyCFox and NilsGey:

- Occasionally, Sibelius is also in use for what it was originally intended for: composing and arranging.

Furthermore, most - if not all - of Ubuntu's notation software (although based on Finale/Sibelius) allows only one note at a time inserted or played. Sibelius not - and this opens possibilities for alternative use as 'musical instrument generator', as it were. So a digital piano MIDI controller (with a suitable MIDI interface in-between controller and PC) will almost effortlessly generate any musical instrument audio required; even from a totally empty Sibelius staff.

Via sound out (on computer) and two preamps (one 'intermediary', the other to sound in on computer), Sibelius instrument audio will subsequently be fed into Audacity (Audacity placed in one workspace; VirtualBox in another). In other words: I'm approaching from a totally different angle, namely taking audio as point of departure - not software!

Once again: this seems to work. Apart from the latency issue, that is.

- The whole point of opting for VirtualBox, on my music production unit, is that, in this way, Ubuntu and Windows can be used simultaneously. In a dual boot configuration, it's either the one, or the other - which, most of the time, is not very practical - in my personal experience anyway. And filtering out USB issues in VirtualBox is childishly easy, I discovered.

And so, to allow for more flexibility, I now dispose of 3 units: the main one an Ubuntu/Windows 7 dual boot laptop (Wi-Fi enabled), for internet traffic and much more besides - as well as video capturing (Windows 7). If video capture is in operation (in Windows, so Ubuntu can't be used) and simple administrative tasks (like text processing and so on), in Ubuntu, cannot wait, I'll revert to an ancient Dell desktop. Or - if musical inspiration grabs me - to my music production unit, whilst the laptop is digitalizing VHS.

Hence we're talking of 3 separate systems here: to each specific, circumscribed tasks assigned - 'general' (laptop), 'admin' (Dell), music (studio). If content has to be transferred, a thumbnail or external hard drive will do. Dell and music unit, for instance, don't have functional online connection - so online stuff destined for those has, of necessity, to come from the laptop and passed on!

Thus - following from the above - naturally, all ingredients required for making music are assembled in one and the same box; namely my music production unit. So if installing Kontakt is necassary, in the light of adding a virtual orchestra, of course it will go there - joining Audacity, Sibelius and all the rest. And nowhere else!

tnob