mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.24k stars 2.9k forks source link

WASAPI broken #7787

Closed Doofussy2 closed 4 years ago

Doofussy2 commented 4 years ago

Important Information

Windows 10

mpv 0.32.0-526-g102a083171 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
  built on Sun May 31 02:29:11 +08 2020
 FFmpeg library versions:
    libavutil       56.49.100
    libavcodec      58.90.100
    libavformat     58.44.100
    libswscale      5.6.101
    libavfilter     7.84.100
    libswresample   3.6.100
 FFmpeg version: git-2020-05-31-4aa07d1a

Reproduction steps

Player fails to open/start due to audio device failing to be initialized.

[   0.496][v][ao] Trying audio driver 'wasapi'
[   0.496][v][ao/wasapi] requested format: 48000 Hz, 5.1(side) channels, floatp
[   0.496][d][ao/wasapi] Init wasapi
[   0.496][d][ao/wasapi] Find device ''
[   0.503][v][ao/wasapi] No device specified. Selecting default.
[   0.511][v][ao/wasapi] Selecting device '{43306b15-d5fc-469c-b001-e1f271a5200c}' (marantz-AVR (3- NVIDIA High Definition Audio))
[   0.511][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{43306b15-d5fc-469c-b001-e1f271a5200c}
[   0.516][d][ao/wasapi] Init wasapi thread
[   0.516][d][ao/wasapi] Activating pAudioClient interface
[   0.521][d][ao/wasapi] Probing formats
[   0.544][v][ao/wasapi] Trying 5.1(side) float (32/32 bits) @ 48000hz (shared) -> close
[   0.544][v][ao/wasapi] Closest match is stereo float (32/32 bits) @ 48000hz
[   0.544][v][ao/wasapi] Accepted as stereo float @ 48000hz -> stereo float (32/32 bits) @ 48000hz (shared)
[   0.544][d][ao/wasapi] Fixing format
[   0.544][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.545][v][ao/wasapi] Device period: 10 ms
[   0.545][d][ao/wasapi] IAudioClient::Initialize
[   0.570][e][ao/wasapi] Error initializing device: AUDCLNT_E_DEVICE_IN_USE (0x8889000a)
[   0.570][d][ao/wasapi] Thread shutdown
[   0.570][d][ao/wasapi] Thread uninit done
[   0.570][w][ao/wasapi] Retrying in 1 us
[   0.571][d][ao/wasapi] Activating pAudioClient interface
[   0.572][d][ao/wasapi] Probing formats
[   0.573][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (shared) -> ok
[   0.573][v][ao/wasapi] Accepted as stereo float @ 48000hz -> stereo float (32/32 bits) @ 48000hz (shared)
[   0.573][d][ao/wasapi] Fixing format
[   0.573][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.574][v][ao/wasapi] Device period: 10 ms
[   0.574][d][ao/wasapi] IAudioClient::Initialize
[   0.585][e][ao/wasapi] Error initializing device: AUDCLNT_E_DEVICE_IN_USE (0x8889000a)
[   0.586][d][ao/wasapi] Thread shutdown
[   0.586][d][ao/wasapi] Thread uninit done
[   0.586][w][ao/wasapi] Retrying in 2 us
[   0.587][d][ao/wasapi] Activating pAudioClient interface
[   0.588][d][ao/wasapi] Probing formats
[   0.590][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (shared) -> ok
[   0.590][v][ao/wasapi] Accepted as stereo float @ 48000hz -> stereo float (32/32 bits) @ 48000hz (shared)
[   0.590][d][ao/wasapi] Fixing format
[   0.590][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.590][v][ao/wasapi] Device period: 10 ms
[   0.590][d][ao/wasapi] IAudioClient::Initialize
[   0.602][e][ao/wasapi] Error initializing device: AUDCLNT_E_DEVICE_IN_USE (0x8889000a)
[   0.602][d][ao/wasapi] Thread shutdown
[   0.602][d][ao/wasapi] Thread uninit done
[   0.602][w][ao/wasapi] Retrying in 4 us
[   0.603][d][ao/wasapi] Activating pAudioClient interface
[   0.604][d][ao/wasapi] Probing formats
[   0.606][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (shared) -> ok
[   0.606][v][ao/wasapi] Accepted as stereo float @ 48000hz -> stereo float (32/32 bits) @ 48000hz (shared)
[   0.606][d][ao/wasapi] Fixing format
[   0.606][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.606][v][ao/wasapi] Device period: 10 ms
[   0.606][d][ao/wasapi] IAudioClient::Initialize
[   0.617][e][ao/wasapi] Error initializing device: AUDCLNT_E_DEVICE_IN_USE (0x8889000a)
[   0.617][d][ao/wasapi] Thread shutdown
[   0.617][d][ao/wasapi] Thread uninit done
[   0.617][w][ao/wasapi] Retrying in 8 us
[   0.618][d][ao/wasapi] Activating pAudioClient interface
[   0.619][d][ao/wasapi] Probing formats
[   0.621][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (shared) -> ok
[   0.621][v][ao/wasapi] Accepted as stereo float @ 48000hz -> stereo float (32/32 bits) @ 48000hz (shared)
[   0.621][d][ao/wasapi] Fixing format
[   0.621][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.621][v][ao/wasapi] Device period: 10 ms
[   0.621][d][ao/wasapi] IAudioClient::Initialize
[   0.633][e][ao/wasapi] Error initializing device: AUDCLNT_E_DEVICE_IN_USE (0x8889000a)
[   0.633][f][ao/wasapi] Bad device retry failed
[   0.633][d][ao/wasapi] Thread shutdown
[   0.633][d][ao/wasapi] Uninit wasapi
[   0.633][d][ao/wasapi] Thread uninit done
[   0.633][d][ao/wasapi] Thread return
[   0.633][d][ao/wasapi] Uninit wasapi done
[   0.633][v][ao] Trying audio driver 'openal'
[   0.633][v][ao/openal] requested format: 48000 Hz, 5.1(side) channels, floatp

Expected behavior

To play the video

Actual behavior

Failure to open

Log file

Portable mpv log.txt

kevmitch commented 4 years ago

You didn't specify where you got your binary like the issue template requested.

I cannot reproduce this with the shinchiro build at https://sourceforge.net/projects/mpv-player-windows/files

As might be expected, AUDCLNT_E_DEVICE_IN_USE, means something else is accessing the device exclusively. For example another mpv instance with --audio-exclusive or possibly foobar or some other music player.

kevmitch commented 4 years ago

This also used to happen when re-initializing mpv's audio in exclusive mode even if nothing else was running. However, that was fixed long ago and you're using shared mode anyway.

Doofussy2 commented 4 years ago

You didn't specify where you got your binary like the issue template requested.

I cannot reproduce this with the shinchiro build at https://sourceforge.net/projects/mpv-player-windows/files

This is happening with shinciro's build mpv-x86_64-20200531-git-102a083.7z, but not with mpv-x86_64-20200524-git-685bd6a.7z, which I am still using.

As might be expected, AUDCLNT_E_DEVICE_IN_USE, means something else is accessing the device exclusively. For example another mpv instance with --audio-exclusive or possibly foobar or some other music player.

No other audio software was in use, as that was something I checked and tested for. When first trying to play, it plays with no audio. And then on closing mpv, it doesn't fully close. I have to go into task manager and force close it. Using the build from the 24th, it plays correctly, with no problems.

On further testing, this is happening with;

audio-exclusive=yes
audio-stream-silence=yes

test.txt

ghost commented 4 years ago

Although there were changes to the common AO code, I have no idea how this would affect ao_wasapi in any way, and ao_sdl (uses the same internal APIs) works.

Doofussy2 commented 4 years ago

I trust that you guys can reproduce this?

xXedgelordXx commented 4 years ago

@Doofussy2 It seems like a problem in your end, wasapi is working for me. Using Windows 10 Pro build 19041.264

mpv build info:

[ 0.012][v][cplayer] mpv 0.32.0-526-g102a083171 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects [ 0.012][v][cplayer] built on Sun May 31 02:29:11 +08 2020 [ 0.012][v][cplayer] FFmpeg library versions: [ 0.012][v][cplayer] libavutil 56.49.100 [ 0.012][v][cplayer] libavcodec 58.90.100 [ 0.012][v][cplayer] libavformat 58.44.100 [ 0.012][v][cplayer] libswscale 5.6.101 [ 0.012][v][cplayer] libavfilter 7.84.100 [ 0.012][v][cplayer] libswresample 3.6.100 [ 0.012][v][cplayer] FFmpeg version: git-2020-05-31-4aa07d1a

WASAPI log:

[ 0.241][v][ao] Trying audio driver 'wasapi' [ 0.241][v][ao/wasapi] requested format: 48000 Hz, stereo channels, s16 [ 0.241][d][ao/wasapi] Init wasapi [ 0.241][d][ao/wasapi] Find device '' [ 0.243][v][ao/wasapi] No device specified. Selecting default. [ 0.244][v][ao/wasapi] Selecting device '{da8dfccf-3e2a-4ac5-9197-b9486756d117}' (DAC (OriGen G2)) [ 0.244][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{da8dfccf-3e2a-4ac5-9197-b9486756d117} [ 0.245][d][ao/wasapi] Init wasapi thread [ 0.245][d][ao/wasapi] Activating pAudioClient interface [ 0.246][d][ao/wasapi] Probing formats [ 0.247][v][ao/wasapi] Trying stereo s16 (16/16 bits) @ 48000hz (exclusive) -> ok [ 0.247][v][ao/wasapi] Accepted as stereo s16 @ 48000hz -> stereo s16 (16/16 bits) @ 48000hz (exclusive) [ 0.247][d][ao/wasapi] Fixing format [ 0.247][d][ao/wasapi] IAudioClient::GetDevicePeriod [ 0.247][v][ao/wasapi] Device period: 10 ms [ 0.247][d][ao/wasapi] IAudioClient::Initialize [ 0.251][d][ao/wasapi] IAudioClient::Initialize pRenderClient [ 0.251][d][ao/wasapi] IAudioClient::Initialize IAudioClient_SetEventHandle [ 0.251][d][ao/wasapi] IAudioClient::Initialize IAudioClient_GetBufferSize [ 0.251][v][ao/wasapi] Buffer frame count: 480 (10 ms) [ 0.252][v][ao/wasapi] IAudioClock::GetFrequency gave a frequency of 48000. [ 0.254][d][ao/wasapi] Activating pEndpointVolume interface [ 0.254][d][ao/wasapi] IAudioEndpointVolume::QueryHardwareSupport [ 0.254][d][ao/wasapi] Entering dispatch loop [ 0.254][d][ao/wasapi] Init wasapi done [ 0.254][v][ao/wasapi] device buffer: 480 samples. [ 0.254][v][ao/wasapi] using soft-buffer of 9600 samples. [ 0.254][i][cplayer] AO: [wasapi] 48000Hz stereo 2ch s16 [ 0.254][v][cplayer] AO: Description: Windows WASAPI audio output (event mode)

Audio conf used:

ao=wasapi audio-exclusive=yes volume=100 volume-max=100 audio-channels=stereo

Doofussy2 commented 4 years ago

@Doofussy2 It seems like a problem in your end, wasapi is working for me. Using Windows 10 Pro build 19041.264

Audio conf used:

ao=wasapi audio-exclusive=yes volume=100 volume-max=100 audio-channels=stereo

Try adding --audio-stream-silence=yes to your config

On further testing, this is happening with;

audio-exclusive=yes
audio-stream-silence=yes
xXedgelordXx commented 4 years ago

Still works when using audio-stream-silence=yes I'm using an external USB DAC/AMP combo tho, Micca OriGen G2 with the official Micca drivers.

It looks like you have an issue with the Nvidia HDMI audio driver. Try updating/re-installing the Nvidia drivers.

Log:

[ 0.253][v][ao] Trying audio driver 'wasapi' [ 0.253][v][ao/wasapi] requested format: 48000 Hz, stereo channels, s16 [ 0.253][d][ao/wasapi] Init wasapi [ 0.253][d][ao/wasapi] Find device '' [ 0.254][v][ao/wasapi] No device specified. Selecting default. [ 0.255][v][ao/wasapi] Selecting device '{da8dfccf-3e2a-4ac5-9197-b9486756d117}' (DAC (OriGen G2)) [ 0.255][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{da8dfccf-3e2a-4ac5-9197-b9486756d117} [ 0.256][d][ao/wasapi] Init wasapi thread [ 0.256][d][ao/wasapi] Activating pAudioClient interface [ 0.258][d][ao/wasapi] Probing formats [ 0.259][v][ao/wasapi] Trying stereo s16 (16/16 bits) @ 48000hz (exclusive) -> ok [ 0.259][v][ao/wasapi] Accepted as stereo s16 @ 48000hz -> stereo s16 (16/16 bits) @ 48000hz (exclusive) [ 0.259][d][ao/wasapi] Fixing format [ 0.259][d][ao/wasapi] IAudioClient::GetDevicePeriod [ 0.259][v][ao/wasapi] Device period: 10 ms [ 0.259][d][ao/wasapi] IAudioClient::Initialize [ 0.264][d][ao/wasapi] IAudioClient::Initialize pRenderClient [ 0.264][d][ao/wasapi] IAudioClient::Initialize IAudioClient_SetEventHandle [ 0.264][d][ao/wasapi] IAudioClient::Initialize IAudioClient_GetBufferSize [ 0.264][v][ao/wasapi] Buffer frame count: 480 (10 ms) [ 0.264][v][ao/wasapi] IAudioClock::GetFrequency gave a frequency of 48000. [ 0.266][d][ao/wasapi] Activating pEndpointVolume interface [ 0.266][d][ao/wasapi] IAudioEndpointVolume::QueryHardwareSupport [ 0.267][d][ao/wasapi] Entering dispatch loop [ 0.267][d][ao/wasapi] Init wasapi done [ 0.267][v][ao/wasapi] device buffer: 480 samples. [ 0.267][v][ao/wasapi] using soft-buffer of 9600 samples. [ 0.267][d][ao/wasapi] Thread Resume [ 0.267][d][ao/wasapi] Thread Reset [ 0.267][i][cplayer] AO: [wasapi] 48000Hz stereo 2ch s16 [ 0.267][v][cplayer] AO: Description: Windows WASAPI audio output (event mode)

conf used:

ao=wasapi audio-exclusive=yes volume=100 volume-max=100 audio-channels=stereo audio-stream-silence=yes

Doofussy2 commented 4 years ago

If you aren't using an AVR, it likely won't make a difference. Windows just did its big update to the version you are using. I'll have to re-test...

Doofussy2 commented 4 years ago

Nope! Won't start. I just gets stuck and I have to force close it in task manager. Totally broken! Maybe it's a broken download.... I'll try reacquiring it...

Doofussy2 commented 4 years ago

Nope! Total fail! I guess I'm stuck the previous build :/

Doofussy2 commented 4 years ago

I've now tried various different configs, including copying the one above. It will not work with those two commands together. I don't even get a momentary window. It's just fails! The previous build works, perfectly! And I also updated the Nvidia driver, so that's ruled out.

Doofussy2 commented 4 years ago

Just tried with --aid=no to get it to start playing, then tried choosing a track while playing. It crashed. This is the last output from the log, where it crashed.

[  10.943][v][ao/wasapi] result: stereo
[  10.943][v][ao/wasapi] Accepted as stereo s32 @ 48000hz -> stereo s32 (32/24 bits) @ 48000hz (exclusive)
[  10.943][d][ao/wasapi] Fixing format
[  10.943][d][ao/wasapi] IAudioClient::GetDevicePeriod
[  10.943][v][ao/wasapi] Device period: 10 ms
[  10.943][d][ao/wasapi] IAudioClient::Initialize
[  10.946][e][ao/wasapi] Error initializing device: AUDCLNT_E_DEVICE_IN_USE (0x8889000a)
[  10.946][f][ao/wasapi] Bad device retry failed
[  10.946][d][ao/wasapi] Thread shutdown
[  10.946][d][ao/wasapi] Uninit wasapi
[  10.946][d][ao/wasapi] Thread uninit done
[  10.946][d][ao/wasapi] Thread return
[  10.946][d][ao/wasapi] Uninit wasapi done
[  10.946][v][ao] Trying audio driver 'openal'
[  10.946][v][ao/openal] requested format: 48000 Hz, 7.1 channels, s32
xXedgelordXx commented 4 years ago

I also have a nvidia gpu(gtx 980ti), I could try reproducing your problem by using my monitor's built in DAC, I will send my monitor the audio via the HDMI port and I'll connect my headphones in the monitor's 3.5mm jack. You'll have to wait till tomorrow(Friday) tho, because when I installed the nvidia drivers I always deselected the HDMI audio driver(because I use a USB DAC/AMP like I already told you). I'll post an update tomorrow with the results.

Doofussy2 commented 4 years ago

So for now, I'll just stop using --audio-stream-silence=yes. I've had to previously increase the audio buffer to 3 seconds because of repeated audio dropout with spdif. So far, resuming playback from pause, the audio resumes as desired. I'll have to pay attention, and see what happens....

Doofussy2 commented 4 years ago

Is there any progress with this? It's a real problem. I can't use a later build :/

jeeb commented 4 years ago

I've been busy trying to fix 22.2 AAC in FFmpeg, but I did want to give this a quick whirl with my build that bases on 0fb02f181f .

First tested with:

mpv --no-config --audio-exclusive=yes --audio-stream-silence=yes lain_op.mp4
 (+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
AO: [wasapi] 48000Hz stereo 2ch s32
VO: [gpu] 1920x1080 yuv420p`

and all things worked

Then after a while retried and I was able to get a freeze after the system had to re-spin the HDD (maybe?)

mpv --msg-level=ao=v --no-config --audio-exclusive=yes --audio-stream-silence=yes lain_op.mp4
 (+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[ao] Trying audio driver 'wasapi'
[ao/wasapi] requested format: 48000 Hz, stereo channels, floatp
[ao/wasapi] No device specified. Selecting default.
[ao/wasapi] Selecting device '{78ccf0a1-8d44-4c9e-862b-5b7328bdfe0a}' (Speakers (Realtek High Definition Audio))
[ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{78ccf0a1-8d44-4c9e-862b-5b7328bdfe0a}
[ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/32 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 44100hz (exclusive) -> ok
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 96000hz (exclusive) -> ok
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 88200hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 192000hz (exclusive) -> ok
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 176400hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 32000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 22050hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 11025hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 8000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 16000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 352800hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 384000hz (exclusive) -> unsupported
[ao/wasapi] Trying 5.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying 7.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying 6.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying mono s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 2.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 4.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 5.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 3.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 3.0(back) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying quad s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying quad(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 3.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 5.0(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 4.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 5.1(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 6.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 6.1(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 7.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 7.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 7.1(wide) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying 7.1(wide-side) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying empty s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying octagonal s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Channel layouts:
[ao/wasapi]  - stereo
[ao/wasapi]  - 5.1
[ao/wasapi]  - 7.1
[ao/wasapi]  - quad
[ao/wasapi]  - 7.1(wide)
[ao/wasapi]  - 7.1(wide-side)
[ao/wasapi]  - 7.1(rear)
[ao/wasapi]  - octagonal
[ao/wasapi] result: stereo
[ao/wasapi] Accepted as stereo s32 @ 48000hz -> stereo s32 (32/24 bits) @ 48000hz (exclusive)
[ao/wasapi] Device period: 10 ms
[ao/wasapi] Buffer frame count: 480 (10 ms)
[ao/wasapi] IAudioClock::GetFrequency gave a frequency of 48000.
[ao/wasapi] device buffer: 480 samples.
[ao/wasapi] using soft-buffer of 9600 samples.
AO: [wasapi] 48000Hz stereo 2ch s32

although the only thing not appearing seemed to be the VO? After N tries it seems to happen more often. This is specific to audio-stream-silence, apparently?

Bumping AO verbosity I get:

mpv --msg-level=ao=trace --no-config --audio-exclusive=yes --audio-stream-silence=yes lain_op.mp4
 (+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[ao] Trying audio driver 'wasapi'
[ao/wasapi] requested format: 48000 Hz, stereo channels, floatp
[ao/wasapi] Init wasapi
[ao/wasapi] Find device ''
[ao/wasapi] No device specified. Selecting default.
[ao/wasapi] Selecting device '{78ccf0a1-8d44-4c9e-862b-5b7328bdfe0a}' (Speakers (Realtek High Definition Audio))
[ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{78ccf0a1-8d44-4c9e-862b-5b7328bdfe0a}
[ao/wasapi] Init wasapi thread
[ao/wasapi] Activating pAudioClient interface
[ao/wasapi] Probing formats
[ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/32 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 44100hz (exclusive) -> ok
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 96000hz (exclusive) -> ok
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 88200hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 192000hz (exclusive) -> ok
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 176400hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 32000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 22050hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 11025hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 8000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 16000hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 352800hz (exclusive) -> unsupported
[ao/wasapi] Trying stereo s32 (32/24 bits) @ 384000hz (exclusive) -> unsupported
[ao/wasapi] Trying 5.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying 7.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying 6.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying mono s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 2.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 4.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 5.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 3.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 3.0(back) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying quad s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying quad(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 3.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 5.0(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 4.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 5.1(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 6.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 6.1(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 7.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 7.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[ao/wasapi] Trying 7.1(wide) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying 7.1(wide-side) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying empty s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Trying octagonal s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[ao/wasapi] Channel layouts:
[ao/wasapi]  - stereo
[ao/wasapi]  - 5.1
[ao/wasapi]  - 7.1
[ao/wasapi]  - quad
[ao/wasapi]  - 7.1(wide)
[ao/wasapi]  - 7.1(wide-side)
[ao/wasapi]  - 7.1(rear)
[ao/wasapi]  - octagonal
[ao/wasapi] result: stereo
[ao/wasapi] Accepted as stereo s32 @ 48000hz -> stereo s32 (32/24 bits) @ 48000hz (exclusive)
[ao/wasapi] Fixing format
[ao/wasapi] IAudioClient::GetDevicePeriod
[ao/wasapi] Device period: 10 ms
[ao/wasapi] IAudioClient::Initialize
[ao/wasapi] IAudioClient::Initialize pRenderClient
[ao/wasapi] IAudioClient::Initialize IAudioClient_SetEventHandle
[ao/wasapi] IAudioClient::Initialize IAudioClient_GetBufferSize
[ao/wasapi] Buffer frame count: 480 (10 ms)
[ao/wasapi] IAudioClock::GetFrequency gave a frequency of 48000.
[ao/wasapi] Activating pEndpointVolume interface
[ao/wasapi] IAudioEndpointVolume::QueryHardwareSupport
[ao/wasapi] Entering dispatch loop
[ao/wasapi] Init wasapi done
[ao/wasapi] device buffer: 480 samples.
[ao/wasapi] using soft-buffer of 9600 samples.
[ao/wasapi] Thread Resume
[ao/wasapi] Thread Reset
AO: [wasapi] 48000Hz stereo 2ch s32
[ao/wasapi] Frame to fill: 480. Padding: 480
[ao/wasapi] Device delay: -1.1 us

But I do not get the Error initializing device: AUDCLNT_E_DEVICE_IN_USE (0x8889000a) at all. In the worst case the video doesn't pop up and I have to ctrl+C to quit.

jeeb commented 4 years ago

Full log file

[   0.004][v][cplayer] mpv 0.32.0-548-g0fb02f181f Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[   0.004][v][cplayer]  built on Mon Jun  8 20:55:56 EEST 2020
[   0.004][v][cplayer] FFmpeg library versions:
[   0.004][v][cplayer]    libavutil       56.50.100
[   0.004][v][cplayer]    libavcodec      58.90.100
[   0.004][v][cplayer]    libavformat     58.44.100
[   0.004][v][cplayer]    libswscale      5.6.101
[   0.004][v][cplayer]    libavfilter     7.84.100
[   0.004][v][cplayer]    libswresample   3.6.100
[   0.004][v][cplayer] FFmpeg version: N-98077-g3e651eeac4
[   0.004][v][cplayer] 
[   0.004][v][cplayer] Configuration: ./waf configure --variant=mingw64 --enable-libmpv-shared --prefix=/home/jeeb/ownapps/mingw64_mpv
[   0.004][v][cplayer] List of enabled features: asm build-date cplayer d3d-hwaccel d3d11 d3d9-hwaccel debug-build direct3d dos-paths ffmpeg gl gl-dxinterop gl-dxinterop-d3d9 gl-win32 glob glob-win32 gpl iconv lcms2 libass libavdevice libbluray libm libmpv-shared libplacebo lua luajit mingw noexecstack optimize plain-gl posix-or-mingw shaderc shaderc-static spirv-cross spirv-cross-shared stdatomic vulkan wasapi win32-desktop win32-internal-pthreads zimg zlib
[   0.004][v][cplayer] Command line options: '--log-file=mpv_sucks-lain.log' '--no-config' '--audio-exclusive=yes' '--audio-stream-silence=yes' 'lain_op.mp4'
[   0.004][v][cplayer] mpv 0.32.0-548-g0fb02f181f Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[   0.004][v][cplayer]  built on Mon Jun  8 20:55:56 EEST 2020
[   0.004][v][cplayer] FFmpeg library versions:
[   0.004][v][cplayer]    libavutil       56.50.100
[   0.004][v][cplayer]    libavcodec      58.90.100
[   0.004][v][cplayer]    libavformat     58.44.100
[   0.004][v][cplayer]    libswscale      5.6.101
[   0.004][v][cplayer]    libavfilter     7.84.100
[   0.004][v][cplayer]    libswresample   3.6.100
[   0.004][v][cplayer] FFmpeg version: N-98077-g3e651eeac4
[   0.004][v][cplayer] 
[   0.004][v][cplayer] Configuration: ./waf configure --variant=mingw64 --enable-libmpv-shared --prefix=/home/jeeb/ownapps/mingw64_mpv
[   0.004][v][cplayer] List of enabled features: asm build-date cplayer d3d-hwaccel d3d11 d3d9-hwaccel debug-build direct3d dos-paths ffmpeg gl gl-dxinterop gl-dxinterop-d3d9 gl-win32 glob glob-win32 gpl iconv lcms2 libass libavdevice libbluray libm libmpv-shared libplacebo lua luajit mingw noexecstack optimize plain-gl posix-or-mingw shaderc shaderc-static spirv-cross spirv-cross-shared stdatomic vulkan wasapi win32-desktop win32-internal-pthreads zimg zlib
[   0.004][d][global] config path: '' -> '-'
[   0.004][v][cplayer] Setting option 'log-file' = 'mpv_sucks-lain.log' (flags = 8)
[   0.004][v][cplayer] Setting option 'config' = 'no' (flags = 8)
[   0.004][v][cplayer] Setting option 'audio-exclusive' = 'yes' (flags = 8)
[   0.004][v][cplayer] Setting option 'audio-stream-silence' = 'yes' (flags = 8)
[   0.005][d][global] user path: 'mpv_sucks-lain.log' -> 'mpv_sucks-lain.log'
[   0.006][d][osc] Loading lua script @osc.lua...
[   0.006][d][ytdl_hook] Loading lua script @ytdl_hook.lua...
[   0.006][d][stats] Loading lua script @stats.lua...
[   0.006][d][console] Loading lua script @console.lua...
[   0.006][v][cplayer] Waiting for scripts...
[   0.007][d][ytdl_hook] loading mp.defaults
[   0.007][d][osc] loading mp.defaults
[   0.007][d][stats] loading mp.defaults
[   0.007][d][console] loading mp.defaults
[   0.007][d][ytdl_hook] loading @ytdl_hook.lua
[   0.007][d][osc] loading @osc.lua
[   0.007][d][stats] loading @stats.lua
[   0.007][d][console] loading @console.lua
[   0.008][d][ytdl_hook] reading options for ytdl_hook 
[   0.008][d][ytdl_hook] script-opts/ytdl_hook.conf not found. 
[   0.008][d][ytdl_hook] lua-settings/ytdl_hook.conf not found. 
[   0.008][d][console] reading options for console 
[   0.008][d][console] script-opts/console.conf not found. 
[   0.008][d][console] lua-settings/console.conf not found. 
[   0.008][d][stats] reading options for stats 
[   0.008][d][stats] script-opts/stats.conf not found. 
[   0.008][d][stats] lua-settings/stats.conf not found. 
[   0.008][d][osd/libass] ASS library version: 0x1400001 (runtime 0x1400001)
[   0.009][d][osc] reading options for osc 
[   0.009][d][osc] script-opts/osc.conf not found. 
[   0.009][d][osc] lua-settings/osc.conf not found. 
[   0.009][v][osd/libass] Shaper: FriBidi 1.0.9 (SIMPLE)
[   0.009][v][osd/libass] Setting up fonts...
[   0.014][v][osd/libass] Using font provider directwrite
[   0.014][v][osd/libass] Done.
[   0.014][d][cplayer] Run command: define-section, flags=64, args=[name="input_stats", contents="i script-binding stats/display-stats\nI script-binding stats/display-stats-toggle\n", flags="default"]
[   0.014][d][cplayer] Run command: enable-section, flags=64, args=[name="input_stats", flags="allow-hide-cursor+allow-vo-dragging"]
[   0.014][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_stats", contents="", flags="force"]
[   0.014][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_stats", flags="allow-hide-cursor+allow-vo-dragging"]
[   0.015][d][cplayer] Run command: define-section, flags=64, args=[name="input_console", contents="", flags="default"]
[   0.015][d][cplayer] Run command: enable-section, flags=64, args=[name="input_console", flags="allow-hide-cursor+allow-vo-dragging"]
[   0.015][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_console", contents="", flags="force"]
[   0.015][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_console", flags="allow-hide-cursor+allow-vo-dragging"]
[   0.015][d][cplayer] Run command: define-section, flags=64, args=[name="showhide", contents="mouse_move script-binding osc/__keybinding1\nmouse_leave script-binding osc/__keybinding2\n", flags="force"]
[   0.015][d][cplayer] Run command: define-section, flags=64, args=[name="showhide_wc", contents="mouse_move script-binding osc/__keybinding3\nmouse_leave script-binding osc/__keybinding4\n", flags="force"]
[   0.015][d][cplayer] Run command: enable-section, flags=64, args=[name="showhide", flags="allow-hide-cursor+allow-vo-dragging"]
[   0.015][d][cplayer] Run command: enable-section, flags=64, args=[name="showhide_wc", flags="allow-hide-cursor+allow-vo-dragging"]
[   0.015][d][cplayer] Run command: define-section, flags=64, args=[name="input", contents="mbtn_left script-binding osc/__keybinding5\nshift+mbtn_left script-binding osc/__keybinding6\nmbtn_right script-binding osc/__keybinding7\nmbtn_mid script-binding osc/__keybinding8\nwheel_up script-binding osc/__keybinding9\nwheel_down script-binding osc/__keybinding10\nmbtn_left_dbl ignore\nshift+mbtn_left_dbl ignore\nmbtn_right_dbl ignore\n", flags="force"]
[   0.016][d][cplayer] Run command: enable-section, flags=64, args=[name="input", flags=""]
[   0.016][d][cplayer] Run command: define-section, flags=64, args=[name="window-controls", contents="mbtn_left script-binding osc/__keybinding11\n", flags="force"]
[   0.016][d][cplayer] Run command: enable-section, flags=64, args=[name="window-controls", flags=""]
[   0.016][d][cplayer] Run command: disable-section, flags=64, args=[name="input"]
[   0.016][d][cplayer] Run command: disable-section, flags=64, args=[name="window-controls"]
[   0.016][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"]
[   0.016][v][cplayer] Set property: shared-script-properties -> 1
[   0.016][v][cplayer] Done loading scripts.
[   0.016][d][global] config path: 'watch_later' -> '-'
[   0.016][d][global] config path: 'watch_later' -> '-'
[   0.016][v][cplayer] Running hook: ytdl_hook/on_load
[   0.016][v][ytdl_hook] ytdl:// hook 
[   0.016][v][ytdl_hook] not a ytdl:// url 
[   0.016][d][osc] osc_init 
[   0.016][v][bdmv/bluray] Opening lain_op.mp4
[   0.016][v][file] Opening lain_op.mp4
[   0.016][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"]
[   0.016][d][file] resize stream to 131072 bytes, drop 0 bytes
[   0.016][d][file] Stream opened successfully.
[   0.016][v][demux] Trying demuxers for level=normal.
[   0.016][v][cplayer] Set property: shared-script-properties -> 1
[   0.016][d][demux] Trying demuxer: disc (force-level: normal)
[   0.016][d][demux] Trying demuxer: edl (force-level: normal)
[   0.016][d][osd/libass] ASS library version: 0x1400001 (runtime 0x1400001)
[   0.016][d][demux] Trying demuxer: cue (force-level: normal)
[   0.016][d][demux] Trying demuxer: rawaudio (force-level: normal)
[   0.016][d][demux] Trying demuxer: rawvideo (force-level: normal)
[   0.016][d][demux] Trying demuxer: mkv (force-level: normal)
[   0.016][d][demux] Trying demuxer: lavf (force-level: normal)
[   0.017][v][osd/libass] Shaper: FriBidi 1.0.9 (SIMPLE)
[   0.017][v][osd/libass] Setting up fonts...
[   0.019][v][lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[   0.020][v][osd/libass] Using font provider directwrite
[   0.020][v][osd/libass] Done.
[   0.020][d][cplayer] Run command: define-section, flags=64, args=[name="input_osc", contents="", flags="default"]
[   0.020][d][cplayer] Run command: enable-section, flags=64, args=[name="input_osc", flags="allow-hide-cursor+allow-vo-dragging"]
[   0.020][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_osc", contents="", flags="force"]
[   0.020][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_osc", flags="allow-hide-cursor+allow-vo-dragging"]
[   0.020][d][osc] osc_init 
[   0.020][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"]
[   0.020][v][cplayer] Set property: shared-script-properties -> 1
[   0.021][v][demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[   0.021][v][cplayer] Opening done: lain_op.mp4
[   0.021][v][find_files] Loading external files in D:\Anime\
[   0.021][v][cplayer] Running hook: ytdl_hook/on_preloaded
[   0.021][v][lavf] select track 0
[   0.021][v][lavf] select track 1
[   0.022][i][cplayer]  (+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
[   0.023][i][cplayer]  (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[   0.023][v][vo/gpu] Probing for best GPU context.
[   0.023][v][vo/gpu/d3d11] Initializing GPU context 'd3d11'
[   0.091][v][vo/gpu/d3d11] Using Direct3D 11 feature level 12_1
[   0.091][v][vo/gpu/d3d11] Device Name: NVIDIA GeForce GTX 1080
[   0.091][v][vo/gpu/d3d11] Device ID: 10de:1b80 (rev a1)
[   0.091][v][vo/gpu/d3d11] Subsystem ID: 1462:3367
[   0.091][v][vo/gpu/d3d11] LUID: 000000000000b887
[   0.091][v][vo/gpu/d3d11] Initializing SPIR-V compiler 'shaderc'
[   0.091][v][vo/gpu/d3d11] Using Direct3D 11.1 runtime
[   0.091][v][vo/gpu/d3d11] Maximum Texture2D size: 16384x16384
[   0.092][v][vo/gpu/d3d11] D3DCompiler version: 10.0.19041.1
[   0.106][v][vo/gpu/d3d11] Using DXGI 1.2+
[   0.106][v][vo/gpu/d3d11] Queried output: \\.\DISPLAY1, 3840x2160 @ 8 bits, colorspace: RGB_FULL_G22_NONE_P709 (0)
[   0.106][v][vo/gpu/d3d11] Selected swapchain format R8G8B8A8_UNORM (28), attempting to utilize it.
[   0.107][v][vo/gpu/d3d11] Selected swapchain color space RGB_FULL_G22_NONE_P709 (0), attempting to utilize it.
[   0.107][v][vo/gpu/d3d11] Swapchain capabilities for color space RGB_FULL_G22_NONE_P709 (0): normal: yes, overlay: no
[   0.107][v][vo/gpu/d3d11] Swapchain successfully configured to color space RGB_FULL_G22_NONE_P709 (0)!
[   0.107][v][vo/gpu/d3d11] Using flip-model presentation
[   0.108][d][vo/gpu/d3d11] Texture formats:
[   0.108][d][vo/gpu/d3d11]   NAME       COMP*TYPE SIZE           DEPTH PER COMP.
[   0.108][d][vo/gpu/d3d11]   r8         1*unorm   1B    LF CR ST {8}
[   0.108][d][vo/gpu/d3d11]   rg8        2*unorm   2B    LF CR ST {8 8}
[   0.108][d][vo/gpu/d3d11]   rgba8      4*unorm   4B    LF CR ST {8 8 8 8}
[   0.108][d][vo/gpu/d3d11]   r16        1*unorm   2B    LF CR ST {16}
[   0.108][d][vo/gpu/d3d11]   rg16       2*unorm   4B    LF CR ST {16 16}
[   0.108][d][vo/gpu/d3d11]   rgba16     4*unorm   8B    LF CR ST {16 16 16 16}
[   0.108][d][vo/gpu/d3d11]   r32ui      1*uint    4B          ST {32}
[   0.108][d][vo/gpu/d3d11]   rg32ui     2*uint    8B          ST {32 32}
[   0.108][d][vo/gpu/d3d11]   rgb32ui    3*uint   12B             {32 32 32}
[   0.108][d][vo/gpu/d3d11]   rgba32ui   4*uint   16B          ST {32 32 32 32}
[   0.108][d][vo/gpu/d3d11]   r16hf      1*float   2B    LF CR ST {16}
[   0.108][d][vo/gpu/d3d11]   rg16hf     2*float   4B    LF CR ST {16 16}
[   0.108][d][vo/gpu/d3d11]   rgba16hf   4*float   8B    LF CR ST {16 16 16 16}
[   0.108][d][vo/gpu/d3d11]   r32f       1*float   4B    LF CR ST {32}
[   0.108][d][vo/gpu/d3d11]   rg32f      2*float   8B    LF CR ST {32 32}
[   0.108][d][vo/gpu/d3d11]   rgb32f     3*float  12B             {32 32 32}
[   0.108][d][vo/gpu/d3d11]   rgba32f    4*float  16B    LF CR ST {32 32 32 32}
[   0.108][d][vo/gpu/d3d11]   rgb10_a2   4*unorm   4B    LF CR ST {10 10 10 2}
[   0.108][d][vo/gpu/d3d11]   bgra8      4*unorm   4B    LF CR ST {8 8 8 8}
[   0.108][d][vo/gpu/d3d11]   bgrx8      3*unorm   4B    LF CR    {8 8 8}
[   0.108][d][vo/gpu/d3d11]  LA = LUMINANCE_ALPHA hack format
[   0.108][d][vo/gpu/d3d11]  LF = linear filterable
[   0.108][d][vo/gpu/d3d11]  CR = can be used for render targets
[   0.108][d][vo/gpu/d3d11]  ST = can be used for storable images
[   0.108][d][vo/gpu/d3d11] Image formats:
[   0.108][d][vo/gpu/d3d11]   yuv444p => 3 planes 1x1 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv420p => 3 planes 2x2 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   gray => 1 planes 1x1 8/0 [r8] (r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gray16 => 1 planes 1x1 16/0 [r16] (r) [unorm]
[   0.108][d][vo/gpu/d3d11]   uyvy422
[   0.108][d][vo/gpu/d3d11]   nv12 => 2 planes 2x2 8/0 [r8/rg8] (r/gb) [unorm]
[   0.108][d][vo/gpu/d3d11]   p010 => 2 planes 2x2 16/6 [r16/rg16] (r/gb) [unorm]
[   0.108][d][vo/gpu/d3d11]   argb => 1 planes 1x1 8/0 [rgba8] (argb) [unorm]
[   0.108][d][vo/gpu/d3d11]   bgra => 1 planes 1x1 8/0 [rgba8] (bgra) [unorm]
[   0.108][d][vo/gpu/d3d11]   abgr => 1 planes 1x1 8/0 [rgba8] (abgr) [unorm]
[   0.108][d][vo/gpu/d3d11]   rgba => 1 planes 1x1 8/0 [rgba8] (rgba) [unorm]
[   0.108][d][vo/gpu/d3d11]   bgr24
[   0.108][d][vo/gpu/d3d11]   rgb24
[   0.108][d][vo/gpu/d3d11]   0rgb => 1 planes 1x1 8/0 [rgba8] (_rgb) [unorm]
[   0.108][d][vo/gpu/d3d11]   bgr0 => 1 planes 1x1 8/0 [rgba8] (bgr) [unorm]
[   0.108][d][vo/gpu/d3d11]   0bgr => 1 planes 1x1 8/0 [rgba8] (_bgr) [unorm]
[   0.108][d][vo/gpu/d3d11]   rgb0 => 1 planes 1x1 8/0 [rgba8] (rgb) [unorm]
[   0.108][d][vo/gpu/d3d11]   rgba64 => 1 planes 1x1 16/0 [rgba16] (rgba) [unorm]
[   0.108][d][vo/gpu/d3d11]   rgb565
[   0.108][d][vo/gpu/d3d11]   pal8
[   0.108][d][vo/gpu/d3d11]   vdpau
[   0.108][d][vo/gpu/d3d11]   d3d11
[   0.108][d][vo/gpu/d3d11]   dxva2_vld
[   0.108][d][vo/gpu/d3d11]   mmal
[   0.108][d][vo/gpu/d3d11]   mediacodec
[   0.108][d][vo/gpu/d3d11]   drm_prime
[   0.108][d][vo/gpu/d3d11]   cuda
[   0.108][d][vo/gpu/d3d11]   yap8 => 2 planes 1x1 8/0 [r8/r8] (r/a) [unorm]
[   0.108][d][vo/gpu/d3d11]   yap16 => 2 planes 1x1 16/0 [r16/r16] (r/a) [unorm]
[   0.108][d][vo/gpu/d3d11]   grayaf32 => 2 planes 1x1 32/0 [r32f/r32f] (r/a) [float]
[   0.108][d][vo/gpu/d3d11]   yuv444pf => 3 planes 1x1 32/0 [r32f/r32f/r32f] (r/g/b) [float]
[   0.108][d][vo/gpu/d3d11]   yuva444pf => 4 planes 1x1 32/0 [r32f/r32f/r32f/r32f] (r/g/b/a) [float]
[   0.108][d][vo/gpu/d3d11]   yuv420pf => 3 planes 2x2 32/0 [r32f/r32f/r32f] (r/g/b) [float]
[   0.108][d][vo/gpu/d3d11]   yuva420pf => 4 planes 2x2 32/0 [r32f/r32f/r32f/r32f] (r/g/b/a) [float]
[   0.108][d][vo/gpu/d3d11]   yuv422pf => 3 planes 2x1 32/0 [r32f/r32f/r32f] (r/g/b) [float]
[   0.108][d][vo/gpu/d3d11]   yuva422pf => 4 planes 2x1 32/0 [r32f/r32f/r32f/r32f] (r/g/b/a) [float]
[   0.108][d][vo/gpu/d3d11]   yuv440pf => 3 planes 1x2 32/0 [r32f/r32f/r32f] (r/g/b) [float]
[   0.108][d][vo/gpu/d3d11]   yuva440pf => 4 planes 1x2 32/0 [r32f/r32f/r32f/r32f] (r/g/b/a) [float]
[   0.108][d][vo/gpu/d3d11]   yuv410pf => 3 planes 4x4 32/0 [r32f/r32f/r32f] (r/g/b) [float]
[   0.108][d][vo/gpu/d3d11]   yuva410pf => 4 planes 4x4 32/0 [r32f/r32f/r32f/r32f] (r/g/b/a) [float]
[   0.108][d][vo/gpu/d3d11]   yuv411pf => 3 planes 4x1 32/0 [r32f/r32f/r32f] (r/g/b) [float]
[   0.108][d][vo/gpu/d3d11]   yuva411pf => 4 planes 4x1 32/0 [r32f/r32f/r32f/r32f] (r/g/b/a) [float]
[   0.108][d][vo/gpu/d3d11]   rgb30
[   0.108][d][vo/gpu/d3d11]   y1 => 1 planes 1x1 8/-7 [r8] (r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp1 => 3 planes 1x1 8/-7 [r8/r8/r8] (g/b/r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp2 => 3 planes 1x1 8/-6 [r8/r8/r8] (g/b/r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp3 => 3 planes 1x1 8/-5 [r8/r8/r8] (g/b/r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp4 => 3 planes 1x1 8/-4 [r8/r8/r8] (g/b/r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp5 => 3 planes 1x1 8/-3 [r8/r8/r8] (g/b/r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp6 => 3 planes 1x1 8/-2 [r8/r8/r8] (g/b/r) [unorm]
[   0.108][d][vo/gpu/d3d11]   vdpau_output
[   0.108][d][vo/gpu/d3d11]   vaapi
[   0.108][d][vo/gpu/d3d11]   videotoolbox
[   0.108][d][vo/gpu/d3d11]   yuyv422
[   0.108][d][vo/gpu/d3d11]   yuv422p => 3 planes 2x1 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv410p => 3 planes 4x4 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv411p => 3 planes 4x1 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   monow
[   0.108][d][vo/gpu/d3d11]   monob
[   0.108][d][vo/gpu/d3d11]   yuvj422p => 3 planes 2x1 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   uyyvyy411
[   0.108][d][vo/gpu/d3d11]   bgr8
[   0.108][d][vo/gpu/d3d11]   bgr4
[   0.108][d][vo/gpu/d3d11]   bgr4_byte
[   0.108][d][vo/gpu/d3d11]   rgb8
[   0.108][d][vo/gpu/d3d11]   rgb4
[   0.108][d][vo/gpu/d3d11]   rgb4_byte
[   0.108][d][vo/gpu/d3d11]   nv21 => 2 planes 2x2 8/0 [r8/rg8] (r/bg) [unorm]
[   0.108][d][vo/gpu/d3d11]   gray16be
[   0.108][d][vo/gpu/d3d11]   yuv440p => 3 planes 1x2 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuvj440p => 3 planes 1x2 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuva420p => 4 planes 2x2 8/0 [r8/r8/r8/r8] (r/g/b/a) [unorm]
[   0.108][d][vo/gpu/d3d11]   rgb48be
[   0.108][d][vo/gpu/d3d11]   rgb48
[   0.108][d][vo/gpu/d3d11]   rgb565be
[   0.108][d][vo/gpu/d3d11]   rgb555be
[   0.108][d][vo/gpu/d3d11]   rgb555
[   0.108][d][vo/gpu/d3d11]   bgr565be
[   0.108][d][vo/gpu/d3d11]   bgr565
[   0.108][d][vo/gpu/d3d11]   bgr555be
[   0.108][d][vo/gpu/d3d11]   bgr555
[   0.108][d][vo/gpu/d3d11]   vaapi_moco
[   0.108][d][vo/gpu/d3d11]   vaapi_idct
[   0.108][d][vo/gpu/d3d11]   yuv420p16 => 3 planes 2x2 16/0 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv420p16be
[   0.108][d][vo/gpu/d3d11]   yuv422p16 => 3 planes 2x1 16/0 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv422p16be
[   0.108][d][vo/gpu/d3d11]   yuv444p16 => 3 planes 1x1 16/0 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv444p16be
[   0.108][d][vo/gpu/d3d11]   rgb444
[   0.108][d][vo/gpu/d3d11]   rgb444be
[   0.108][d][vo/gpu/d3d11]   bgr444
[   0.108][d][vo/gpu/d3d11]   bgr444be
[   0.108][d][vo/gpu/d3d11]   ya8 => 1 planes 1x1 8/0 [rg8] (ra) [unorm]
[   0.108][d][vo/gpu/d3d11]   bgr48be
[   0.108][d][vo/gpu/d3d11]   bgr48
[   0.108][d][vo/gpu/d3d11]   yuv420p9be
[   0.108][d][vo/gpu/d3d11]   yuv420p9 => 3 planes 2x2 16/-7 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv420p10be
[   0.108][d][vo/gpu/d3d11]   yuv420p10 => 3 planes 2x2 16/-6 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv422p10be
[   0.108][d][vo/gpu/d3d11]   yuv422p10 => 3 planes 2x1 16/-6 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv444p9be
[   0.108][d][vo/gpu/d3d11]   yuv444p9 => 3 planes 1x1 16/-7 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv444p10be
[   0.108][d][vo/gpu/d3d11]   yuv444p10 => 3 planes 1x1 16/-6 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   yuv422p9be
[   0.108][d][vo/gpu/d3d11]   yuv422p9 => 3 planes 2x1 16/-7 [r16/r16/r16] (r/g/b) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp => 3 planes 1x1 8/0 [r8/r8/r8] (g/b/r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp9be
[   0.108][d][vo/gpu/d3d11]   gbrp9 => 3 planes 1x1 16/-7 [r16/r16/r16] (g/b/r) [unorm]
[   0.108][d][vo/gpu/d3d11]   gbrp10be
[   0.109][d][vo/gpu/d3d11]   gbrp10 => 3 planes 1x1 16/-6 [r16/r16/r16] (g/b/r) [unorm]
[   0.109][d][vo/gpu/d3d11]   gbrp16be
[   0.109][d][vo/gpu/d3d11]   gbrp16 => 3 planes 1x1 16/0 [r16/r16/r16] (g/b/r) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva422p => 4 planes 2x1 8/0 [r8/r8/r8/r8] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva444p => 4 planes 1x1 8/0 [r8/r8/r8/r8] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva420p9be
[   0.109][d][vo/gpu/d3d11]   yuva420p9 => 4 planes 2x2 16/-7 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva422p9be
[   0.109][d][vo/gpu/d3d11]   yuva422p9 => 4 planes 2x1 16/-7 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva444p9be
[   0.109][d][vo/gpu/d3d11]   yuva444p9 => 4 planes 1x1 16/-7 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva420p10be
[   0.109][d][vo/gpu/d3d11]   yuva420p10 => 4 planes 2x2 16/-6 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva422p10be
[   0.109][d][vo/gpu/d3d11]   yuva422p10 => 4 planes 2x1 16/-6 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva444p10be
[   0.109][d][vo/gpu/d3d11]   yuva444p10 => 4 planes 1x1 16/-6 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva420p16be
[   0.109][d][vo/gpu/d3d11]   yuva420p16 => 4 planes 2x2 16/0 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva422p16be
[   0.109][d][vo/gpu/d3d11]   yuva422p16 => 4 planes 2x1 16/0 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva444p16be
[   0.109][d][vo/gpu/d3d11]   yuva444p16 => 4 planes 1x1 16/0 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   xyz12
[   0.109][d][vo/gpu/d3d11]   xyz12be
[   0.109][d][vo/gpu/d3d11]   nv16 => 2 planes 2x1 8/0 [r8/rg8] (r/gb) [unorm]
[   0.109][d][vo/gpu/d3d11]   nv20 => 2 planes 2x1 16/-6 [r16/rg16] (r/gb) [unorm]
[   0.109][d][vo/gpu/d3d11]   nv20be
[   0.109][d][vo/gpu/d3d11]   rgba64be
[   0.109][d][vo/gpu/d3d11]   bgra64be
[   0.109][d][vo/gpu/d3d11]   bgra64 => 1 planes 1x1 16/0 [rgba16] (bgra) [unorm]
[   0.109][d][vo/gpu/d3d11]   yvyu422
[   0.109][d][vo/gpu/d3d11]   ya16be
[   0.109][d][vo/gpu/d3d11]   ya16 => 1 planes 1x1 16/0 [rg16] (ra) [unorm]
[   0.109][d][vo/gpu/d3d11]   gbrap => 4 planes 1x1 8/0 [r8/r8/r8/r8] (g/b/r/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   gbrap16be
[   0.109][d][vo/gpu/d3d11]   gbrap16 => 4 planes 1x1 16/0 [r16/r16/r16/r16] (g/b/r/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   qsv
[   0.109][d][vo/gpu/d3d11]   d3d11va_vld
[   0.109][d][vo/gpu/d3d11]   yuv420p12be
[   0.109][d][vo/gpu/d3d11]   yuv420p12 => 3 planes 2x2 16/-4 [r16/r16/r16] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuv420p14be
[   0.109][d][vo/gpu/d3d11]   yuv420p14 => 3 planes 2x2 16/-2 [r16/r16/r16] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuv422p12be
[   0.109][d][vo/gpu/d3d11]   yuv422p12 => 3 planes 2x1 16/-4 [r16/r16/r16] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuv422p14be
[   0.109][d][vo/gpu/d3d11]   yuv422p14 => 3 planes 2x1 16/-2 [r16/r16/r16] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuv444p12be
[   0.109][d][vo/gpu/d3d11]   yuv444p12 => 3 planes 1x1 16/-4 [r16/r16/r16] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuv444p14be
[   0.109][d][vo/gpu/d3d11]   yuv444p14 => 3 planes 1x1 16/-2 [r16/r16/r16] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   gbrp12be
[   0.109][d][vo/gpu/d3d11]   gbrp12 => 3 planes 1x1 16/-4 [r16/r16/r16] (g/b/r) [unorm]
[   0.109][d][vo/gpu/d3d11]   gbrp14be
[   0.109][d][vo/gpu/d3d11]   gbrp14 => 3 planes 1x1 16/-2 [r16/r16/r16] (g/b/r) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuvj411p => 3 planes 4x1 8/0 [r8/r8/r8] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   bayer_bggr8
[   0.109][d][vo/gpu/d3d11]   bayer_rggb8
[   0.109][d][vo/gpu/d3d11]   bayer_gbrg8
[   0.109][d][vo/gpu/d3d11]   bayer_grbg8
[   0.109][d][vo/gpu/d3d11]   bayer_bggr16
[   0.109][d][vo/gpu/d3d11]   bayer_bggr16be
[   0.109][d][vo/gpu/d3d11]   bayer_rggb16
[   0.109][d][vo/gpu/d3d11]   bayer_rggb16be
[   0.109][d][vo/gpu/d3d11]   bayer_gbrg16
[   0.109][d][vo/gpu/d3d11]   bayer_gbrg16be
[   0.109][d][vo/gpu/d3d11]   bayer_grbg16
[   0.109][d][vo/gpu/d3d11]   bayer_grbg16be
[   0.109][d][vo/gpu/d3d11]   xvmc
[   0.109][d][vo/gpu/d3d11]   yuv440p10 => 3 planes 1x2 16/-6 [r16/r16/r16] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuv440p10be
[   0.109][d][vo/gpu/d3d11]   yuv440p12 => 3 planes 1x2 16/-4 [r16/r16/r16] (r/g/b) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuv440p12be
[   0.109][d][vo/gpu/d3d11]   ayuv64 => 1 planes 1x1 16/0 [rgba16] (argb) [unorm]
[   0.109][d][vo/gpu/d3d11]   ayuv64be
[   0.109][d][vo/gpu/d3d11]   p010be
[   0.109][d][vo/gpu/d3d11]   gbrap12be
[   0.109][d][vo/gpu/d3d11]   gbrap12 => 4 planes 1x1 16/-4 [r16/r16/r16/r16] (g/b/r/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   gbrap10be
[   0.109][d][vo/gpu/d3d11]   gbrap10 => 4 planes 1x1 16/-6 [r16/r16/r16/r16] (g/b/r/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   gray12be
[   0.109][d][vo/gpu/d3d11]   gray12 => 1 planes 1x1 16/-4 [r16] (r) [unorm]
[   0.109][d][vo/gpu/d3d11]   gray10be
[   0.109][d][vo/gpu/d3d11]   gray10 => 1 planes 1x1 16/-6 [r16] (r) [unorm]
[   0.109][d][vo/gpu/d3d11]   p016 => 2 planes 2x2 16/0 [r16/rg16] (r/gb) [unorm]
[   0.109][d][vo/gpu/d3d11]   p016be
[   0.109][d][vo/gpu/d3d11]   gray9be
[   0.109][d][vo/gpu/d3d11]   gray9 => 1 planes 1x1 16/-7 [r16] (r) [unorm]
[   0.109][d][vo/gpu/d3d11]   gbrpf32be
[   0.109][d][vo/gpu/d3d11]   gbrpf32 => 3 planes 1x1 32/0 [r32f/r32f/r32f] (g/b/r) [float]
[   0.109][d][vo/gpu/d3d11]   gbrapf32be
[   0.109][d][vo/gpu/d3d11]   gbrapf32 => 4 planes 1x1 32/0 [r32f/r32f/r32f/r32f] (g/b/r/a) [float]
[   0.109][d][vo/gpu/d3d11]   opencl
[   0.109][d][vo/gpu/d3d11]   gray14be
[   0.109][d][vo/gpu/d3d11]   gray14 => 1 planes 1x1 16/-2 [r16] (r) [unorm]
[   0.109][d][vo/gpu/d3d11]   grayf32be
[   0.109][d][vo/gpu/d3d11]   grayf32 => 1 planes 1x1 32/0 [r32f] (r) [float]
[   0.109][d][vo/gpu/d3d11]   yuva422p12be
[   0.109][d][vo/gpu/d3d11]   yuva422p12 => 4 planes 2x1 16/-4 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   yuva444p12be
[   0.109][d][vo/gpu/d3d11]   yuva444p12 => 4 planes 1x1 16/-4 [r16/r16/r16/r16] (r/g/b/a) [unorm]
[   0.109][d][vo/gpu/d3d11]   nv24 => 2 planes 1x1 8/0 [r8/rg8] (r/gb) [unorm]
[   0.109][d][vo/gpu/d3d11]   nv42 => 2 planes 1x1 8/0 [r8/rg8] (r/bg) [unorm]
[   0.109][d][vo/gpu/d3d11]   vulkan
[   0.109][d][vo/gpu/d3d11]   y210be
[   0.109][d][vo/gpu/d3d11]   y210
[   0.109][v][vo/gpu] Testing FBO format rgba16hf
[   0.109][d][vo/gpu] Resizing texture: 16x16
[   0.109][v][vo/gpu] Using FBO format rgba16hf.
[   0.109][v][vo/gpu] No advanced processing required. Enabling dumb mode.
[   0.109][v][vo/gpu/win32] DPI detected from the new API: 144
[   0.109][v][vo/gpu/win32] display-fps: 59.997000
[   0.112][v][vo/gpu/win32] color-profile: C:\WINDOWS\system32\spool\drivers\color\P2415Q.icm
[   0.113][v][vo/gpu] Assuming 59.997000 FPS for display sync.
[   0.113][v][decode_wrapper/vd] Container reported FPS: 23.976027
[   0.115][v][decode_wrapper/vd] Codec list:
[   0.115][v][decode_wrapper/vd]     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[   0.115][v][decode_wrapper/vd] Opening decoder h264
[   0.115][v][decode_wrapper/vd] No hardware decoding requested.
[   0.115][v][decode_wrapper/vd] Using software decoding.
[   0.115][v][decode_wrapper/vd] Detected 8 logical cores.
[   0.115][v][decode_wrapper/vd] Requesting 9 threads for decoding.
[   0.116][v][decode_wrapper/vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
[   0.116][v][vf] User filter list:
[   0.116][v][vf]   (empty)
[   0.116][v][decode_wrapper/ad] Codec list:
[   0.116][v][decode_wrapper/ad]     aac - AAC (Advanced Audio Coding)
[   0.116][v][decode_wrapper/ad]     aac_fixed (aac) - AAC (Advanced Audio Coding)
[   0.116][v][decode_wrapper/ad] Opening decoder aac
[   0.116][v][decode_wrapper/ad] Requesting 1 threads for decoding.
[   0.118][v][decode_wrapper/ad] Selected codec: aac (AAC (Advanced Audio Coding))
[   0.118][v][af] User filter list:
[   0.118][v][af]   (empty)
[   0.118][v][cplayer] Starting playback...
[   0.118][d][osc] osc_init 
[   0.118][v][af] [in] 48000Hz stereo 2ch floatp
[   0.118][v][af] [userspeed] 48000Hz stereo 2ch floatp
[   0.118][v][af] [userspeed] (disabled)
[   0.118][v][af] [convert] 48000Hz stereo 2ch floatp
[   0.118][d][ffmpeg/video] h264: Reinit context to 1920x1088, pix_fmt: yuv420p
[   0.119][d][decode_wrapper/vd] DR parameter change to 1920x1090 yuv420p align=64
[   0.119][d][decode_wrapper/vd] Allocating new DR image...
[   0.119][d][decode_wrapper/vd] ...failed..
[   0.119][v][decode_wrapper/vd] DR failed - disabling.
[   0.141][v][decode_wrapper/vd] Using software decoding.
[   0.141][v][decode_wrapper/vd] Decoder format: 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264
[   0.141][v][decode_wrapper/vd] Using container aspect ratio.
[   0.141][v][vf] [in] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   0.141][v][vf] [userdeint] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   0.141][v][vf] [userdeint] (disabled)
[   0.141][v][vf] [autorotate] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   0.141][v][vf] [autorotate] (disabled)
[   0.141][v][vf] [convert] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   0.141][v][vf] [convert] (disabled)
[   0.141][v][vf] [out] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   0.141][v][ao] Trying audio driver 'wasapi'
[   0.141][v][ao/wasapi] requested format: 48000 Hz, stereo channels, floatp
[   0.141][d][ao/wasapi] Init wasapi
[   0.141][d][ao/wasapi] Find device ''
[   0.144][v][ao/wasapi] No device specified. Selecting default.
[   0.145][v][ao/wasapi] Selecting device '{78ccf0a1-8d44-4c9e-862b-5b7328bdfe0a}' (Speakers (Realtek High Definition Audio))
[   0.145][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{78ccf0a1-8d44-4c9e-862b-5b7328bdfe0a}
[   0.147][d][ao/wasapi] Init wasapi thread
[   0.147][d][ao/wasapi] Activating pAudioClient interface
[   0.149][d][ao/wasapi] Probing formats
[   0.156][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.157][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.157][v][ao/wasapi] Trying stereo s32 (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.158][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.158][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 44100hz (exclusive) -> ok
[   0.158][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 96000hz (exclusive) -> ok
[   0.159][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 88200hz (exclusive) -> unsupported
[   0.159][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 192000hz (exclusive) -> ok
[   0.159][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 176400hz (exclusive) -> unsupported
[   0.160][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 32000hz (exclusive) -> unsupported
[   0.160][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 22050hz (exclusive) -> unsupported
[   0.161][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 11025hz (exclusive) -> unsupported
[   0.162][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 8000hz (exclusive) -> unsupported
[   0.162][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 16000hz (exclusive) -> unsupported
[   0.163][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 352800hz (exclusive) -> unsupported
[   0.163][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 384000hz (exclusive) -> unsupported
[   0.163][v][ao/wasapi] Trying 5.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.164][v][ao/wasapi] Trying 7.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.164][v][ao/wasapi] Trying 6.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.165][v][ao/wasapi] Trying mono s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.165][v][ao/wasapi] Trying 2.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.166][v][ao/wasapi] Trying 4.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.166][v][ao/wasapi] Trying 5.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.166][v][ao/wasapi] Trying 3.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.167][v][ao/wasapi] Trying 3.0(back) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.167][v][ao/wasapi] Trying quad s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.168][v][ao/wasapi] Trying quad(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.168][v][ao/wasapi] Trying 3.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.169][v][ao/wasapi] Trying 5.0(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.169][v][ao/wasapi] Trying 4.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.169][v][ao/wasapi] Trying 5.1(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.170][v][ao/wasapi] Trying 6.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.171][v][ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.171][v][ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.172][v][ao/wasapi] Trying 6.1(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.173][v][ao/wasapi] Trying 7.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.173][v][ao/wasapi] Trying 7.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.174][v][ao/wasapi] Trying 7.1(wide) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.174][v][ao/wasapi] Trying 7.1(wide-side) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.174][v][ao/wasapi] Trying empty s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.174][v][ao/wasapi] Trying octagonal s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.174][v][ao/wasapi] Channel layouts:
[   0.174][v][ao/wasapi]  - stereo
[   0.174][v][ao/wasapi]  - 5.1
[   0.174][v][ao/wasapi]  - 7.1
[   0.174][v][ao/wasapi]  - quad
[   0.174][v][ao/wasapi]  - 7.1(wide)
[   0.174][v][ao/wasapi]  - 7.1(wide-side)
[   0.174][v][ao/wasapi]  - 7.1(rear)
[   0.174][v][ao/wasapi]  - octagonal
[   0.174][v][ao/wasapi] result: stereo
[   0.174][v][ao/wasapi] Accepted as stereo s32 @ 48000hz -> stereo s32 (32/24 bits) @ 48000hz (exclusive)
[   0.174][d][ao/wasapi] Fixing format
[   0.174][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.175][v][ao/wasapi] Device period: 10 ms
[   0.175][d][ao/wasapi] IAudioClient::Initialize
[   0.183][d][ao/wasapi] IAudioClient::Initialize pRenderClient
[   0.183][d][ao/wasapi] IAudioClient::Initialize IAudioClient_SetEventHandle
[   0.183][d][ao/wasapi] IAudioClient::Initialize IAudioClient_GetBufferSize
[   0.183][v][ao/wasapi] Buffer frame count: 480 (10 ms)
[   0.183][v][ao/wasapi] IAudioClock::GetFrequency gave a frequency of 48000.
[   0.186][d][ao/wasapi] Activating pEndpointVolume interface
[   0.186][d][ao/wasapi] IAudioEndpointVolume::QueryHardwareSupport
[   0.186][d][ao/wasapi] Entering dispatch loop
[   0.186][d][ao/wasapi] Init wasapi done
[   0.186][v][ao/wasapi] device buffer: 480 samples.
[   0.186][v][ao/wasapi] using soft-buffer of 9600 samples.
[   0.187][i][cplayer] AO: [wasapi] 48000Hz stereo 2ch s32
[   0.187][v][cplayer] AO: Description: Windows WASAPI audio output (event mode)
[   0.187][d][ao/wasapi] Thread Resume
[   0.187][d][ao/wasapi] Thread Reset
CounterPillow commented 4 years ago
[   0.187][d][ao/wasapi] Thread Resume
[   0.187][d][ao/wasapi] Thread Reset

buffer.c calls start which is now audio_resume in wasapi, which resets the thread (where it does arrive, judging by the log line) and should then feed new data. Can you add some debug prints in thread_feed to see whether it ever enters the function, and whether it ever gets past ao_read_data_converted?

ao_read_data_converted calls ao_read_data which acquires a lock, which makes me think there's a deadlock here somewhere.

CounterPillow commented 4 years ago

And here's why this is exclusive to stream_silence:

https://github.com/mpv-player/mpv/blob/master/audio/out/buffer.c#L556-L559

CounterPillow commented 4 years ago

I think JEEB's issue is real and OP's issue seems invalid, nothing was changed in how "[ 0.570][e][ao/wasapi] Error initializing device: AUDCLNT_E_DEVICE_IN_USE (0x8889000a)" could happen; we don't initialize the device twice as far as I can see. What could of course be the case is that the OP has a deadlocked mpv running in the background hogging an exclusive mode device.

@Doofussy2 Please confirm that no other mpv process is running in the background while you're capturing that log, like actually check in task manager's details view searching for mpv.exe.

Doofussy2 commented 4 years ago

I'm happy to provide anything you need. Just let me know how to provide what you need.

I've run the testing many times and mpv is not running in the background. But what I'll do is reboot the machine and run the test again directly after reboot and I'll attach a trace log. How do I add the debugging that would help?

I'll also try connecting the computer directly to the display, and see if I can reproduce the same issue. But the previous builds have no issues at all. It works perfectly. I have an RTX 2060 connected to Marantz receiver if that is of any help.

CounterPillow commented 4 years ago

How do I add the debugging that would help?

from your side I only need to know whether the issue you're experiencing is actually an mpv issue and not just Windows going "you can't have this device", because right now yours looks like that, and JEEB's looks like some issue, and my guess is that you may be experiencing the same thing but grabbing the mpv log after there's already a deadlocked mpv in the background.

Doofussy2 commented 4 years ago

The first log is indeed after mpv was deadlocked. The subsequent log I posted, is not. I cleared it before rerunning the test. And again, even with the 'deadlock' the previous build still works correctly.

Doofussy2 commented 4 years ago

OK, If I use the Realtek audio as @jeeb did, it works.

[   0.183][v][ao] Trying audio driver 'wasapi'
[   0.183][v][ao/wasapi] requested format: 48000 Hz, 5.1(side) channels, floatp
[   0.183][d][ao/wasapi] Init wasapi
[   0.183][d][ao/wasapi] Find device ''
[   0.188][v][ao/wasapi] No device specified. Selecting default.
[   0.192][v][ao/wasapi] Selecting device '{8069fed1-f9ba-4d9e-93ef-ca1f1f6d114a}' (Realtek Digital Output (Realtek High Definition Audio))
[   0.192][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{8069fed1-f9ba-4d9e-93ef-ca1f1f6d114a}
[   0.197][d][ao/wasapi] Init wasapi thread
[   0.197][d][ao/wasapi] Activating pAudioClient interface
[   0.201][d][ao/wasapi] Probing formats
[   0.205][v][ao/wasapi] Trying 5.1(side) float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.205][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.205][v][ao/wasapi] Trying stereo s32 (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.206][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.206][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 44100hz (exclusive) -> ok
[   0.206][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 96000hz (exclusive) -> ok
[   0.206][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 88200hz (exclusive) -> ok
[   0.206][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 192000hz (exclusive) -> unsupported
[   0.206][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 176400hz (exclusive) -> unsupported
[   0.207][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 32000hz (exclusive) -> ok
[   0.207][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 22050hz (exclusive) -> unsupported
[   0.207][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 11025hz (exclusive) -> unsupported
[   0.207][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 8000hz (exclusive) -> unsupported
[   0.207][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 16000hz (exclusive) -> unsupported
[   0.208][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 352800hz (exclusive) -> unsupported
[   0.208][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 384000hz (exclusive) -> unsupported
[   0.208][v][ao/wasapi] Trying 5.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.208][v][ao/wasapi] Trying 7.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.208][v][ao/wasapi] Trying 6.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.208][v][ao/wasapi] Trying mono s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.209][v][ao/wasapi] Trying 2.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.209][v][ao/wasapi] Trying 4.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.209][v][ao/wasapi] Trying 5.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.209][v][ao/wasapi] Trying 3.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.209][v][ao/wasapi] Trying 3.0(back) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.210][v][ao/wasapi] Trying quad s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.210][v][ao/wasapi] Trying quad(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.210][v][ao/wasapi] Trying 3.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.210][v][ao/wasapi] Trying 5.0(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.210][v][ao/wasapi] Trying 4.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.210][v][ao/wasapi] Trying 5.1(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.211][v][ao/wasapi] Trying 6.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.211][v][ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.211][v][ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.211][v][ao/wasapi] Trying 6.1(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.211][v][ao/wasapi] Trying 7.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.212][v][ao/wasapi] Trying 7.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.212][v][ao/wasapi] Trying 7.1(wide) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.212][v][ao/wasapi] Trying 7.1(wide-side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.212][v][ao/wasapi] Trying empty s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.212][v][ao/wasapi] Trying octagonal s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.212][v][ao/wasapi] Channel layouts:
[   0.212][v][ao/wasapi]  - stereo
[   0.212][v][ao/wasapi] result: stereo
[   0.212][v][ao/wasapi] Accepted as stereo s32 @ 48000hz -> stereo s32 (32/24 bits) @ 48000hz (exclusive)
[   0.212][d][ao/wasapi] Fixing format
[   0.212][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.213][v][ao/wasapi] Device period: 10 ms
[   0.213][d][ao/wasapi] IAudioClient::Initialize
[   0.224][d][ao/wasapi] IAudioClient::Initialize pRenderClient
[   0.224][d][ao/wasapi] IAudioClient::Initialize IAudioClient_SetEventHandle
[   0.224][d][ao/wasapi] IAudioClient::Initialize IAudioClient_GetBufferSize
[   0.224][v][ao/wasapi] Buffer frame count: 480 (10 ms)
[   0.224][v][ao/wasapi] IAudioClock::GetFrequency gave a frequency of 48000.
[   0.231][d][ao/wasapi] Activating pEndpointVolume interface
[   0.232][d][ao/wasapi] IAudioEndpointVolume::QueryHardwareSupport
[   0.232][d][ao/wasapi] Entering dispatch loop
[   0.232][d][ao/wasapi] Init wasapi done
[   0.232][v][ao/wasapi] device buffer: 480 samples.
[   0.232][v][ao/wasapi] using soft-buffer of 9600 samples.
[   0.232][d][ao/wasapi] Thread Resume
[   0.232][d][ao/wasapi] Thread Reset
[   0.232][i][cplayer] AO: [wasapi] 48000Hz stereo 2ch s32

But that is an invalid test. This is specifically with an AVR over HDMI. Let's compare apples to apples, not apples to oranges.

Doofussy2 commented 4 years ago

Using the AVR, these are the final log entries. This is how far mpv gets.

[   0.203][v][ao] Trying audio driver 'wasapi'
[   0.203][v][ao] Using preferred device 'marantz-AVR (NVIDIA High Definition Audio)'
[   0.203][v][ao/wasapi] requested format: 48000 Hz, 5.1(side) channels, floatp
[   0.203][d][ao/wasapi] Init wasapi
[   0.203][d][ao/wasapi] Find device 'marantz-AVR (NVIDIA High Definition Audio)'
[   0.209][v][ao/wasapi] Selecting device by name: 'marantz-AVR (NVIDIA High Definition Audio)'
[   0.209][v][ao/wasapi] Selecting device '{c1c15a76-685b-43e9-8490-4bce3b8d7285}' (marantz-AVR (NVIDIA High Definition Audio))
[   0.209][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{c1c15a76-685b-43e9-8490-4bce3b8d7285}
[   0.215][d][ao/wasapi] Init wasapi thread
[   0.215][d][ao/wasapi] Activating pAudioClient interface
[   0.219][d][ao/wasapi] Probing formats
[   0.227][v][ao/wasapi] Trying 5.1(side) float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.227][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.227][v][ao/wasapi] Trying stereo s32 (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.227][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.227][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 44100hz (exclusive) -> ok
[   0.228][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 96000hz (exclusive) -> ok
[   0.228][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 88200hz (exclusive) -> ok
[   0.228][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 192000hz (exclusive) -> ok
[   0.228][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 176400hz (exclusive) -> ok
[   0.228][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 32000hz (exclusive) -> ok
[   0.229][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 22050hz (exclusive) -> unsupported
[   0.229][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 11025hz (exclusive) -> unsupported
[   0.229][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 8000hz (exclusive) -> unsupported
[   0.229][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 16000hz (exclusive) -> unsupported
[   0.229][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 352800hz (exclusive) -> unsupported
[   0.230][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 384000hz (exclusive) -> unsupported
[   0.230][v][ao/wasapi] Trying 5.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.230][v][ao/wasapi] Trying 7.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.230][v][ao/wasapi] Trying 6.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.230][v][ao/wasapi] Trying mono s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.231][v][ao/wasapi] Trying 2.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.231][v][ao/wasapi] Trying 4.0 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.231][v][ao/wasapi] Trying 5.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.231][v][ao/wasapi] Trying 3.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.231][v][ao/wasapi] Trying 3.0(back) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.232][v][ao/wasapi] Trying quad s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.232][v][ao/wasapi] Trying quad(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.232][v][ao/wasapi] Trying 3.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.232][v][ao/wasapi] Trying 5.0(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.232][v][ao/wasapi] Trying 4.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.233][v][ao/wasapi] Trying 5.1(side) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.233][v][ao/wasapi] Trying 6.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.233][v][ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.233][v][ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.233][v][ao/wasapi] Trying 6.1(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.234][v][ao/wasapi] Trying 7.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.234][v][ao/wasapi] Trying 7.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.234][v][ao/wasapi] Trying 7.1(wide) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.234][v][ao/wasapi] Trying 7.1(wide-side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.234][v][ao/wasapi] Trying empty s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.234][v][ao/wasapi] Trying octagonal s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.235][v][ao/wasapi] Disabling multichannel output.
[   0.235][v][ao/wasapi] Channel layouts:
[   0.235][v][ao/wasapi]  - stereo
[   0.235][v][ao/wasapi]  - 5.1
[   0.235][v][ao/wasapi]  - 7.1
[   0.235][v][ao/wasapi]  - 4.0
[   0.235][v][ao/wasapi]  - quad
[   0.235][v][ao/wasapi]  - 5.1(side)
[   0.235][v][ao/wasapi]  - 7.1(wide)
[   0.235][v][ao/wasapi] result: stereo
[   0.235][v][ao/wasapi] Accepted as stereo s32 @ 48000hz -> stereo s32 (32/24 bits) @ 48000hz (exclusive)
[   0.235][d][ao/wasapi] Fixing format
[   0.235][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.235][v][ao/wasapi] Device period: 10 ms
[   0.235][d][ao/wasapi] IAudioClient::Initialize
[   0.280][d][ao/wasapi] IAudioClient::Initialize pRenderClient
[   0.280][d][ao/wasapi] IAudioClient::Initialize IAudioClient_SetEventHandle
[   0.280][d][ao/wasapi] IAudioClient::Initialize IAudioClient_GetBufferSize
[   0.280][v][ao/wasapi] Buffer frame count: 480 (10 ms)
[   0.280][v][ao/wasapi] IAudioClock::GetFrequency gave a frequency of 48000.
[   0.287][d][ao/wasapi] Activating pEndpointVolume interface
[   0.288][d][ao/wasapi] IAudioEndpointVolume::QueryHardwareSupport
[   0.288][d][ao/wasapi] Entering dispatch loop
[   0.288][d][ao/wasapi] Init wasapi done
[   0.288][v][ao/wasapi] device buffer: 480 samples.
[   0.288][v][ao/wasapi] using soft-buffer of 9600 samples.
[   0.288][d][ao/wasapi] Thread Resume
[   0.288][d][ao/wasapi] Thread Reset
[   0.288][i][cplayer] AO: [wasapi] 48000Hz stereo 2ch s32
[   0.288][v][cplayer] AO: Description: Windows WASAPI audio output (event mode)
[   0.288][t][ao/wasapi] Frame to fill: 480. Padding: 480
[   0.288][t][ao/wasapi] Device delay: -3.2 us
Doofussy2 commented 4 years ago

On repeating the test, setting the device delay is the exact same point it ends. So maybe that's the issue? The device delay is somehow incorrect?

Doofussy2 commented 4 years ago

With the build from the 24th (which works correctly), the delay is set to -3.4 not -3.2. So I think that must be the problem.

[   0.277][t][ao/wasapi] Device delay: -3.4 us
Doofussy2 commented 4 years ago

Is there a way I can manually set that delay? So I can test the theory.

ghost commented 4 years ago

I think it's just a coincidence that this is the last log line. The delay probably randomly changes by your audio driver; 200ns is nothing.

Doofussy2 commented 4 years ago

I guess I'll just have to disable exclusivity...

kevmitch commented 4 years ago

To summarize discussion on IRC.

This is caused by b83bdd1d17cc90b4d8cd2a32321cd7c5cc306422, which introduced locking to the pull API used by wasapi (and others). This causes a deadlock when audio_out_wasapi->control() is called while a request from the driver for more audio data is being served.

control uses mp_dispatch_run to syncronously run commands in the audio thread and now holds a lock while doing so. The audio thread is not able to service that request until it is done feeding, which never happens because it gets stuck waiting for the same lock when it callsao_read_data_converted.

There are two solutions: 1) don't syncronously wait for the control commands to complete, just queue them up with mp_dispatch_enqueue and hope for the best. 2) create buffer_lock() / buffer_unlock() functions, that skip acquiring the lock for pull mode aos.

Doofussy2 commented 4 years ago

I'm glad that you guys were able to get to the root of the issue. Hopefully, a fix will be forthcoming?

CounterPillow commented 4 years ago

If the lock is not needed, I think solution 2 is the better one here. Reducing the amount of locking will also prevent future changes from accidentally introducing another deadlock in the wasapi code.

qyot27 commented 4 years ago

Does control also take care of volume changes? Because those lock issues would help explain why mpv was suddenly hanging whenever I'd use volume up/down with --ao=wasapi on recent builds.

kevmitch commented 4 years ago

yes, volume is handled by ao control, so that will trigger this.