Opened 4 years ago

Closed 3 years ago

Last modified 2 years ago

#5654 closed defect (fixed)

Volume Control is slow to react on Windows

Reported by: https://www.google.com/accounts/o8/id?id=aitoawl7yerssudguzircpinmomadj0-iebalzo Owned by: jb
Priority: high Milestone: 2.1.0 release
Component: Audio: Windows plugins Version: Other
Severity: normal Keywords: VLC 1.2 Volume Control
Cc: level20peon Difficulty: medium
Platform(s): Windows Work status: Not started

Description

The volume control in VLC 1.2 windows is not very responsive. While controlling it using the scroll wheel it takes time to reduce/increase the volume after the command is given.

Attachments (2)

volume.png (1.5 KB) - added by https://www.google.com/accounts/o8/id?id=aitoawl7yerssudguzircpinmomadj0-iebalzo 4 years ago.
patch _directx.zip (53.6 KB) - added by Sergey012 3 years ago.
Patch fo directx audio plugin

Download all attachments as: .zip

Change History (34)

Changed 4 years ago by https://www.google.com/accounts/o8/id?id=aitoawl7yerssudguzircpinmomadj0-iebalzo

comment:1 Changed 4 years ago by jb

  • Component changed from Unknown to Audio: DirectAudio / WaveOut
  • Summary changed from Volume Control to Volume Control is slow to react on Windows

See #5605

comment:2 Changed 4 years ago by Wildduck

Last edited 4 years ago by Wildduck (previous) (diff)

comment:3 Changed 3 years ago by level20peon

adding myself to CC

comment:4 Changed 3 years ago by edwardw

  • Cc level20peon added

comment:5 Changed 3 years ago by http://kmindi.myopenid.com/

On Windows 7 (64 bit) running 2.0 rc I have the same problem. It takes like a second if the volume is changed after I changed it in the gui. But I found out that this is not with every media file. It was only while playing back streamed media. Using local files there was only a very small time difference.

comment:6 Changed 3 years ago by sjorge

It depends on you're caching values. Local files have a low one so low delay, network files, streams... have a higher delay.

If you decrees the settings for these the delay is also decreased.

comment:7 Changed 3 years ago by http://kmindi.myopenid.com/

That sounds true. But I did not change any settings. And btw. could you tell me where I can find those settings? I looked through all options (expert on) but did not find any buffer settings to change that influence this.

If you change network-caching to 300 instead of 1000 default (new in 2.0rc?)

# Network caching (ms) (Ganzzahl)
network-caching=300

its like for normal files.

Last edited 3 years ago by http://kmindi.myopenid.com/ (previous) (diff)

comment:8 Changed 3 years ago by firebrand

Network-caching setting replicated vlc 1.1.x behavior for me too. Two caveats:

  • I think users are going to expect volume change in vlc 2.0 to be at least as responsive as it was in 1.1.x, even when playing files over the network. Samba shares (which is how I noticed this) are fairly common, and use the network rather than file cache value. The slower volume change is noticeable and potentially harmful -- extremely loud volumes will persist for over a second after they've been adjusted in the user interface.
  • The network-caching setting is buried in the advanced section of preferences, so it's not easy for users to find.

However, on linux (gentoo), even with all three caching settings set to 1500ms, VLC 2.0 has near-zero delay (casually speaking, imperceptible delay, probably a few ms) when changing volume.

I think that the windows volume change handler in vlc 1.1.x (not sure about earlier versions) and 2.0 is unnecessarily delaying audio volume changes, which I think should be the main concern of this bug. Linux behavior demonstrates that delaying volume changes according to input caching values is not a fundamental architectural behavior in VLC.

comment:9 Changed 3 years ago by http://kmindi.myopenid.com/

+1 for firebrand's comment

comment:10 Changed 3 years ago by jb

Absolutely noone said that this was a fundamental architecture issue.

This is a lack of feature on the Windows Audio outputs, since 2.0.

Any patch and help are welcome.

