ValveSoftware / ValveSoftware/wine

MMDevAPI: IAudioSessionEnumerator returns nonsense session count and leaks memory

Open
#260 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
2k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

Changes introduced in Add implementation for IAudioSessionEnumerator are preventing Special K from working.

The previous stub implementation was fine, but with the introduction of the session enumerator, Special K cannot be used in any game without leaking memory and quickly crashing (unless I activate a Wine-specific workaround added in Special K 24.10.19).

Here is the implementation of Special K's session enumeration if it helps. This works just fine on Windows with no leaks or the crazy number of sessions returned by IAudioSessionEnumerator::GetCount (...).


While reviewing the changes above, I noticed a problem with the Critical Section guarding the session list.

Critical Section guarding audio sessions is entered twice, never exited.
2762b7a

I think the second sessions_lock () should be sessions_unlock ()

Contributor guide

No contributing guide indexed for this repository

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 with the implementation introduced by commit 2762b7a and trace IAudioSessionEnumerator::GetCount and the session-list locking, using Special K's linked session-enumeration code as a behavioral reference. Done means the count is sensible, enumeration no longer leaks or causes crashes, and the critical section is balanced; no test file is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
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.