Audio won't reinitialize when driver initialization failed
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Important Information
Provide following Information:
- mpv version: mpv-0.33.0-x86_64
- Platform and Version: Windows 7 x64
- Source of the mpv binary: sourceforge.net
Reproduction steps
Switch to a non-available audio device during playback and try to switch back to an available one (using the method described in https://github.com/mpv-player/mpv/issues/2398)
Expected behavior
Audio is restored when the command to switch to an available audio device is issued.
Actual behavior
Audio stays muted once audio driver failed to initialize (looking at the log messages it seems like ao_init_best is not called anymore when trying to use a different device).
Log file
[ao/wasapi] Failed to find device '<device-id>'
[ao] Failed to initialize audio driver 'wasapi'
[ao] This audio driver/device was forced with the --audio-device option.
[ao] Try unsetting it.
Could not open/initialize audio device -> no sound.
Audio: no audio
Sample files
entry in input.conf: a cycle_values options/audio-device wasapi/<device-id> wasapi/<device-id2>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ao_init_best path mentioned in the report and trace how cycling options/audio-device through input.conf handles a failed WASAPI initialization. Reproduce on Windows with an unavailable device, then switch to an available one. Done means audio is restored and the relevant initialization path runs again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100