Open
Conversation
added 13 commits
January 17, 2018 13:33
when no audio data was copied Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
instead of using buffer_size as wrap around. This is required to detect Xruns. It is also required to allow the JACK thread to processes the whole buffer without a snd_pcm_avail_update() call in between. Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
when the JACK thread is requesting to many frames In playback use case fill the JACK buffer with silence. Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
to avoid issues with architeture which are using a different size for unsigned int Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
because the JACK process callback will be called before io->state == SND_PCM_STATE_RUNNING Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
…locking Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
volatile is not sufficient for guaranteeing the order of buffer access and hardware pointer update. In playback it could happen that the hardware pointer is updated but the audio data is not yet forwarded to the JACK daemon. Therefore the audio data could be overwritten by the ALSA application before it was copied to the JACK daemon. Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
This replaces the additional draining and activated variables. The state has to be accessed with memory barriers to guarantee the order of execution. e.g. to guarantee that snd_pcm_state not changes from DRAINING to RUNNING Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
To guarantee that the execution order. e.g. In playback case do not updating the application pointer before the audio data was copied to the buffer Additionally guarantee that the read of the application pointer is atomic and an invalid value will not be read. Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
because it accesses io->state and a read to this variable can result in an invalid value because there is no synchronisation used. Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
jack_areas contains the pointer to the JACK buffers Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
for variables which will be accessed by the ALSA and JACK thread
Has to be rebased when #1 was upstreamed