We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5477

Summary: Ubuntu 18.04.1&20.04 SDL_CloseAudioDevice hangs waiting for recording thread?
Product: SDL Reporter: superfury
Component: audioAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P1 Keywords: target-2.0.16
Version: 2.0.14   
Hardware: x86_64   
OS: Linux   

Description superfury 2021-01-18 02:03:09 UTC
I notice that somehow the SDL_CloseAudioDevice terminating the recording thread causes it to hang, waiting for the thread to terminate.

I found this on my own application (UniPCemu). Then also verified it to happen on the testaudiocapture test app when requesting it to terminate.

I simply checked out the repository, checked out 2.0.14, configured and built it according to the SDL manual's steps and then installed it for use with both applications.
Comment 1 superfury 2021-01-18 02:30:12 UTC
Looking at what gdb is saying, it seems to be using some pulseaudio audio driver? Perhaps that's related?
Comment 2 superfury 2021-01-18 21:11:58 UTC
This is happening on gcc-10 at least.
Comment 3 superfury 2021-01-19 17:01:28 UTC
Also verified on gcc 7.5.0 as well as both 7.5.0 and gcc-10 on the latest Ubuntu version (Ubuntu 20.04).

Currently using Ubuntu 20.04 with gcc 7.5.0 due to specific warnings spamming using the gcc-8/gcc-9/gcc-10 compiler.

SDL just can't seem to terminate the recording audio service (threading) properly?