Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

*** Please report new bugs here! ***

Moderators: helmut, XnTriq, xnview, Dreamer

Post Reply
CaspianRoach
Posts: 29
Joined: Sat Feb 08, 2020 1:35 pm

Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

Post by CaspianRoach »

Version: 0.97.1, win 10 64 version 2004

Steps to reproduce:

- Start Xnview
- Navigate to a folder with a video and an image in explore mode
- Click on a video
- Click on an image
- Audio stream is now open until you close XnviewMP

Why is this important?

When audio stream is open, Windows cannot go to sleep mode on its own, because it thinks that something's trying to play sounds. To see if any audio streams are currently preventing windows from going to sleep, go to command line and type `powercfg -requests`.
It will say something like this:

SYSTEM:
[DRIVER] High Definition Audio Device (HDAUDIO\FUNC_01&VEN_10EC&DEV_0899&SUBSYS_18491898&REV_1000\4&1d2c9eed&0&0001)
An audio stream is currently in use.

What should be happening?

XnView should be immediately closing audio streams after it's done using them.

Could it be related to the issue in explore mode where sometimes the videos don't start in preview when you click from one video to the next?

Example of what it looks like:

https://i.imgur.com/KdKO3yg.png
CaspianRoach
Posts: 29
Joined: Sat Feb 08, 2020 1:35 pm

Re: Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

Post by CaspianRoach »

Tested this with .avi, .mp4, .webm, so the video format doesn't seem to make a difference.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

Post by xnview »

I can't reproduce on my Win 10 (1903), you have that with all video format and each time?
Pierre.
CaspianRoach
Posts: 29
Joined: Sat Feb 08, 2020 1:35 pm

Re: Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

Post by CaspianRoach »

Yeah, just tested it again with different files and got the same result. Here's a video of me testing it: https://streamable.com/enpsk4

Does your powercfg -requests show an audio stream in use while the video is playing and stops showing it if you do the command after?

Can this be related to external audio/video codecs, like the ones from K-Lite Codec Pack or does XnView not use those?
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

Post by xnview »

useInternalVideoPlayer is true in xnview.ini?
Pierre.
CaspianRoach
Posts: 29
Joined: Sat Feb 08, 2020 1:35 pm

Re: Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

Post by CaspianRoach »

Changing it to false doesn't change the behaviour. The audio stream is still shown as open in either situation.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

Post by xnview »

CaspianRoach wrote: Wed Nov 18, 2020 9:07 am It is true, yes.
Ok, i understand now. But i use QtAV (based on FFMPEG), and i have no way to close audio stream.
Pierre.
CaspianRoach
Posts: 29
Joined: Sat Feb 08, 2020 1:35 pm

Re: Opening a preview for the video file in explore mode leaves the audio stream open until you close XnviewMP

Post by CaspianRoach »

Ah, okay then. If there's nothing in that library's functions about audio streams, then we're probably out of luck, unless you want to completely shut it down every time you deselect a video file.

I wonder if putting in a timer of, say, 15 or 30 minutes after you last used a video preview and forcefully shutting the QtAV after that is a good idea? If it's not a good idea, or it has some side effects, then this whole thing is probably not worth the effort.

For me, I just learned to close XnviewMP at the end of the day and not leave it open, so my computer can time out to sleep normally.
Post Reply