Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No audio track selected after waking monitor from sleep #15678

Open
6 tasks done
timminator opened this issue Jan 11, 2025 · 1 comment
Open
6 tasks done

No audio track selected after waking monitor from sleep #15678

timminator opened this issue Jan 11, 2025 · 1 comment
Labels

Comments

@timminator
Copy link
Contributor

timminator commented Jan 11, 2025

mpv Information

[   0.001][v][cplayer] mpv v0.39.0-607-gc42b19b8 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
[   0.002][v][cplayer]  built on Jan  5 2025 21:05:19
[   0.002][v][cplayer] libplacebo version: v7.350.0 (v7.349.0-30-g056b852-dirty)
[   0.002][v][cplayer] FFmpeg version: N-118243-g539cea318
[   0.002][v][cplayer] FFmpeg library versions:
[   0.002][v][cplayer]    libavcodec      61.29.100
[   0.002][v][cplayer]    libavdevice     61.4.100
[   0.002][v][cplayer]    libavfilter     10.6.101
[   0.002][v][cplayer]    libavformat     61.9.104
[   0.002][v][cplayer]    libavutil       59.54.101
[   0.002][v][cplayer]    libswresample   5.4.100
[   0.002][v][cplayer]    libswscale      8.13.100

Other Information

- Windows version: [Version 10.0.22631.4460]
- GPU model, driver and version: Nvidia Geforce RTX 3060, Driver 566.14
- Source of mpv: https://github.com/zhongfly/mpv-winbuild/releases
- Latest known working version: /
- Issue started after the following happened: /

Reproduction Steps

  1. Have a monitor or TV connected via Displayport or HDMI that report a sound output like "NVIDIA High Definition Audio" or
    "AMD High Definition Audio"
  2. All other audio devices need to be disabled
  3. For testing set the timer to turn off the display to 1 minute in the power plan settings.
  4. Open a video and pause it. Audio plays as expected
  5. Minimize the player.
  6. Let the monitors go to sleep.
  7. Wake the system up and resume playing. No audio track is selected.

When looking at the look you see this:

[ 60.613][e][cplayer] Could not open/initialize audio device -> no sound.
[ 60.613][d][ad] Uninit decoder.
[ 60.613][v][lavf] deselect track 1
[ 60.613][i][cplayer] Audio: no audio

That is true for the time the monitor goes to sleep but when the monitor or TV is woken up again the audio device is again available and I expect the audio device to be selected again.

I am aware that this is not really bug and likely also not exclusive to Windows but there was no option to open a general issue.
The thing is that I do not think that this situation is currently correctly handlled by libmpv.
In other players this does not result in no sound after waking the display up.
I think it would be a better approach if libmpv checks if the audio stream was manually disabled or not. If not libmpv should try to reenable the audio stream if the monitor is woken up again or playing is resumed.

I am aware that you can just manually reenable the audio stream in the player interface, but I dont think this is the right solution to this.
For example Subittle Edit uses libmpv as its video player and the integrated interface in this program does not contain a button to enable or disable an audio track. This means that there is no sound after waking the monitor up and audio can only be restored by restarting the application.

Edit: I found a similar issue #8096 that shows a similar problem. But the answer there is exactly the one I mentioned above that I think is not really the right solution to this.

Expected Behavior

Audio track should be reselected after waking monitors from sleep.

Actual Behavior

Audio track stays deselected.

Log File

output.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@llyyr
Copy link
Contributor

llyyr commented Jan 11, 2025

likely also not exclusive to Windows

can't reproduce with pipewire or pulse. probably exclusive to ao_wasapi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants