Jump to content

No sound with refresh rate switching


Guest asrequested

Recommended Posts

Guest asrequested

Just got a new mini PC, it's connected directly to my TV. Without refresh rate switching, everything works just fine. But with refresh rate switching, mpv can't find the audio device.

[   2.811][i][refreshrate] Current Refresh Rate -: 29 
[   2.811][i][refreshrate] Pausing Playback for 3 second(s) 
[   2.877][d][ao/wasapi] Uninit wasapi done
[   2.877][v][af] User filter list:
[   2.877][v][af]   (empty)
[   2.877][v][af] [in] 48000Hz stereo 2ch floatp
[   2.877][v][af] [userspeed] 48000Hz stereo 2ch floatp
[   2.877][v][af] [convert] 48000Hz stereo 2ch floatp
[   2.877][v][ao] Trying audio driver 'wasapi'
[   2.877][v][ao/wasapi] requested format: 48000 Hz, stereo channels, floatp
[   2.877][d][ao/wasapi] Init wasapi
[   2.877][d][ao/wasapi] Find device ''
[   2.882][e][ao/wasapi] There are no playback devices available
[   2.882][d][ao/wasapi] Uninit wasapi
[   2.882][d][ao/wasapi] Uninit wasapi done
[   2.882][v][ao] Trying audio driver 'openal'
[   2.882][v][ao/openal] requested format: 48000 Hz, stereo channels, floatp
[   2.909][f][ao/openal] could not open device
[   2.909][e][ao] Failed to initialize audio driver 'openal'
[   2.909][e][cplayer] Could not open/initialize audio device -> no sound.
[   2.909][v][ad] Uninit decoder.
[   2.909][v][lavf] deselect track 1
[   2.910][i][cplayer] Audio: no audio
[   5.812][v][cplayer] Set property: pause="no" -> 1
[   5.813][i][refreshrate] Manually Setting Display-FPS Property -: 29 
[   5.834][v][cplayer] Set property: display-fps="29" -> 1
Link to comment
Share on other sites

Guest asrequested

Can you try without your custom mpv.conf?

 

I've tried everything, and it's always the same. As a comparison, on my main HTPC (which is much more complicated), it works fine.

Link to comment
Share on other sites

Guest asrequested

But just for good measure, I connected it to my main display and removed all of my configs. Same result.

