Issue with latency

MusE is a DAW for Linux with both MIDI and Audio editing. https://muse-sequencer.github.io

Moderators: MattKingUSA, khz, spamatica

saturnin51
Established Member
Posts: 114
Joined: Sat Mar 02, 2019 5:10 am
Been thanked: 4 times

Issue with latency

Post by saturnin51 »

Hi,

Clouds and rain are very are conducive to use Muse again. My setup:
- HP Prodesk, Intel Core i5-4570 CPU @ 3.20 GHz x 4 with 10 Go RAM and ssd 256 Go
- Edirol UA-25
- keyboard Korg 5000
- Debian V9 64 bits kernel linux 4.90.-9-amd64 x86_64 low latency + Mate
- Librazik studio audio
- Muse 2.1 opr2

I use a headphone directly on the UA-25. I have an echo with audio source (guitar) when I want to record it. The only way to cancel this echo is to mute the output track !

Where I am wrong ?

Thank you for your help.
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Issue with latency

Post by spamatica »

Hi saturnin51

It is a sad state for us that the MusE version in the repositories is so old. If you can please upgrade to 3.x.

The problem with hearing the echo of the guitar can be fixed in more ways in 3.x I believe as the monitoring options are more extensive.

The best way to do it in 2.1 I believe, is to use smaller buffers for Jack. If you haven't specifically set anything I think Jack has a buffersize of 1024 which gives very audible delays. I generally use buffersize 256, sometimes 128.

Can't test right but it should work to mute the audio track instead of the output track. Ofcourse if you rely on hearing the guitar through MusE while recording that won't work.
MusE DAW
saturnin51
Established Member
Posts: 114
Joined: Sat Mar 02, 2019 5:10 am
Been thanked: 4 times

Re: Issue with latency

Post by saturnin51 »

Hi,

I'll try to update to Muse 3. At this time I work like this:

I mute the audio track 1 into the ouput audio track and I record. I hear the guitar with the headphone. Then I unmute this track into the ouptput audio and I record the track 2 hearing well the track 1 while recording. And so on. Finally I unmute all the track into the ouptut audio track to hear the total result.

I use buffersize 256 and less without result. When you think about 1993 Atari Falcon with 16 MHz and no latency at all with Falcon Audio !

Is my PC having too low processor frequency ?
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Issue with latency

Post by spamatica »

saturnin51 wrote:Hi,

I'll try to update to Muse 3. At this time I work like this:

I mute the audio track 1 into the ouput audio track and I record. I hear the guitar with the headphone. Then I unmute this track into the ouptput audio and I record the track 2 hearing well the track 1 while recording. And so on. Finally I unmute all the track into the ouptut audio track to hear the total result.

I use buffersize 256 and less without result. When you think about 1993 Atari Falcon with 16 MHz and no latency at all with Falcon Audio !

Is my PC having too low processor frequency ?
Hehe I didn't know the Atari Falcon was used as a DAW, cool :D
I had to go on a wikipedia trip. I see the Falcon (among other things) had a built in DSP so it had some low level hardware support for doing audio. So it's quite possible it could do recording with very small buffers. Probably not that many realtime effects though.

As for your computer being too slow that is likely not the issue even though it is a slippery slope. A modern computer is a more generic platform compared to the Atari Falcon so it does require more CPU to push the data fast enough for reliable low latency, also USB 1.1 (as used by your soundcard) is not perfect for low latency audio. There are in other words limits to how low you can get the latency with your computer.

Although I can't be sure what you are experiencing I would assume it is only a very short delay you are hearing. But large enough to make it hard to play along with. The soundcard also adds latency besides the buffer size, older cards tend to be a bit slower at doing the AD/DA conversion so at buffersize 256 it can definitely be felt that there is a delay. If your sound card allows it you can try changing to 128 frames buffer for jack.

On a different note, rereading your first message. You describe that you are hearing an echo. This leads me to think that you have direct monitoring turned on in the soundcard. In other words: You hear your guitar through your headphones without even starting jack.
In general direct monitoring is good as it usually does not add latency at all. But you run in to this issue with MusE 2 that you have to mute the track to disable MusE's monitoring. In MusE 3 you can disable the monitoring independently of the tracks mute-status.
So to conclude this thought, another solution would be to turn off direct-monitoring in the sound card and listen through muse all the time (I have done this for many many years, mostly since I wanted to hear the sound WITH plugins etc. through muse). As I said above though it will induce latency in proportion to the buffer size.

Some math regarding latency:
If you are running with 44.1khz and use 256 frames for buffers and jacks default setting of 2 buffers (though your device might require 3, some usb devices do, but if that is the case you probably know about it already)
The latency for one buffer would then be 256/44100 = 5.8ms. Two buffers is then 11.6ms, plus any added latency of the soundcard.
MusE DAW
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: Issue with latency

Post by Tim E. Real »

