Adjustable headphone latency

Bug #225966 reported by Albert Santoni
4
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Wishlist
Daniel Schürmann

Bug Description

As suggested by Pieter Palmers:

feature request: add variable delay to the headphones output and express it in meters, not samples
allow the latency of the headphones path to be matched with the monitor or even the main FOH

This would be useful because if you don't have a pair of monitors and you're playing at a big club, you'll still be able to beatmatch with your headphones + the club speakers...

Albert Santoni (gamegod)
Changed in mixxx:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

For reference, the speed of sound is 343 m/s or (1125 ft/s) according to Wikipedia: http://en.wikipedia.org/wiki/Speed_of_sound

So the formula to be implemented is: delay value = distance to compensate in meters (or feet) / 343 (or 1125)

This should be trivial to implement, no?

Revision history for this message
Albert Santoni (gamegod) wrote : RE: [Bug 225966] Re: Adjustable headphone latency

>From: Pegasus <email address hidden>
>Reply-To: Bug 225966 <email address hidden>
>To: <email address hidden>
>Subject: [Bug 225966] Re: Adjustable headphone latency
>Date: Fri, 07 Nov 2008 16:43:03 -0000
>
>For reference, the speed of sound is 343 m/s or (1125 ft/s) according to
>Wikipedia: http://en.wikipedia.org/wiki/Speed_of_sound
>
>So the formula to be implemented is: delay value = distance to
>compensate in meters (or feet) / 343 (or 1125)
>
>This should be trivial to implement, no?
>

Adam and I are physicists, so it's not the math that's the problem.
Implementing a GUI and all that other overhead is the hard part, and right
now we've higher priority tasks that we're working on. :)

This might be a fun task for someone who's new to the codebase though...

Revision history for this message
Owen Williams (ywwg) wrote :

Is this bug still up for grabs? I had a situation recently where this feature would have been useful, and creating a delaying sound buffer should be relatively trivial.

I would create a new EngineChannel that the headphone buffer would be passed through before it gets outputted. It would take in a buffer of (undelayed) audio from enginemaster and throw it into its own circular buffer with the right amount of delay. then I'd copy from the circular buffer to the output buffer based on the delay size. In case of underrun, I'd just spit out silence.

Maximum delay would be based on MAX_BUFFER_LEN

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Yep, grab it man. Go nuts! Just make sure to add a setting in the preferences to adjust the amount of delay.

Revision history for this message
Owen Williams (ywwg) wrote :

Here's a first-pass patch. I just implemented it as a slider, not as "feet" or "milliseconds" or "samples" of delay. If I want to adjust the delay, I'm going to do it by ear, not with a measuring tape.

Delay is not saved across sessions, it always starts at zero.

I made use of an existing class called "enginedelay.cpp" which is going completely unused. So I renamed it to enginepfldelay and put it to work.

Revision history for this message
Owen Williams (ywwg) wrote :

I'll get this whipped into shape for 1.10.1 -- I don't want to try out a new feature like this for 1.10.

Changed in mixxx:
assignee: nobody → Owen Williams (ywwg)
milestone: none → 1.10.1
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

It's gotta be 1.11.0 since new features only go in major releases, but hopefully 1.11 is early 2012 so it won't be too long.

Changed in mixxx:
milestone: 1.10.1 → 1.11.0
RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: 1.11.0 → 1.11.1
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Thanks Owen -- I like this but I think it needs to support units first instead of a hard-coded delay in EngineDelay. I'm pushing it to 1.11.1 for now but feel free to move it back if you plan to make progress soon.

RE: Renaming from EngineDelay to EnginePflDelay I think it should stay as EngineDelay so that it stays reusable. The ConfigKey for the delay pot could be passed in through the constructor or something.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

(Ideally the units would be seconds. I hear what you're saying about doing it by ear but it should have the units too)

Revision history for this message
Daniel Schürmann (daschuer) wrote :

I will try to reanimate this patch while working on the two soundcard issues Bug #1203249

Changed in mixxx:
milestone: 1.11.1 → 1.12.0
assignee: Owen Williams (ywwg) → Daniel Schürmann (daschuer)
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

IMO this would violate the feature freeze. Please focus on Bug #1203249 only. Adding a user-configurable PFL delay is not within the scope of that bug.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

(even if the implementation of that fix makes this bug easier to fix)

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

On second thought, if the change is tiny then this should be fine to include with your fix to Bug #1203249. There will surely be a bunch of low-risk areas we want to violate the freeze for tiny fixes so exceptions are fine.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

The fix lives already in https://github.com/daschuer/mixxx/tree/two_soundcards I can do a merge request if you like. But I will not actually merge if before the two sound cards issue is fixed. I like to have this fit to the whole.

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Triaged → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/4955

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.