comment:11 Changed 3 years ago by https://www.google.com/accounts/o8/id?id=aitoawlt3svpcyc9eqn7gmzpuiwqybzcw27zgvi

Can confirm this on Mac OS X. Very annoying to wait several seconds to make loud compressed pop-music record quieter after listening to quietly recorded classical music for example.

+1 for firebrand. Completely agree that it should work as it worked in vlc 1.x — instantly (with same network-caching setting).

comment:12 Changed 3 years ago by nickvergessen

I have the same issue (Win7 64-bits)

Changing the Output Module in "Tools" > "Preferences" > "Audio" >
to "Win32 waveOut extension output" "fixed" the issue.

comment:13 Changed 3 years ago by brutal_chaos

I can confirm this volume issue on Windows XP (SP3) 32bit as well.

Changed 3 years ago by Sergey012

Patch fo directx audio plugin

comment:14 follow-up: Changed 3 years ago by Sergey012

Hello. I added hardware support for volume control in DirectX audio output. (method IDirectSoundBuffer_SetVolume).

In the attached file (path_directx.zip) are

  1. libaout_directx_plugin.dll (build in VS)
  2. \ modules\audio_output\directx.c - all fixes are marked with comments VSG

Hope this helps

Last edited 3 years ago by Sergey012 (previous) (diff)

comment:15 Changed 3 years ago by jb

Excellent!

I will try to integrate that!

comment:16 in reply to: ↑ 14 Changed 3 years ago by Lotesdelere

Replying to Sergey012:

Hello. I added hardware support for volume control in DirectX audio output. (method IDirectSoundBuffer_SetVolume).

In the attached file (path_directx.zip) are

  1. libaout_directx_plugin.dll (build in VS)
  2. \ modules\audio_output\directx.c - all fixes are marked with comments VSG

Hope this helps


It helps a lot, this DLL solves the volume lag problem indeed.
One point though: with VLC volume set at 100% the general volume is now -7.5 dB lower than the default volume with the original DLL (tested on Windows XP with VLC 2.0.2 nightly build). This is way too low and needs to be adjusted.

comment:17 Changed 3 years ago by Sergey012

To jb

A small issue in waveOut audio output. (\modules\audio_output\waveout.c)

During initialization of the module is first called aout_VolumeSoftInit (p_aout) (line 294), and then checking for hardware support and setting p_aout->pf_volume_set. So if volume=0 or mute=true we have no sound or low level of sound.

Need to change:
Initially test the hardware support of volume control
Then: call aout_VolumeSoftInit or aout_VolumeHardInit

 aout_PacketInit( p_aout, &p_aout->sys->packet, FRAME_SIZE );
        //aout_VolumeSoftInit( p_aout );

        /* Check for hardware volume support */
		DWORD i_dummy;
        if( waveOutGetDevCaps( (UINT_PTR)p_aout->sys->h_waveout,&wocaps, sizeof(wocaps) ) == MMSYSERR_NOERROR &&
			(wocaps.dwSupport & WAVECAPS_VOLUME ) && ( waveOutGetVolume( p_aout->sys->h_waveout, &i_dummy ) == MMSYSERR_NOERROR ))
            {
              aout_VolumeHardInit( p_aout,VolumeSet );   //p_aout->pf_volume_set = VolumeSet;
            }
		else aout_VolumeSoftInit( p_aout );
        

comment:18 Changed 3 years ago by hueller

the "volume lag" still exists in vlc 2.0.2 (nightly as of today) one observation: the value of preferences(all) > input/codecs > file caching (ms) directly influences the amount of lag. Setting a value of 2000 ms will make that lag _reaaaally_ long

comment:19 Changed 3 years ago by jb

Patch of comment 17 has been applied and merged in 2.0.2

comment:20 Changed 3 years ago by courmisch

  • Milestone changed from Bugs paradize to 2.1 bugs
  • Resolution set to fixed
  • Status changed from new to closed

comment:21 Changed 3 years ago by jb

  • Milestone changed from 2.1 bugs to 2.0.2