[   1.118][v][cplayer] playback restart complete
[   1.141][i][cplayer] Track switched:
[   1.141][i][cplayer]  (+) Video --vid=1 (mpeg2video 1920x1080 29.970fps)
[   1.141][i][cplayer]  (+) Audio --aid=1 --alang=eng (ac3 6ch 48000Hz)
[   1.141][i][cplayer]      Audio --aid=2 --alang=spa (ac3 1ch 48000Hz)
[   1.141][i][cplayer]      Subs  --sid=1 (*) (eia_608)
[   1.141][v][cplayer] Set property: aid=1 -> 1
[   1.145][i][cplayer] Track switched:
[   1.145][i][cplayer]  (+) Video --vid=1 (mpeg2video 1920x1080 29.970fps)
[   1.145][i][cplayer]  (+) Audio --aid=1 --alang=eng (ac3 6ch 48000Hz)
[   1.145][i][cplayer]      Audio --aid=2 --alang=spa (ac3 1ch 48000Hz)
[   1.145][i][cplayer]      Subs  --sid=1 (*) (eia_608)
[   1.145][v][cplayer] Set property: sid="no" -> 1
[   1.277][w][ao/wasapi] Under-run: Device delay: -0.6 us
[   1.312][i][refreshrate] Possible Refresh Rates (Actual) -: 23;24;25;29;30;50;59;60;23;23;24;24;25;25;29;29;30;30;50;50;59;59;60;60 
[   1.314][i][refreshrate] Refresh Ajustment Script Enabled 
[   1.315][i][refreshrate] New Media Loaded #1, Estimated Refresh Rate -: 29.970029830933, Type -: container-fps 
[   1.315][i][refreshrate] Calculating Refresh Rates 
[   1.315][i][refreshrate] Calculated Refresh Rates (Script) -: 29;30;60 
[   1.315][i][refreshrate] Current Refresh Rate -: 59, Requested Rates -: 29;30;60 
[   1.316][d][ao/wasapi] Thread Reset
[   1.316][v][cplayer] Set property: pause="yes" -> 1
[   1.787][v][ao/wasapi] OnPropertyValueChanged triggered on device {0.0.0.00000000}.{91ae8216-d9c0-474c-bdfd-890c75e36109}
[   1.787][v][ao/wasapi] Changed property: {9855c4cd-df8c-449c-a181-8191b68bd06c},0
[   4.320][v][ao/wasapi] OnDeviceStateChanged triggered on device {0.0.0.00000000}.{91ae8216-d9c0-474c-bdfd-890c75e36109}: requesting ao reload
[   4.320][v][ao/wasapi] OnDefaultDeviceChanged triggered: requesting ao reload
[   4.320][d][ao/wasapi] Uninit wasapi
[   4.320][d][ao/wasapi] Thread Reset
[   4.320][d][ao/wasapi] Thread Reset
[   4.320][d][ao/wasapi] Thread shutdown
[   4.350][d][ao/wasapi] Thread uninit done
[   4.351][d][ao/wasapi] Thread return
[   4.436][d][ao/wasapi] Uninit wasapi done
[   4.436][v][af] User filter list:
[   4.436][v][af]   (empty)
[   4.436][v][af] [in] 48000Hz stereo 2ch floatp
[   4.436][v][af] [userspeed] 48000Hz stereo 2ch floatp
[   4.436][v][af] [convert] 48000Hz stereo 2ch floatp
[   4.436][v][ao] Trying audio driver 'wasapi'
[   4.436][v][ao/wasapi] requested format: 48000 Hz, stereo channels, floatp
[   4.436][d][ao/wasapi] Init wasapi
[   4.436][d][ao/wasapi] Find device ''
[   4.439][e][ao/wasapi] There are no playback devices available
[   4.440][d][ao/wasapi] Uninit wasapi
[   4.440][d][ao/wasapi] Uninit wasapi done
[   4.440][v][ao] Trying audio driver 'openal'
[   4.440][v][ao/openal] requested format: 48000 Hz, stereo channels, floatp
[   4.562][f][ao/openal] could not open device
[   4.562][e][ao] Failed to initialize audio driver 'openal'
[   4.562][e][cplayer] Could not open/initialize audio device -> no sound.
[   4.562][v][ad] Uninit decoder.
[   4.563][v][lavf] deselect track 1
[   4.567][i][cplayer] Audio: no audio
[   4.609][i][refreshrate] Current Refresh Rate -: 29 
[   4.610][i][refreshrate] Pausing Playback for 3 second(s) 
[   7.610][v][cplayer] Set property: pause="no" -> 1
[   7.610][i][refreshrate] Manually Setting Display-FPS Property -: 29 
Edited by Doofus
Link to comment
Share on other sites

Guest asrequested

So mpv is failing to initialize the audio driver.

 

It's looks like something like that. What seems to be happening is it starts playing, I get a split second of picture and sound, switching completes, I get video with no sound.

Link to comment
Share on other sites

Guest asrequested

This is the part that I see/hear at the beginning before switching begins.

