-
Notifications
You must be signed in to change notification settings - Fork 301
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
Pulseaudio: Add function to handle Pulseaudio pa_operation #924
base: master
Are you sure you want to change the base?
Conversation
7272950
to
f6a745a
Compare
There does not appear to be a reason for this to be a macro, could you make it a regular function please? |
f6a745a
to
d8026fb
Compare
Ok I've reworked macro to function and made needed changes to code. |
d8026fb
to
c381e43
Compare
|
||
while( pa_operation_get_state( localOperation ) == PA_OPERATION_RUNNING ) | ||
{ | ||
pa_threaded_mainloop_wait( hostapi->mainloop ); |
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.
According to:
https://freedesktop.org/software/pulseaudio/doxygen/thread-mainloop_8h.html#ac96d19260567d0406350f1b3a14c4bed
the call to pa_threaded_mainloop_wait() needs to be under a lock.
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.
Ok made needed changes to have locking when using wait
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 cannot find the commits where the locks were added.
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 bad! Not pushed stuff as you mentioned. Now done it and rebased.
@philburk this could be reviewed again is it ok to merge |
Now pa_operation are handled multiple ways. Add function to make sure that they are handled always same.
As function does not return value it should be void type Co-authored-by: Ross Bencina <rossb@audiomulch.com>
As function does not return value it should be void type Co-authored-by: Ross Bencina <rossb@audiomulch.com>
7214007
to
80b3257
Compare
Ok I fixed some locking problem which was caused when stopping device but now it does not hang because of double locking. |
…_wait Mainloop should be locked when using pa_threaded_mainloop_wait make changes that it happens
80b3257
to
5715e73
Compare
@@ -897,6 +911,7 @@ static PaError RequestStop( PaPulseAudio_Stream * stream, | |||
PaError ret = paNoError; | |||
PaPulseAudio_HostApiRepresentation *pulseaudioHostApi = stream->hostapi; | |||
pa_operation *pulseaudioOperation = NULL; | |||
int waitLoop = 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.
The waitLoop
variable seems unused.
This PR unifies handling on pa_operation. It does not add or remove anything just adds function that should make easier not to get into infinite loop at the start.