comment:22 follow-up: Changed 3 years ago by courmisch

  • Milestone changed from 2.0.2 to 2.1 bugs

Not fixed in 2.0.2/2.0.3.

comment:23 in reply to: ↑ 22 Changed 3 years ago by https://www.google.com/accounts/o8/id?id=aitoawmwpg8-uffdtvxrfztgymdhmnwuvbf3aey

"Ticket #5654 (closed defect: fixed)" "Patch of comment 17 has been applied and merged in 2.0.2"

No, its still broke. Please fix it? I've been doing some fresh installs on some computers and this is not fixed at all. One PC with 2.0.2 was doing it -installed patch and it fixed it, then another pc with 2.0.3 was doing it, patch worked there too.

No one seems to mention the install instructions, did i miss those? It seems obvious you need to unzip the files into the VLC/Plugins folder - but to actually get the fix to work, you must go into the preference (all) and change the audio output to a "direct X audio output" - on both my PCs it was the 1st direct X listed (I have two, with the same name in different positions on the list)...after that it is instant volume changes (streaming from a network share) :-)~

comment:24 Changed 3 years ago by trolololoish

VLC YOU BAG OF HORSE SHIT, FIX THIS ALREADY!

comment:25 Changed 3 years ago by frenky

This is not fixed IMHO. I've installed 2.0.4 and still same problem. Funny is that fix submitted with comment http://trac.videolan.org/vlc/ticket/5654#comment:16 works with this version as well... Thumbs up for Sergey012.

comment:26 follow-up: Changed 3 years ago by courmisch

Where did you see that it would be fixed in 2.0.4? It clearly says "Milestone: 2.1"

comment:27 in reply to: ↑ 26 Changed 3 years ago by frenky

Replying to courmisch:

Where did you see that it would be fixed in 2.0.4? It clearly says "Milestone: 2.1"

Missed that... Thanks for clarification. Looking forward to 2.1!

comment:28 Changed 3 years ago by cokepizza

Yay for being fixed in 2.1 - thanks.

Are there many releases expected between now (2.0.4) and 2.1? If so, why wait until 2.1?

comment:29 Changed 3 years ago by ttyp00

This is just too much to bear. I've now upgraded from what used to be a fully usable vlc media player to 2.0.5; now even trying the nightly 2.1.0; and still the volume control issue is not fixed. I don't know what you guys changed, but it is a travesty that I have to switch back to Windows' crappy media player just so I can have some control over my volume.

It takes a full second or two to have any change in volume be realized. No matter what output module I use or what patch from above I try, nothing works.

As far as the 2.1.0 milestone - it has not been attained. The bug still exists and it is as infuriating as ever.

comment:30 Changed 2 years ago by frenky

I know milestone said 2.1... But I'm so unhappy with priority assigned to this ticket. Guess that's due to the price of OSS SW:-) jb, I rly hope you can take this ticket a bit sooner.

comment:31 Changed 2 years ago by brendan butterworth

Test results for Windows 7, VLC 2.0.5

Settings -> Audio -> Output Module

Modes confirmed to generate sound to my speakers:

  • Default
  • Win32 waveOut extension output
  • DirectX Audio Output

Modes confirmed to generate a delay in volume control:

  • Default
  • DirectX Audio Output

Toggling "Use float32 output" had no impact on the delay in volume control.

Overall, if you are a currently a user affected by this issue, swapping to the "Win32 waveOut extension output" may eliminate the volume delay for you - it did for me.

comment:32 Changed 2 years ago by Wildduck

That have been said in comment 12 ;) If needed, I can confirm all of the above still. It unrelated but btw, waveout produce laggy playback on my system (after about 5s of playing, then slowly each 1.5s). Seems to disappear after ~30s of playback. Tried with flac, mp3 and ogg.

Well, it seems it will be fixed in 2.1 but I'm afraid of the previous comment on the nightly saying it's not :s

Last edited 2 years ago by Wildduck (previous) (diff)
Note: See TracTickets for help on using tickets.