Skip to content
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

Merged
merged 5 commits into from
Apr 27, 2021
Merged

isAudible() #3772

merged 5 commits into from
Apr 27, 2021

Conversation

daschuer
Copy link
Member

@daschuer daschuer commented Apr 5, 2021

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.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 5, 2021

I'd prefer to not keep rushing last minute changes to 2.3.

Copy link
Contributor

@uklotzde uklotzde left a 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.

@@ -171,6 +172,11 @@ bool SyncControl::isPlaying() const {
return m_pPlayButton->toBool();
}

bool SyncControl::isAudible() const {
qDebug() << "isAudible" << m_audible << getGroup();
Copy link
Contributor

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

@@ -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);
Copy link
Contributor

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.

bool newAudible = gain > CSAMPLE_GAIN_ZERO ? true : false;
if (m_audible != newAudible) {
m_audible = newAudible;
m_pEngineSync->notifyPlaying(this, m_pPlayButton->toBool() && m_audible);
Copy link
Contributor

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?

@Be-ing Be-ing changed the base branch from 2.3 to main April 5, 2021 18:53
@@ -105,6 +105,8 @@ class EngineMaster : public QObject, public AudioSource {
return m_pEngineSideChain;
}

CSAMPLE_GAIN getMasterGain(int channelIndex);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

@@ -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) {
Copy link
Contributor

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

@@ -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;
Copy link
Contributor

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.

int channelIndex = m_pChannel->getChannelIndex();
if (channelIndex >= 0) {
CSAMPLE_GAIN gain = getEngineMaster()->getMasterGain(channelIndex);
bool newAudible = gain > CSAMPLE_GAIN_ZERO ? true : false;
Copy link
Contributor

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.

@ronso0
Copy link
Member

ronso0 commented Apr 7, 2021

I'd prefer to not keep rushing last minute changes to 2.3.

@Be-ing Did I miss the discussion that made you switch the base branch to main?

@Be-ing
Copy link
Contributor

Be-ing commented Apr 7, 2021

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.

@uklotzde
Copy link
Contributor

uklotzde commented Apr 9, 2021

Now the CI build fails. We either need to rebase the branch or republish the whole PR.

@daschuer
Copy link
Member Author

daschuer commented Apr 9, 2021

This is a significant behavior change.

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.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 9, 2021

Why are we talking about this instead of getting a release out?

@daschuer daschuer changed the base branch from main to 2.3 April 12, 2021 14:12
@daschuer
Copy link
Member Author

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?

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Merge?

@Be-ing
Copy link
Contributor

Be-ing commented Apr 16, 2021

No, do not merge this into 2.3. It can go to main.

@ronso0
Copy link
Member

ronso0 commented Apr 16, 2021

This is a significant behavior change.

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.

@daschuer
Copy link
Member Author

Any updates here? Merge?

@ronso0 ronso0 added this to the 2.3.0 milestone Apr 27, 2021
@uklotzde
Copy link
Contributor

If this fixes a real usability issue let's merge it into 2.3. LGTM

@uklotzde uklotzde merged commit 133e070 into mixxxdj:2.3 Apr 27, 2021
@daschuer
Copy link
Member Author

daschuer commented May 15, 2021

This introduces the arm test failures reported in https://bugs.launchpad.net/mixxx/+bug/1927859

https://launchpadlibrarian.net/535827661/buildlog_ubuntu-groovy-armhf.mixxx_2.3.0~beta~git8146-0ubuntu1~2.3~git8146~groovy_BUILDING.txt.gz

The following tests FAILED:
256 - EngineSyncTest.ZeroLatencyRateChangeQuant (Failed)
257 - EngineSyncTest.ZeroLatencyRateDiffQuant (Failed)

@ronso0
Copy link
Member

ronso0 commented Jul 27, 2021

did this introduce a regression with quantize?
https://mixxx.discourse.group/t/vestax-tr-1-weird-behaviour-quantizing-drops-tempo/22715

@ywwg
Copy link
Member

ywwg commented Jul 27, 2021

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.

@ywwg
Copy link
Member

ywwg commented Jul 27, 2021

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);
Copy link
Member

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
>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants