Uneven sound levels on movies - partial fix I found

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Valsodar
Level 4
Level 4
Posts: 364
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Uneven sound levels on movies - partial fix I found

Post by Valsodar »

I'm posting this topic for people who suffer uneven sound levels when they're watching movies.

Ever since I'm using Linux there was this problem with the sound levels on movies - when the characters speak too quiet or even whisper, the sound goes lower and lower to the point you can't hear anything and you have to increase volume. But by doing so, when the action scenes come and the shooting and explosions begin, the sound is so loud that it could wake the dead.
To that I finally found a fix. Not a 100% fix, though but at least you won't have to fiddle with the volume every 2 minutes. This fix works with VLC (v2.1.x+) and SMPlayer (v18+). It would probably work with other players but these I have and tested it with. So... before I write the fix, you need to check whether you have installed the package libasound2-plugins-extra (this is an additional plugin for ALSA). Without that package the fix won't work (I don't know why, it just won't).

1. Enable equalizer and also check the box to enable it globally.
2. Choose "Party" setting.
For SMPlayer: click the "set as default" setting, then "close" and restart SMPlayer.
For VLC it seems you'll have to do this manually every time you play a movie because VLC 2.1.x refuses to remember the setting. I also have no idea whether remembering the setting will work in VLC 3.x.x cuz I never managed install it but it won't hurt you to try it with 3.x.x.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Core i7-4770, Palit GTX 1660 Ti, 32GB DDR3 RAM, Firefox, Arch LTS w/ Cinnamon 5.2.7
My Linux group on Telegram
Avatar & desktop: https://ibb.co/album/GFx0yV
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Uneven sound levels on movies - partial fix I found

Post by jimallyn »

Valsodar wrote: Thu Aug 09, 2018 7:15 pm1. Enable equalizer
Which equalizer would that be?
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
Valsodar
Level 4
Level 4
Posts: 364
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Re: Uneven sound levels on movies - partial fix I found

Post by Valsodar »

jimallyn wrote: Thu Aug 09, 2018 8:03 pm Which equalizer would that be?
You're kiddin', right?

Image 1:
Output driver: alsa
Left checkbox: activate tone corrector (equalizer)
Right checkbox: global tone corrector (equalizer)

Image
Core i7-4770, Palit GTX 1660 Ti, 32GB DDR3 RAM, Firefox, Arch LTS w/ Cinnamon 5.2.7
My Linux group on Telegram
Avatar & desktop: https://ibb.co/album/GFx0yV
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Uneven sound levels on movies - partial fix I found

Post by jimallyn »

Valsodar wrote: Thu Aug 09, 2018 10:04 pmYou're kiddin', right?
Not at all. Having used SMPlayer very little if at all, I had no idea where I might find it. It appears that I don't even have SMPlayer installed on my computer. In VLC, I found the equalizer under Tools, Effects and Filters, but have no idea why an equalizer would affect the dynamic range of an audio source. If in fact it does, perhaps it should be reported as a bug. In VLC, Effects and Filters also includes a Compressor, which, of course, I would expect to affect the dynamic range.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
Valsodar
Level 4
Level 4
Posts: 364
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Re: Uneven sound levels on movies - partial fix I found

Post by Valsodar »

Idk why it affects it either but you heard it for yourself. Report it, if you wish. The last time I reported an obvious bug with SMPlayer on their forum (a bug with subs and the black horizontal lines you can enable in options - the subs were standing in the middle of the screen, instead of going below the movie image) I was politely told to kiss their arse. Apparently the developers of SMPlayer don't like someone to point them out their own mistakes. :roll:

I know about the compressor in VLC but that doesn't change the sound for the better in my case.
Core i7-4770, Palit GTX 1660 Ti, 32GB DDR3 RAM, Firefox, Arch LTS w/ Cinnamon 5.2.7
My Linux group on Telegram
Avatar & desktop: https://ibb.co/album/GFx0yV
Hoser Rob
Level 20
Level 20
Posts: 11806
Joined: Sat Dec 15, 2012 8:57 am

Re: Uneven sound levels on movies - partial fix I found

Post by Hoser Rob »

jimallyn wrote: Fri Aug 10, 2018 5:12 pm... I have no idea why an equalizer would affect the dynamic range of an audio source. If in fact it does, perhaps it should be reported as a bug. ...
I agree. SMplayer has been my default video player for years, since before I installed Linux. I'm not installing that any time soon.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
Hoser Rob
Level 20
Level 20
Posts: 11806
Joined: Sat Dec 15, 2012 8:57 am

Re: Uneven sound levels on movies - partial fix I found

Post by Hoser Rob »

Valsodar wrote: Fri Aug 10, 2018 5:42 pm Idk why it affects it either but you heard it for yourself. Report it, if you wish. The last time I reported an obvious bug with SMPlayer on their forum (a bug with subs and the black horizontal lines you can enable in options - the subs were standing in the middle of the screen, instead of going below the movie image) I was politely told to kiss their arse. Apparently the developers of SMPlayer don't like someone to point them out their own mistakes. :roll:....
SMPlayer isn't a stand alone program, it's just a front end for either mplayer or mpv, the latter since Mint 18 in Mint release terms. So it's probably a bug in mpv. Buck passing is a big issue with Linux software since it's so modular and this may just be another example.

I never had that issue with smplayer using mpv but I actually installed mplayer in 18.2 and use that instead. I'm more familiar with mplayer settings and it works as well as mpv if not better (on that machine, YMMV).

Try turning off hardware decoding in SMplayer settings ... I know that sounds counter intuitive but that's actually what the mpv devs recommend. Then test. Then turn off direct rendering and then test again.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
phd21
Level 20
Level 20
Posts: 10103
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Uneven sound levels on movies - partial fix I found

Post by phd21 »

Hi Valsodar,

I just read your post and the good replies to it. Here are my thoughts on this as well.

It would help to know more about your system setup. If you run "inxi -Fxzd" from the console terminal prompt, highlight the results, copy and paste them back here, that should provide enough information.

It is not that uncommon for some videos and movies (and music and audio) to have been recorded with varying sound levels. Most of the multimedia players like VLC, SMplayer, etc... and music applications have an option called "normalize" ( a "compressor" filter effect) which tries to equalize the volume to eliminate or reduce highs and lows (and try to increase lower volume and decrease higher volume).

There are other posts in this forum on this topic as well.

You do not need to enable or use the "equalizer" options although you can.

FYI: I have noticed with some music applications that they do not work well if a "normalizer" is used "(enabled)...

3 Ways to Normalize Sound Volume on Your PC
https://www.howtogeek.com/115656/3-ways ... n-your-pc/

How To: Fix the sound volume issues in VLC Media Player – howto8165
https://howto8165.wordpress.com/2014/08 ... ia-player/

Hope this helps ...
.
VLC_Volume_Normalization.jpg
.
SMplayer_Volume_Normalization.jpg
Phd21: Mint 20 Cinnamon & xKDE (Mint Xfce + Kubuntu KDE) & KDE Neon 64-bit (new based on Ubuntu 20.04) Awesome OS's, Dell Inspiron I5 7000 (7573) 2 in 1 touch screen, Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, Intel 4 Graphics.
notned
Level 1
Level 1
Posts: 22
Joined: Thu Jan 07, 2016 6:29 pm

Re: Uneven sound levels on movies - partial fix I found

Post by notned »

My fix is to go into the movie settings and select Dolby 2.0
User avatar
Valsodar
Level 4
Level 4
Posts: 364
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Re: Uneven sound levels on movies - partial fix I found

Post by Valsodar »

phd21 wrote: Thu Aug 16, 2018 12:25 pm Hi Valsodar,

I just read your post and the good replies to it. Here are my thoughts on this as well.

It would help to know more about your system setup. If you run "inxi -Fxzd" from the console terminal prompt, highlight the results, copy and paste them back here, that should provide enough information.

It is not that uncommon for some videos and movies (and music and audio) to have been recorded with varying sound levels. Most of the multimedia players like VLC, SMplayer, etc... and music applications have an option called "normalize" ( a "compressor" filter effect) which tries to equalize the volume to eliminate or reduce highs and lows (and try to increase lower volume and decrease higher volume).
Normalization is always enabled but it doesn't change anything. In fact, when I run a video, it takes too long for the sound to be normalized by the system. The other way to force normalization is to increase the sound level to the maximum and when I hear the normalization kicking in - to turn the volume down.

Here's what you requested:

Code: Select all

rado@Mint18 ~ $ inxi -Fxzd
System:    Host: Mint18 Kernel: 4.13.0-45-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.6.7 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.3 Sylvia
Machine:   Mobo: ASRock model: B85M Pro4
           Bios: American Megatrends v: P2.50 date: 12/11/2015
CPU:       Dual core Intel Core i3-4170 (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 14767
           clock speeds: max: 3700 MHz 1: 1324 MHz 2: 1526 MHz 3: 1622 MHz
           4: 1746 MHz
Graphics:  Card: NVIDIA Device 1c82 bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau)
           Resolution: 1920x1080@60.00hz
           GLX Renderer: GeForce GTX 1050 Ti/PCIe/SSE2
           GLX Version: 4.6.0 NVIDIA 390.77 Direct Rendering: Yes
Audio:     Card-1 Intel 8 Series/C220 Series High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Card-2 NVIDIA Device 0fb9 driver: snd_hda_intel bus-ID: 01:00.1
           Sound: Advanced Linux Sound Architecture v: k4.13.0-45-generic
