-
Notifications
You must be signed in to change notification settings - Fork 2
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
Alsa: alsa_object_flush() crashes write operation in other thread #12
Comments
The call to The proper fix for this to support multiple threads is to add a lock guard around the write, flush and other calls to ensure they are in sync with each other. |
I could not reproduce the data still in buffer effect without audio_object_close() in the test program
In eSpeak-ng demo program with the MSEgui eSpeak-ng component
This would make it impossible to cancel speech operation from another thread, please remember |
The issues were with using brltty (on Debian) with espeak-ng. This was one of the fixes for the issues they were having. Note that with the locking support, it will only be for the pcaudiolib functions, not the espeak-ng synthesis logic itself. The espeak-ng code does not call write with a large audio chunk [1]. As such, setting the cancelled flag will at most cause the last audio chunk (write call) to be fully played. [1] The calls to |
Note: the 0.061833s is taken from using the linux |
For MSEgui with the separate speech thread it is it is important that |
Fred van Stappen writes that with "create_audio_device_object(pchar('sysdefault'),nil,nil)" the Alsa device will be called directly without PulseAudio stream in-between. In this mode I can reproduce that not all sound buffers will be dropped which probably produces the echos you mentioned. |
I made a bug report: |
Because alsa_object_flush() calls audio_object_close() it crashes running write operations in other thread. A patched version is here:
https://gitlab.com/mseide-msegui/pcaudiolib
The text was updated successfully, but these errors were encountered: