audio normalization

Beyondcr
  4 years ago
  1
  Discussion

The idea is adding sound normalization function to the sound settings in cinnamon, unfortunately I lack the skills to complete the task so I am posting the idea for someone to hopefully pickup the task.

First we will need to have the plugin package installed, swh-plugins in the repositories. Second we will need to have a way to load the plugin. One way will be adding code to /etc/pulse/default.pa, second would be loading and unloading module from sound settings itself. Ether way we will need to have a function added to the sound settings window that will set plugin as default sink and also hide the sink from the display window to retain aesthetics. When done correctly the end user should never know that the sink has changed to the plugin , other than the normalization function was enabled via a check box or slider.

My first option of creating the sound normalization effect would be to use two separate plugins, the code would be as follows.


load-module module-ladspa-sink sink_name=ladspa_output.fastLookaheadLimiter sink_properties=device.description="limiter.hideme" label=fastLookaheadLimiter plugin=fast_lookahead_limiter_1913 control=20,0,0.3

load-module module-ladspa-sink sink_properties=device.description="NormalizedAudio.hideme" label=dysonCompress plugin=dyson_compress_1403 master=ladspa_output.fastLookaheadLimiter control=0,0.5,0.5,0.99


This method will create two sinks and we will need to set NormalizedAudio.hideme as default, to test this setup without modifying any files on your system with swh-plugins installed simply use pactl command in term. ex:

pactl load-module module-ladspa-sink sink_name=ladspa_output.fastLookaheadLimiter sink_properties=device.description="limiter.hideme" label=fastLookaheadLimiter plugin=fast_lookahead_limiter_1913 control=20,0,0.3 && pactl load-module module-ladspa-sink sink_properties=device.description="NormalizedAudio.hideme" label=dysonCompress plugin=dyson_compress_1403 master=ladspa_output.fastLookaheadLimiter control=0,0.5,0.5,0.99

You can now select NormalizedAudio.hideme as default sink in cinnamon sound settings.

Second method would also use the swh-plugins package just a different plugin and only one sink. To test run with pactl.

load-module module-ladspa-sink sink_name=normalize.hideme sink_properties=device.description="normalize.hideme" plugin=sc4m_1916 label=sc4m control=1,1.5,401,-30,20,5,12

Note ".hideme" is only naming for reference, not sure if you can use the name scheme to hide the sink from sound settings. I have already made a failed attempt, but If none one steps forward I will try a second time, most likely after the new year.

References:

https://github.com/gotbletu/shownotes/blob/master/pulseaudio-dynamic-range-compression.md
http://askubuntu.com/questions/43950/how-can-i-apply-a-ladspa-plugin-to-a-pulseaudio-stream
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/
Latest comments
Beyondcr 4 years ago

Understood, The idea can be removed if you think it violates the rules, Yes I did not go into the reasoning for such a idea to exist but as far as I know there is no standard in sound levels across application/medias it creates a very poor experience when you have to always have your finger on the volume button afraid the next media you start will wake your entire household or you cannot hear anything because the levels are so low. I apologize I made it sound like it was a issue for only cinnamon mainly because that is what I am currently on, but clem seemed hopeful that it would carry over to other mint distros fairly easy because they use similar core functions with the sound applet. I have no problem if the idea is removed but I do believe it is a idea that can improve Linux Mint as a whole.


remoulder 4 years ago

This is more of a tutorial and should be posted either in the forums or the tutorial section. Simply suggesting something you want does not make it an idea. There has to be a justification and reasoning behind it that makes it useful/applicable to everyone. Furthermore this section is only for ideas for the linuxmint distro and it's websites, suggestions for cinnamon should be posted at https://github.com/linuxmint/Cinnamon/issues as cinnamon is a separate project.