[   0.496][v][cplayer] Starting playback...
[   0.497][i][refreshrate] Using monitor -:\\.\DISPLAY1 
[   0.497][i][refreshrate] Querying Refresh Rate... 
[   0.498][v][af] [in] 48000Hz stereo 2ch floatp
[   0.498][v][af] [userspeed] 48000Hz stereo 2ch floatp
[   0.498][v][af] [userspeed] (disabled)
[   0.498][v][af] [convert] 48000Hz stereo 2ch floatp
[   0.499][v][ao] Trying audio driver 'wasapi'
[   0.499][v][ao/wasapi] requested format: 48000 Hz, stereo channels, floatp
[   0.499][d][ao/wasapi] Init wasapi
[   0.499][d][ao/wasapi] Find device ''
[   0.519][v][ao/wasapi] No device specified. Selecting default.
[   0.533][v][ao/wasapi] Selecting device '{91ae8216-d9c0-474c-bdfd-890c75e36109}' (M55-E0 (Intel(R) Display Audio))
[   0.533][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{91ae8216-d9c0-474c-bdfd-890c75e36109}
[   0.545][d][ao/wasapi] Init wasapi thread
[   0.545][d][ao/wasapi] Activating pAudioClient interface
[   0.553][d][ao/wasapi] Probing formats
[   0.554][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (shared) -> ok
[   0.554][v][ao/wasapi] Accepted as stereo float @ 48000hz -> stereo float (32/32 bits) @ 48000hz (shared)
Link to comment
Share on other sites

Guest asrequested

Looking at the log again, it appears that it thinks the audio device was changed. Can you augment it to remember the audio device and use it after the switch?

Link to comment
Share on other sites

Guest asrequested

That's what I mean. The switching is ostensibly disregarding the prior initialization. Maybe if it retained the device IDs, it could just reapply them?

Link to comment
Share on other sites

Guest asrequested

I tried specifying the audio device in the mpv.conf, but if the IDs are lost, then obviously it doesn't work.

 

I will say that it's a bit weird that the file starts playing before the switch happens. Maybe that's the answer? To adjust the timing, so the switch happens before playback begins?

Link to comment
Share on other sites

Guest asrequested

Here's another thought. Maybe it isn't giving the audio device enough time to reinitialize? Are there any delays that can be adjusted? I imagine we're only talking tenths or hundredths of a second. When playing normally, the audio device is already started, but when switching it's getting restarted, so maybe it just needs a little more time?

Edited by Doofus
Link to comment
Share on other sites

Hmm, yea, hopefully by increasing it. I forget what problem that is trying to solve, but i'm not sure we can just remove it.

Link to comment
Share on other sites

Guest asrequested

It's wasapi that's it's delaying. I think maybe my GPU takes just a little longer to cycle through. You happen to know what line that is in the scrpit?

Link to comment
Share on other sites

Guest asrequested

I think I just spotted an anomaly. This is where it appears to lose the device ID, specifically the name. These two lines should be the same.

[ 0.533][v][ao/wasapi] Selecting device '{91ae8216-d9c0-474c-bdfd-890c75e36109}' (M55-E0 (Intel® Display Audio))
[ 0.533][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{91ae8216-d9c0-474c-bdfd-890c75e36109}

Edited by Doofus
Link to comment
Share on other sites

Guest asrequested

Ok, I was wrong about that, but it did lead me to what I think is going wrong.

 

This is the correct initialization.

[   0.499][d][ao/wasapi] Init wasapi
[   0.499][d][ao/wasapi] Find device ''
[   0.519][v][ao/wasapi] No device specified. Selecting default.
[   0.533][v][ao/wasapi] Selecting device '{91ae8216-d9c0-474c-bdfd-890c75e36109}' (M55-E0 (Intel(R) Display Audio))
[   0.533][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{91ae8216-d9c0-474c-bdfd-890c75e36109}

But what looks to be happening is that when reinitializing after the refresh rate switch, is that it's choosing that last line as the device. That won't work. It needs to use the actual device name and ID. This is from the log after the switch.

[   1.787][v][ao/wasapi] OnPropertyValueChanged triggered on device {0.0.0.00000000}.{91ae8216-d9c0-474c-bdfd-890c75e36109}
[   1.787][v][ao/wasapi] Changed property: {9855c4cd-df8c-449c-a181-8191b68bd06c},0
[   4.320][v][ao/wasapi] OnDeviceStateChanged triggered on device {0.0.0.00000000}.{91ae8216-d9c0-474c-bdfd-890c75e36109}: requesting ao reload
[   4.320][v][ao/wasapi] OnDefaultDeviceChanged triggered: requesting ao reload
[   4.320][d][ao/wasapi] Uninit wasapi
[   4.320][d][ao/wasapi] Thread Reset
[   4.320][d][ao/wasapi] Thread Reset
[   4.320][d][ao/wasapi] Thread shutdown
[   4.350][d][ao/wasapi] Thread uninit done
[   4.351][d][ao/wasapi] Thread return
[   4.436][d][ao/wasapi] Uninit wasapi done
[   4.436][v][af] User filter list:
[   4.436][v][af]   (empty)
[   4.436][v][af] [in] 48000Hz stereo 2ch floatp
[   4.436][v][af] [userspeed] 48000Hz stereo 2ch floatp
[   4.436][v][af] [convert] 48000Hz stereo 2ch floatp
[   4.436][v][ao] Trying audio driver 'wasapi'
[   4.436][v][ao/wasapi] requested format: 48000 Hz, stereo channels, floatp
[   4.436][d][ao/wasapi] Init wasapi
[   4.436][d][ao/wasapi] Find device ''
[   4.439][e][ao/wasapi] There are no playback devices available

 

 

It's trying to use a device name that doesn't exist, and of course, it fails.

 

 

Link to comment
Share on other sites

Guest asrequested

For instance. In my mpv.conf, I choose the device to use. And this is how you do that;

audio-device=wasapi/SC-95 (NVIDIA High Definition Audio)
Link to comment
Share on other sites

Guest asrequested

can you reproduce this by playing something in mpv and then manually changing the refresh rate in windows?

 

So play something, and manually change the refresh rate in windows while it's playing? An interesting test, but that'll have to wait until the weekend, when I have more time. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...