obsproject / obsproject/obs-studio

Entering infinite wait when WASAPISource is destroyed

Open
#11,516 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

31.0.0-beta3

OBS Studio Version (Other)

No response

OBS Studio Log URL

none

OBS Studio Crash Log URL

No response

Expected Behavior

WASAPISource can be destroyed normally

Current Behavior

When switching scene collections, wsapisource will be destroyed.

Thread_41664 ->Deactivate(),close reconnectThread
Thread_26716->~WASAPISource->Stop(), if reconnectThread is valid,wait idleSignal

Stop() is likely to be called before Deactivate(), so reconnectThread is valid and therefore enters the wait state.
The idleSignal is only sent when the device pushes data to call OnSampleReady.
If the device does not push data, the idleSignal will never be sent and stop() will always be in a waiting state.

1731484793
1731484837

Steps to Reproduce

1.add audio input source
2.Switch scene collection
3.
...

Anything else we should know?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating WASAPISource and tracing Deactivate(), Stop(), reconnectThread, idleSignal, and OnSampleReady during scene-collection switching. Reproduce the audio-source destruction path on Windows 11 and verify that WASAPISource can be destroyed normally without waiting indefinitely when no device data arrives.

Written by the indexing model from the issue text.

Assessment

Domain
audio-video-rtc, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.