Master volume adjustment fails to stop distortion

Bug #72889 reported by John Green
2
Affects Status Importance Assigned to Milestone
Jokosher
Fix Released
High
Laszlo Pandy

Bug Description

I don't know if this is a bug or just me not knowing how a mixing deck should work but it just seems wrong.

Import a short audio clip to an instrument.
Import the same clip to a second instrument.
Switch to mixing view and play back.
The output level goes very red (because volume levels are doubled.
Adjust the master volume level down so that output falls within tolerable range.
The audio still sounds slightly distorted at the peaks.
Mixdown the project.
Start a new project and import the mixed down audio and you can see the flattened waves where it's distorted.
Now repeat the above but this time adjust the instrument volumes instead of the master volume and you get no distortion and a proper looking wave.

So the master volume must be adjusting the level *after* mixing where the damage is already done. Is this right?

Revision history for this message
John Green (john-thegreens) wrote :
Revision history for this message
John Green (john-thegreens) wrote :
Revision history for this message
John Green (john-thegreens) wrote :
Revision history for this message
Laszlo Pandy (laszlok) wrote :

This is interesting. Its true that all the instruments each go through their own level element, and then go into the adder which goes through the master level element before being send to alsa. So the distortion presumably happens in the adder when it tried to combine multiple streams. I seems as though the adder actual is just an "adder" in the true sense of the word. It just adds the waveforms on top of each other and increases the volume.

Question for people with audio experience: Should adding more simultaneous streams increase the volume, or leave it at the same level? Issues with this are if you have 10 tracks with the same song, it is 10 times as loud, but if you have 10 tracks -- one with audio and 9 with silence -- it will be 10 times quieter.

I see three solutions for this:
1) Get the gstreamer guys to make the adder first divide the volume of each stream by the number of streams its mixing. This would still result in distortion, but only for the certain track that were distorted before then entered the adder, and those can be adjusted with the individual with their own volume elements. This solution will make everything quieter.

2) Do the same as above but compute the number of instruments ourselves and adjust each instrument's volume element without changing the value that is shown on the slider. This solution will also make everything quieter.

3) Get rid of the master volume element and hook the master volume control up to set a variable which is multiplied to each instrument volume control. This would achieve essentially what John originally wanted, making lowering the master volume reduce all the individual volumes. This solution will make everything louder.

Laszlo Pandy (laszlok)
Changed in jokosher:
assignee: nobody → laszlok2
importance: Undecided → High
status: Unconfirmed → Confirmed
Revision history for this message
Laszlo Pandy (laszlok) wrote :

I have committed a fix for this (r1090) which uses method 3) as explained in my last comment. Please test and see if this fixes the distortion problem for you.

Revision history for this message
John Green (john-thegreens) wrote :

Fixed in r1090

Changed in jokosher:
status: Confirmed → Fix Committed
Laszlo Pandy (laszlok)
Changed in jokosher:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.