jack latency correction wierdness

Help for Audacity on GNU/Linux.
Forum rules
ImageThis forum is for Audacity on GNU/Linux.
Please state:
  • which version of Linux you are using,
  • the exact three-section version number of Audacity from Help menu > About Audacity,
  • whether you installed your distribution's release, PPA version, or compiled Audacity from source code.

Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade (see https://www.audacityteam.org/download/).
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
Twhite
Posts: 12
Joined: Tue Apr 14, 2015 4:34 pm
Operating System: Please select

jack latency correction wierdness

Post by Twhite » Tue Apr 14, 2015 5:04 pm

Hi! I am using Audacity version 2.1.0 I have compiled for Fedora and I have found some weirdness when using jack and the latency correction feature in the recording tab of the preferences menu.
I was wondering if anyone could please confirm it?

I am doing a loop back test through a stereo mixer connected using analog stereo interconnects. I import a sound file into audacity and play the sound through jack's system playback ports using audacity and record it back into audacity. That is to say that jack is running, and audacity displays jack audio connection kit as the driver and the recording and output are listed as default and default. Overdub is selected and soft play through is not selected in the preferences menu. The sound file is on track one and I press the record button to record in from the sound card's input port into the second track as the first one plays. The sound records as the second track but it is out of sync (does not line up with the track above.) I then open the preferences menu and change the latency correction to -6 (which is the latency of the jack server as displayed by qjackctl.) I delete the first recorded track and press record again. The audio is recorded in sync.
I then close audacity and import the same file again. I press the record button and the track records out of sync. I then open the preferences dialog and change the -6 to 0. I delete the track I recorded and press record again. The track is recorded in sync.

So in short - the value I set as latency correction in the preferences menu appears not to be used correctly once the application has been closed and then restarted.
Can anyone confirm this please or link to a bug report?

Thanks

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: jack latency correction wierdness

Post by Gale Andrews » Tue Apr 14, 2015 5:23 pm

Twhite wrote:The sound file is on track one and I press the record button to record in from the sound card's input port into the second track as the first one plays. The sound records as the second track but it is out of sync (does not line up with the track above.) I then open the preferences menu and change the latency correction to -6 (which is the latency of the jack server as displayed by qjackctl.) I delete the first recorded track and press record again. The audio is recorded in sync.
I then close audacity and import the same file again. I press the record button and the track records out of sync. I then open the preferences dialog and change the -6 to 0. I delete the track I recorded and press record again. The track is recorded in sync.

So in short - the value I set as latency correction in the preferences menu appears not to be used correctly once the application has been closed and then restarted.
I don't use JACK because I am only a casual Linux user. Steve can test if necessary when he comes along, but it's not an issue I'm aware of.

Is qjackctl still showing -6 latency after restarting Audacity? Do you have to restart qjackctl to get an updated latency value?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Twhite
Posts: 12
Joined: Tue Apr 14, 2015 4:34 pm
Operating System: Please select

Re: jack latency correction wierdness

Post by Twhite » Tue Apr 14, 2015 5:39 pm

Gale Andrews wrote:Is qjackctl still showing -6 latency after restarting Audacity? Do you have to restart qjackctl to get an updated latency value?
6ms of latency is calculated by qjackctl as a result of setting 144 Frames/Period, 2 Periods/Buffer at 48000 sample rate. It's a fixed value which is calculated using those values in qjackctl's preferences menu. It essentially means that using those settings I expect to receive 6ms of latency when using jack unless I change those settings. I am not changing the settings once jack has started. But I wonder if Audacity is doing so?

The only time I am changing any values here in my test case is using audacity. I start jack and do not change any of it's parameters at all during my test.
Hope that makes sense :? Thanks for the reply :)

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: jack latency correction wierdness

Post by steve » Tue Apr 14, 2015 9:45 pm

I've just tested this on my old laptop (on-board Intel sound chip).
Jack is set for a leisurely 17.4 ms.
Using the latency correction (as described here: http://manual.audacityteam.org/o/man/latency_test.html), Audacity's latency correction set to -24.2 ms.
I'm using a stereo click track for the test.

Closed Audacity and restarted. The alignment is exact.

Shut down Audacity and Jack, then restart Jack and restart Audacity. Repeat the test. The alignment is still exact.

I'll try rebooting....
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: jack latency correction wierdness

Post by steve » Tue Apr 14, 2015 9:55 pm

It's still dead on after a reboot - so no I can't confirm the problem

Some things to check:
1) A void pushing the system too hard. 6ms latency is pretty tight even for dedicated hardware.
2) Ensure that you are using the same sample rate throughout.
3) Ensure that you are getting no xruns.
4) Ensure that you use a standard sample rate - if you know what your hardware uses internally, use that (probably 44.1 or 48 kHz).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Twhite
Posts: 12
Joined: Tue Apr 14, 2015 4:34 pm
Operating System: Please select

Re: jack latency correction wierdness

Post by Twhite » Tue Apr 14, 2015 11:30 pm

steve wrote:Ensure that you are using the same sample rate throughout.
this. I was importing a file which was encoded using 44100 sample rate.

Thanks for the help.

Post Reply