-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isAudible() #3772
isAudible() #3772
Conversation
I'd prefer to not keep rushing last minute changes to 2.3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes obviously introduce inconsistencies.
src/engine/sync/synccontrol.cpp
Outdated
@@ -171,6 +172,11 @@ bool SyncControl::isPlaying() const { | |||
return m_pPlayButton->toBool(); | |||
} | |||
|
|||
bool SyncControl::isAudible() const { | |||
qDebug() << "isAudible" << m_audible << getGroup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this debug log
src/engine/sync/synccontrol.cpp
Outdated
@@ -353,7 +359,7 @@ void SyncControl::trackBeatsUpdated(mixxx::BeatsPointer pBeats) { | |||
} | |||
|
|||
void SyncControl::slotControlPlay(double play) { | |||
m_pEngineSync->notifyPlaying(this, play > 0.0); | |||
m_pEngineSync->notifyPlaying(this, play > 0.0 && m_audible); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the semantics SyncControll::isPlaying() and is inconsistent.
src/engine/sync/synccontrol.cpp
Outdated
bool newAudible = gain > CSAMPLE_GAIN_ZERO ? true : false; | ||
if (m_audible != newAudible) { | ||
m_audible = newAudible; | ||
m_pEngineSync->notifyPlaying(this, m_pPlayButton->toBool() && m_audible); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here semantic change that causes an inconsistency. Audible, Playing or a mixture of both?
src/engine/enginemaster.h
Outdated
@@ -105,6 +105,8 @@ class EngineMaster : public QObject, public AudioSource { | |||
return m_pEngineSideChain; | |||
} | |||
|
|||
CSAMPLE_GAIN getMasterGain(int channelIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
src/engine/enginemaster.cpp
Outdated
@@ -836,6 +837,13 @@ EngineChannel* EngineMaster::getChannel(const QString& group) { | |||
return nullptr; | |||
} | |||
|
|||
CSAMPLE_GAIN EngineMaster::getMasterGain(int channelIndex) { | |||
if (channelIndex < m_channelMasterGainCache.size() && channelIndex >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking the lower bound first is more common
src/engine/sync/enginesync.h
Outdated
@@ -29,7 +29,7 @@ class EngineSync : public BaseSyncableListener { | |||
void requestBpmUpdate(Syncable* pSyncable, double bpm) override; | |||
void notifyInstantaneousBpmChanged(Syncable* pSyncable, double bpm) override; | |||
void notifyBeatDistanceChanged(Syncable* pSyncable, double beatDistance) override; | |||
void notifyPlaying(Syncable* pSyncable, bool playing) override; | |||
void notifyPlayingAudible(Syncable* pSyncable, bool playing) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename the parameters consistently, either all or none, even if the name doesn't matter. Applies multiple times.
src/engine/sync/synccontrol.cpp
Outdated
int channelIndex = m_pChannel->getChannelIndex(); | ||
if (channelIndex >= 0) { | ||
CSAMPLE_GAIN gain = getEngineMaster()->getMasterGain(channelIndex); | ||
bool newAudible = gain > CSAMPLE_GAIN_ZERO ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overly complicated. Remove the ternary operator.
@Be-ing Did I miss the discussion that made you switch the base branch to |
This is a significant behavior change. It is not okay to merge this to an (almost) stable branch. We already made that mistake with the mic ducking and confused lots of users. Don't do it again. |
Now the CI build fails. We either need to rebase the branch or republish the whole PR. |
Yes, of cause. From a broken behavior to a fixed behavior. That's the nature of a bugfix. Do you see an extra regression risk here? Please explain. If so, I am fine with merging it to 2.4. But from our discussion, about the future sync behavior I have got the impression that this is a quite important bug fix. I am personally not that effected, because I use a 2 deck layout and use for previewing the preview deck which does not force the playing track into const. I can effort that the playing deck becomes const during cuing in the follower. |
Why are we talking about this instead of getting a release out? |
I have changed the breach back to 2.3 to have CI results. This PR fixes a "bug", that the sync switches to internal clock during previewing a track using a free deck. This is a corner case that was not considered in in the 2.3 PR #2376 fixing https://bugs.launchpad.net/bugs/1851985 From this point of view it feels correct to fix this in the 2.3 branch as well. If we consider the risk to high, we can move it to a pint release ... @ywwg Do you have an opinion here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Merge?
No, do not merge this into 2.3. It can go to main. |
|
Any updates here? Merge? |
If this fixes a real usability issue let's merge it into 2.3. LGTM |
This introduces the arm test failures reported in https://bugs.launchpad.net/mixxx/+bug/1927859 The following tests FAILED: |
did this introduce a regression with quantize? |
That does sound like such an issue, but it also might be covered by one of my pending synclock PRs. I would like to get those in and then ask this user to test again. |
oh I see this affects 2.3. That might be a problem then |
@@ -353,7 +358,7 @@ void SyncControl::trackBeatsUpdated(mixxx::BeatsPointer pBeats) { | |||
} | |||
|
|||
void SyncControl::slotControlPlay(double play) { | |||
m_pEngineSync->notifyPlaying(this, play > 0.0); | |||
m_pEngineSync->notifyPlayingAudible(this, play > 0.0 && m_audible); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this was caused by this PR (maybe it was just a fluke), but this segfaulted for me when running tests. When I ran the tests again, everything passed.
Here' the backtrace from the coredump:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000055e2095da8eb in SyncControl::slotControlPlay (this=0x55e20b5a0660, play=0) at /home/jan/Projects/mixxx/src/engine/sync/synccontrol.cpp:384
384 m_pEngineSync->notifyPlayingAudible(this, play > 0.0 && m_audible);
[Current thread is 1 (Thread 0x7fb510b84640 (LWP 259384))]
>>> bt
#0 0x000055e2095da8eb in SyncControl::slotControlPlay(double) (this=0x55e20b5a0660, play=0) at /home/jan/Projects/mixxx/src/engine/sync/synccontrol.cpp:384
#1 0x00007fb524ce075b in () at /usr/lib/libQt5Core.so.5
#2 0x000055e2094f5d40 in ControlProxy::valueChanged(double) (this=<optimized out>, _t1=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_controlproxy.cpp:164
#3 0x00007fb524ce075b in () at /usr/lib/libQt5Core.so.5
#4 0x000055e2094ea625 in ControlDoublePrivate::valueChanged(double, QObject*) (this=this@entry=0x55e20b550a90, _t1=<optimized out>, _t1@entry=0, _t2=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_control.cpp:145
#5 0x000055e2094eadae in ControlDoublePrivate::setInner(double, QObject*) (this=0x55e20b550a90, value=0, pSender=<optimized out>) at /home/jan/Projects/mixxx/src/control/control.cpp:223
#6 0x00007fb524ce075b in () at /usr/lib/libQt5Core.so.5
#7 0x000055e2094ea5b3 in ControlDoublePrivate::valueChangeRequest(double) (this=this@entry=0x55e20b550a90, _t1=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_control.cpp:152
#8 0x000055e2094eaee8 in ControlDoublePrivate::set(double, QObject*) (this=0x55e20b550a90, value=<optimized out>, pSender=0x55e20b5509f0) at /home/jan/Projects/mixxx/src/control/control.cpp:208
#9 0x000055e2095b0646 in ControlObject::set(double) (value=<optimized out>, this=<optimized out>) at /home/jan/Projects/mixxx/src/control/controlobject.h:83
#10 EngineBuffer::slotTrackLoading() (this=0x55e20b548a10) at /home/jan/Projects/mixxx/src/engine/enginebuffer.cpp:521
#11 0x00007fb524ce075b in () at /usr/lib/libQt5Core.so.5
#12 0x00007fb524ce075b in () at /usr/lib/libQt5Core.so.5
#13 0x000055e209584f20 in CachingReaderWorker::loadTrack(std::shared_ptr<Track> const&) (this=0x55e20b54bea8, pTrack=std::shared_ptr<Track> (use count 5, weak count 0) = {...}) at /home/jan/Projects/mixxx/src/engine/cachingreader/cachingreaderworker.cpp:136
#14 0x000055e209586f6d in CachingReaderWorker::run() (this=0x55e20b54bea8) at /home/jan/Projects/mixxx/src/engine/cachingreader/cachingreaderworker.cpp:104
#15 0x00007fb524abdfef in () at /usr/lib/libQt5Core.so.5
#16 0x00007fb5245b7259 in start_thread () at /usr/lib/libpthread.so.0
#17 0x00007fb5244e05e3 in clone () at /usr/lib/libc.so.6
>>>
This adds the isAudible() API to SyncControl. This can be used in 2.4 to move the leader away from not audible decks.
In the 2.3 branch it fixes the bug that the internal clock is used even though only one deck is audible.
This forces a non const track to const for no reason.