mpv-player / mpv-player/mpv

Audio won't reinitialize when driver initialization failed

Open
#8,579 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

meta:feature-request
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

  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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.