-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
This change FIX Issue #2638 (Crash after rendering when using soundio). #5681
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 will make sense if the client is already active, but how about the null client case?
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.
Good question!
In modified stable code I tried to make situation with
m_client == NULL
true:But anyway I can not model situation than
AudioJack::startProcessing()
called withm_client == NULL
true . It seems thatm_client == NULL
always false thanAudioJack::startProcessing()
is called.But from another point of view, it seems that nothing happens if
AudioJack::processCallback
will be called whenm_client == NULL
true . In this case (m_client == NULL
true) ifm_stopped = false;
will be replaced (for example) withif (m_client != NULL) {m_stopped = false;}
,than LMMS will hung after exporting project in file.
So, if "driver" can work with
m_client == NULL
true - and "eat" audio data from Mixer, than code should be as it is in PR now. But if "driver" can not work in this case , than we should replaceif( m_active || m_client == NULL )
with something like:
{I really don't know how to check this ...} - is not true (see below)
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.
It seems, that the sentence:
"In LMMS
m_client == NULL
always false thanAudioJack::startProcessing()
is called."can be proved "mathematically".
If this is really true, than current PR simply fix bug.
All other changes are not needed for bug fix , but are "some code cleaning".
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.
On modified stable code I have checked situation when
m_client == NULL
is true (I simply change initialization code to leave object uninitialized)."Driver" can not work properly (when
m_client == NULL
is true) - it is not "eating" audio data from mixer, so application hung on file export start.So question to maintainers: "Should I add additional lines of code to handle situation, that can not happen ?"
:
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 looked into the JACK source code. That situation can only happen when JACK calls
AudioJack::shutdownCallback()
on failures. In that case,AudioJack::restartAfterZombified()
will try to restart the client. If that fails,m_client
will be null.Then,
AudioJack
won't consume audio anymore.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.
You are right, but after this
AudioJack::startProcessing()
is not called anymore ...Even if we try export audio data, than LMMS will hung before real audio export process.
P.S.
But "in real life" restart the client always not fail , except when user
There for I mentioned infinite loop trying restart client.
P.S.
But theoretically (not in current LMMS situation)
m_client
can be null. Sois not the option!
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.
My be should be added something like:
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.
If there is no change request from maintainers, than this PR version is final - ready to merge.
P.S.
AudioJack.cpp
code should be improved but not in bug fix context. (for example, in "When Jack is used, start / stop jack transport" context)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.
It seems like
m_stopped
doesn't change anything if the client is null. I think it's safe to merge.