Network:   Card: Intel Ethernet Connection I217-V
           driver: e1000e v: 3.2.6-k port: f040 bus-ID: 00:19.0
           IF: enp0s25 state: up speed: 100 Mbps duplex: full mac: <filter>
Drives:    HDD Total Size: 1620.3GB (41.5% used)
           ID-1: /dev/sda model: WDC_WD5000AZRX size: 500.1GB
           ID-2: /dev/sdb model: Corsair_Force_LE size: 120.0GB
           ID-3: /dev/sdc model: WDC_WD10EZEX size: 1000.2GB
           Optical: /dev/sr0 model: ASUS DRW-24B5ST
           rev: 1.00 dev-links: cdrom,cdrw,dvd,dvdrw
           Features: speed: 48x multisession: yes
           audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition: ID-1: / size: 110G used: 12G (12%) fs: ext4 dev: /dev/sdb1
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 36.0C mobo: N/A gpu: 0.0:35C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 189 Uptime: 9 min Memory: 1503.7/32088.7MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 
rado@Mint18 ~ $ 
Core i7-4770, Palit GTX 1660 Ti, 32GB DDR3 RAM, Firefox, Arch LTS w/ Cinnamon 5.2.7
My Linux group on Telegram
Avatar & desktop: https://ibb.co/album/GFx0yV
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: Uneven sound levels on movies - partial fix I found

Post by trytip »

this is my fix for uneven audio levels in linux. this option will conflict with pulseaudio-equalizer-gtk and pulseeffects

1: install swh-plugins which are LADSPA plugins that can be used with audacity or audacious as live plugins

2: go to .config/pulse/ folder and delete everything in there but keep presets folder if you have one

3: create blank text and name it default.pa

4: copy this script and save

Code: Select all

#include system-wise config
.include /etc/pulse/default.pa

#compressor -- for normalize audio volume
.ifexists module-ladspa-sink.so
.nofail

### BEGIN: Equalized audio configuration
### Generated from: pulseaudio-equalizer
load-module module-ladspa-sink sink_name=ladspa_output.compressed master=alsa_output.pci-0000_00_1b.0.analog-stereo plugin=sc1_1425.so label=sc1 control=200,400,-24,3,3.25,10
###101,401,-24,3,5,9.6#SC1_LO#######200,400,-24,3,3.25,12#SC1_HI###

load-module module-ladspa-sink sink_name=ladspa_output.equalized master=ladspa_output.compressed plugin=mbeq_1197 label=mbeq control=0.0,-2.0,-2.0,-4.0,-4.0,-2.0,4.0,6.0,7.5,7.5,7.5,7.5,4.0,2.0,0.0
###0.0,-2.0,-4.0,-6.0,-6.0,-4.0,-2.0,0.0,6.0,8.0,8.0,8.0,4.0,2.0,0.0#EQ_HI###
###0.0,-2.0,-2.0,-4.0,-4.0,-2.0,4.0,6.0,7.5,7.5,7.5,7.5,4.0,2.0,0.0#EQ_LO####

load-module module-ladspa-sink sink_name=ladspa_output.normalized master=ladspa_output.equalized plugin=fast_lookahead_limiter_1913 label=fastLookaheadLimiter control=15,0,0.8
###15,0,0.8#LIMITER_HI#######10,0,0.8#LIMITER_LO###

set-default-sink ladspa_output.equalized
set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo 65536
set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo 0
### END: Equalized audio configuration

.fail
.endif
### swh-plugins need to be installed ###
### use the below pacmd command for alsa card should be one w/o .monitor ###
### and replace "alsa_output.pci-0000_00_1b.0.analog-stereo" with yours ###
### pacmd list-sinks | sed -n "/^.*name:/s/.*<\(.*\)>.*/\1/p" ###
### pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2 ###
### pulseaudio -k  <<< kill pulseaudio if you make any changes ###
5: run pacmd list-sinks | sed -n "/^.*name:/s/.*<\(.*\)>.*/\1/p"

6: search/replace the script for alsa_output.pci-0000_00_1b.0.analog-stereo and paste the output from step 5:

7: run pulseaudio -k which will kill/restart pulseaudio with the new script

in pavucontrol you will now have 3 new entries. entry1 is compressor the entry2 is compressor+equalizer and entry3 is compressor+equalizer+limiter

by default script will load entry2 compressor+equalizer. you can use sound settings from tray icon or pavucontrol to change entries.

Image

Image

ps: you won't have the echo cancelled entry that's a different script which normalizes your microphone. i'll post the addition maybe later, running these scripts , editing them and finding out how they behave takes some getting used to. listening to music may not sound good, you can use Built-in Audio for that which is audio without the script
Image
Locked

Return to “Sound”