-
Notifications
You must be signed in to change notification settings - Fork 227
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
Client: Avoid losing gain changes #2737
Conversation
@@ -119,6 +119,7 @@ CClient::CClient ( const quint16 iPortNumber, | |||
QObject::connect ( &Channel, &CChannel::ReqChanInfo, this, &CClient::OnReqChanInfo ); | |||
|
|||
QObject::connect ( &Channel, &CChannel::ConClientListMesReceived, this, &CClient::ConClientListMesReceived ); | |||
QObject::connect ( &Channel, &CChannel::ConClientListMesReceived, this, &CClient::OnConClientListMesReceived ); |
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'm a bit unsure what is better here:
- Use a single method to handle both cases (would require to re-emit the signal though, I think?)
- or use two
connect()
calls for those unrelated jobs.
I chose the latter as the jobs are unrelated (besides sharing the same trigger).
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, basically, is the fundamental flaw in the current design.
The Client is simply reemitting the signal on line 123 without "knowing" about it. I think it would be a better approach for the Client to handle all signals, hold state for what they "mean" and have GUI/JSONRPC/etc send state updates as signals. The client could them emit specific state change messages (i.e. in this case, which channel changed, one emit per channel, along with the new state).
However, for now, I'd be quite happy with either approach - either the new handler emitting CClient::ConClientListMesReceived
when complete or the one taken here.
0b50988
to
b706b50
Compare
@hoffie Compiled |
b706b50
to
d3022da
Compare
@rdica could you please re-test with the new approach? |
@ann0see Do I clone your repo/branch for this? |
No. Just use the updated code from hoffie. (Clone his repo again and ensure you have the code from this PR. My PR is somewhat related approach wise but doesn’t fix the bug. |
Did you check out the correct branch? |
I grabbed the zip from https://github.com/hoffie/jamulus/tree/fix-lost-gain-changes |
Ok. So probably my approach is wrong. But could you please again make clean and test it (I remember it worked as I tested it with the code in the suggestion) |
@hoffie maybe The initialisation is wrong https://m.cplusplus.com/forum/general/62832/ Edit: probably not |
Leave a comment |
d3022da That’s what the version of this PR should show if you are using git |
Ok well I thought the problem was introduced in |
PR jamulussoftware#2535 introduced rate limiting for gain change messages. The logic required storing the previously used gain value per channel. This logic had some flaws: 1. The previously used gain value defaulted to 0, despite the server-side view of the channel being set to 1 (as the default). Therefore, gain(0) changes during a series of gain changes would be lost. The most common scenario would be the initial connection, which always triggers the rate limit and therefore the faulty logic. This also affected New Client Level = 0. 2. The previously used gain values were not reset upon changing servers. This might have caused losing arbitrary gain change messages, e.g. stored fader values. 3. The previously used gain values were not reset upon a channel disconnect. This might have caused missing fader level restores. This commit introduces a gain level memory reset to 1 (100%) on connect as well as on channel disconnects to fix these issues. Fixes: jamulussoftware#2730 Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com>
d3022da
to
9835897
Compare
@rdica It's just that the non-release versioning is confusing. 3.8.2dev-XXX describes a version after 3.8.2 (contrary to what everyone else in the world seems to be doing; also against semantic versioning practices). As far as I understand, a fresh binary from this PR works well for you, so that would be good. @ann0see The code part which we changed after initially opening this PR is probably not relevant for the "joining a fresh server" case, so it's unlikely that those modifications broke the fix. I've just re-checked the debug output and it continues to seem correct. |
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 don't do this. It makes editing the ChangeLog really hard. Put the title of the issue being fixed. Duplicates are easy to spot and the grouping mechanism works. With this approach the grouping mechanism doesn't always get the two anywhere near each other. |
@hoffie I think we can merge this. |
I've now put the same title as the PR which initially caused the issue, so it should be right next to each other. |
Short description of changes
PR #2535 introduced rate limiting for gain change messages. The logic required storing the previously used gain value per channel. This logic had some flaws:
This PR introduces a gain level memory reset to 1 (100%) on connect as well as on channel disconnects to fix these issues.
CHANGELOG: Client: Fix potential long delay in sending fader changes to the server.
Context: Fixes an issue?
Fixes: #2730
Does this change need documentation? What needs to be documented and how?
No.
Status of this Pull Request
Ready for review and testing.
What is missing until this pull request can be merged?
Needs more testing / confirmation.
@rdica Can you please try this PR?
Helpful debug patches to confirm proper working
Checklist