In recent git master there is full latency correction. Grab it! Enable it in Settings.
It cannot correct for any direct monitoring latency of course (see below). but it corrects playback and recording midi and wave files.
It might be good to enable it when talking about latency issues, to eliminate that possibility of file latency problems.

The monitoring feature Robert mentions is found on the new green circle icon on the mixer strips, beside the red record arm icon.
Its latency is affected by Jack period (buffer) size and numbers.
Meanwhile, low-latency hardware monitoring would be provided by the card and (custom) mixer app.
Perhaps it is turned on? Causing a double path echo instead of just a normal software latency delay alone?

Jack is supposed to have some hardware monitoring feature but I think I read recently that it never really worked well. I've never tried it.
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Issue with latency

Post by spamatica »

Tim E. Real wrote:Causing a double path echo instead of just a normal software latency delay alone?
Yes that was what I was going for in the paragraph I talked about echo. I tried to be as clear as possible but seems I neglected to mention that it was this I meant, that the sound comes from two sources, both from direct monitoring which does not add latency and through muse which adds some latency, causing a very short echo effect.
MusE DAW
saturnin51
Established Member
Posts: 114
Joined: Sat Mar 02, 2019 5:10 am
Been thanked: 4 times

Re: Issue with latency

Post by saturnin51 »

Hi,

I have installed Muse 3 opr1. But the issue is not resolved.

First, I describe the issue as an echo. It is not correct. It is a shift between the sound I hear through the headphone or monitors and the direct sound of the guitar strings.
I mute the monitoring (the icon just left of the record button). No shift. So I launch a record on track 2 over the track 1. I can play very well synchronised during the record But there is a shift when I hear the playback !! The track 2 is slightly delayed behind track 1.

I am very astonished because I recorded project well synchronized between January and March of this year. All the setup remained in the state in the meantime. And more the PC is dedicated for my home studio, nothing else.

To investigate, I'll do tries with Rosegarden and Ardour in the next days.
saturnin51
Established Member
Posts: 114
Joined: Sat Mar 02, 2019 5:10 am
Been thanked: 4 times

Re: Issue with latency

Post by saturnin51 »

I do recording tries with Rosegarden and Qtractor. No problem with the same conditions.
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Issue with latency

Post by spamatica »

saturnin51 wrote:I do recording tries with Rosegarden and Qtractor. No problem with the same conditions.
This is very strange. Was thinking for a minute that it could be due to MusE using pulseaudio instead of jack, which would add a big delay, but that wasn't supported with 2.1.

Could you post the startup log from MusE? Maybe something sticks out.
Also, what are your jack settings?
MusE DAW
saturnin51
Established Member
Posts: 114
Joined: Sat Mar 02, 2019 5:10 am
Been thanked: 4 times

Re: Issue with latency

Post by saturnin51 »

Is it this log ?
Attachments
Muse_log.txt
(30.18 KiB) Downloaded 62 times
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Issue with latency

Post by spamatica »

saturnin51 wrote:Is it this log ?
Yes that was what I meant. Seems it was missing the beginning though.

To capture it all you can pipe it to a file on the command line, like this:
muse3 -whatever_options &> logfile.txt

It would be good if you could redo it.
--
In this one I didn't see anything special apart from instantiations of jack with buffer 1024 but I think that might be output from certain plugins that trigger jack.
Are you starting muse with any options? There was a lot of MidiIn messages which I think are printed with the -m option.
MusE DAW
User avatar
funkmuscle
Established Member
Posts: 2800
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 129 times
Been thanked: 31 times

Re: Issue with latency

Post by funkmuscle »

I don't know if this is my issue but lately, MusE has been lagging. When I try to match a beat with a guitar track in Ardour(using Jack link) MusE is off.
for instance, a kick drum and a cymbal to start a bar along with the synced guitar track(Ardour), the guitar is bang on with the metronome where as MusE will be behind it by a fraction of a second.
I tried syncing Ardour to Qtractor and that's bang on playing the same midi drum file.
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: Issue with latency

Post by Tim E. Real »

1: What Jack period size are you using?
2: Do have the new MusE latency feature enabled?

Will try to investigate...
Thanks.
User avatar
funkmuscle
Established Member
Posts: 2800
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 129 times
Been thanked: 31 times

Re: Issue with latency

Post by funkmuscle »

Tim E. Real wrote:1: What Jack period size are you using?
2: Do have the new MusE latency feature enabled?

Will try to investigate...
Thanks.
Jack 128 but tried 256 and 1024
all the same.

Code: Select all

2: Do have the new MusE latency feature enabled?
what's that and where could I enable it? To be honest, I thought I saw something about that but couldn't find it in the forum.
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: Issue with latency

Post by Tim E. Real »

It's new since a month or two, it is enabled in Settings > Global Settings > Latency.
There's a whole thread and announcement here, a few posts down.

But I've a feeling this may be more related to Jack Transport... Since you're at 128 buf size.
Post Reply