Bug 127307 - enabling equalizer lowers the volume alot (xine engine)
Summary: enabling equalizer lowers the volume alot (xine engine)
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playback (show other bugs)
Version: 1.4-beta3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 126788 133781 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-14 15:40 UTC by Thomas Walther
Modified: 2008-07-22 12:40 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
The patch should decrease the volume cutoff significantly. (3.77 KB, patch)
2006-11-26 20:06 UTC, Tobias Knieper
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Walther 2006-05-14 15:40:34 UTC
Version:           1.4-beta3 (using KDE 3.5.2 Level "a" , SUSE 10.0 UNSUPPORTED)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15.8-default

I don't know whether this affects other engines aswell, but at least in xine engine enabling the equalizer with the "none" setting (everything put to the middle) decreases the volume alot. I have to put the left slider (I think it's named "pre-amplifier" or similar in English) to the very top to get the volume to the same level as without the equalizer enabled.
Normally, having set all sliders in the middle and enabling the equalizer shouldn't change anything.

I read a bug report where enabling the equalizer increased the volume (#123070 - thus that guy had various other problems with the EQ sliders), for me, it's the contrary.
Comment 1 Peter 2006-07-05 06:31:36 UTC
On Mandriva Cooker running KDE 3.5.3 and Amarok 1.4.1 this issue is still present...

Turning _off_ the Equalizer increases player volume and conversely turning _on_ the equalizer decreases player volume.

This is probably related -- switching the Equalizer to preset='Zero' and then toggling the 'Enable Equalizer' on and off seems to have far less impact on player volume.
Comment 2 Alexandre Oliveira 2006-09-09 01:11:56 UTC
*** Bug 133781 has been marked as a duplicate of this bug. ***
Comment 3 Tobias Knieper 2006-09-09 12:16:18 UTC
I am the person who made the xine equalizer patch which introduced the volume decrease. Before this patch the equalizer was absolutely broken. So i adopted the code from kaffeine.
To resolve this issue we need either a person who knows well about xine lib or an other (third) open source audio player. This audio player must use xine lib and must have a working equalizer. Then we can have a look at its code.
Comment 4 Alexandre Oliveira 2006-10-09 03:55:31 UTC
*** Bug 126788 has been marked as a duplicate of this bug. ***
Comment 5 nikos v 2006-10-15 23:50:52 UTC
Just asking; What about importing equalizer from another application such as videolan ,or xmms ? I write this because I suppose videolan uses xine codecs (don't know about xmms). Again , just asking, don't know if it can happen .By the way same bug with helix engine on suse 10.0
Comment 6 Tobias Knieper 2006-11-26 20:01:09 UTC
The following patch should decrease the volume cutoff significantly. Some of you will notice that it is still there. 

Regards,
Tobias

Index: amarok/src/engine/xine/xine-engine.cpp
===================================================================
--- amarok/src/engine/xine/xine-engine.cpp	(revision 607419)
+++ amarok/src/engine/xine/xine-engine.cpp	(working copy)
@@ -561,23 +561,22 @@
     if( !enable ) {
         QValueList<int> gains;
         for( uint x = 0; x < 10; x++ )
-            gains << -102; // sets eq gains to zero.
+            gains << -101; // sets eq gains to zero.
 
         setEqualizerParameters( 0, gains );
    }
 }
 
 /*
- sets the eq params for xine engine - have to rescale eq params to fitting range (adapted from kaffeine)
- sideeffect: volume decreases with enabled eq, don't know why, occurs also in kaffeine
+ sets the eq params for xine engine - have to rescale eq params to fitting range (adapted from kaffeine and xfmedia)
 
  preamp
    pre: (-100..100)
-   post: (0.2..1.8) - this is not really a preamp but xine offers no preamp so we make a postamp
+   post: (0.1..1.9) - this is not really a preamp but we use the xine preamp parameter for our normal volume. so we make a postamp.
 
  gains
    pre: (-100..100)
-   post: (1..100) - range adapted from kaffeine (1 = down, 50 = middle, 100 = up, 0 = off[!!!])
+   post: (1..200) - (1 = down, 100 = middle, 200 = up, 0 = off)
  */
 void
 XineEngine::setEqualizerParameters( int preamp, const QValueList<int> &gains )
@@ -589,18 +588,18 @@
     m_intPreamp = preamp;
     QValueList<int>::ConstIterator it = gains.begin();
 
-    xine_set_param( m_stream, XINE_PARAM_EQ_30HZ,    int( (*it  )*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_60HZ,    int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_125HZ,   int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_250HZ,   int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_500HZ,   int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_1000HZ,  int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_2000HZ,  int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_4000HZ,  int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_8000HZ,  int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_16000HZ, int( (*++it)*0.49 + 50 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_30HZ,    int( (*it  )*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_60HZ,    int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_125HZ,   int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_250HZ,   int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_500HZ,   int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_1000HZ,  int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_2000HZ,  int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_4000HZ,  int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_8000HZ,  int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_16000HZ, int( (*++it)*0.995 + 100 ) );
 
-    m_preamp = ( preamp - 0.2 * preamp + 100 ) / 100.0;
+    m_preamp = ( preamp - 0.1 * preamp + 100 ) / 100.0;
     setVolume( m_volume );
 }
 
Index: amarok/src/equalizersetup.cpp
===================================================================
--- amarok/src/equalizersetup.cpp	(revision 607419)
+++ amarok/src/equalizersetup.cpp	(working copy)
@@ -115,7 +115,7 @@
     // END
 
     // BEGIN Band Sliders
-    const char *bandLabels[] = { "60", "170", "310", "600", "1k", "3k", "6k", "12k", "14k", "16k" };
+    const char *bandLabels[] = { "30", "60", "125", "250", "500", "1k", "2k", "4k", "8k", "16k" };
 
     int minWidth = 0;
     QFontMetrics fm = fontMetrics(); //apparently it's an expensive call
Comment 7 Tobias Knieper 2006-11-26 20:06:04 UTC
Created attachment 18704 [details]
The patch should decrease the volume cutoff significantly.
Comment 8 Mark Kretschmann 2006-11-26 21:48:32 UTC
SVN commit 608130 by markey:

The xine equalizer no longer reduces the volume. Patch by Tobias Knieper <tobias.knieper@micekiller.de>.

BUG: 127307


 M  +2 -0      ChangeLog  
 M  +15 -16    src/engine/xine/xine-engine.cpp  
 M  +1 -1      src/equalizersetup.cpp  


--- trunk/extragear/multimedia/amarok/ChangeLog #608129:608130
@@ -33,6 +33,8 @@
     * Amarok now saves playlists with relative paths by default.
 
   BUGFIXES:
+    * The xine equalizer no longer reduced the volume. Patch by Tobias Knieper
+	  <tobias.knieper@micekiller.de>. (BR 127307)
     * It's now possible to delete a file from an MTP media device and
       re-upload it without having to reconnect the device.
     * Wikipedia links to edit sections are no longer shown.
--- trunk/extragear/multimedia/amarok/src/engine/xine/xine-engine.cpp #608129:608130
@@ -561,23 +561,22 @@
     if( !enable ) {
         QValueList<int> gains;
         for( uint x = 0; x < 10; x++ )
-            gains << -102; // sets eq gains to zero.
+            gains << -101; // sets eq gains to zero.
 
         setEqualizerParameters( 0, gains );
    }
 }
 
 /*
- sets the eq params for xine engine - have to rescale eq params to fitting range (adapted from kaffeine)
- sideeffect: volume decreases with enabled eq, don't know why, occurs also in kaffeine
+ sets the eq params for xine engine - have to rescale eq params to fitting range (adapted from kaffeine and xfmedia)
 
  preamp
    pre: (-100..100)
-   post: (0.2..1.8) - this is not really a preamp but xine offers no preamp so we make a postamp
+   post: (0.1..1.9) - this is not really a preamp but we use the xine preamp parameter for our normal volume. so we make a postamp.
 
  gains
    pre: (-100..100)
-   post: (1..100) - range adapted from kaffeine (1 = down, 50 = middle, 100 = up, 0 = off[!!!])
+   post: (1..200) - (1 = down, 100 = middle, 200 = up, 0 = off)
  */
 void
 XineEngine::setEqualizerParameters( int preamp, const QValueList<int> &gains )
@@ -589,18 +588,18 @@
     m_intPreamp = preamp;
     QValueList<int>::ConstIterator it = gains.begin();
 
-    xine_set_param( m_stream, XINE_PARAM_EQ_30HZ,    int( (*it  )*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_60HZ,    int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_125HZ,   int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_250HZ,   int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_500HZ,   int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_1000HZ,  int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_2000HZ,  int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_4000HZ,  int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_8000HZ,  int( (*++it)*0.49 + 50 ) );
-    xine_set_param( m_stream, XINE_PARAM_EQ_16000HZ, int( (*++it)*0.49 + 50 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_30HZ,    int( (*it  )*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_60HZ,    int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_125HZ,   int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_250HZ,   int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_500HZ,   int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_1000HZ,  int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_2000HZ,  int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_4000HZ,  int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_8000HZ,  int( (*++it)*0.995 + 100 ) );
+    xine_set_param( m_stream, XINE_PARAM_EQ_16000HZ, int( (*++it)*0.995 + 100 ) );
 
-    m_preamp = ( preamp - 0.2 * preamp + 100 ) / 100.0;
+    m_preamp = ( preamp - 0.1 * preamp + 100 ) / 100.0;
     setVolume( m_volume );
 }
 
--- trunk/extragear/multimedia/amarok/src/equalizersetup.cpp #608129:608130
@@ -115,7 +115,7 @@
     // END
 
     // BEGIN Band Sliders
-    const char *bandLabels[] = { "60", "170", "310", "600", "1k", "3k", "6k", "12k", "14k", "16k" };
+    const char *bandLabels[] = { "30", "60", "125", "250", "500", "1k", "2k", "4k", "8k", "16k" };
 
     int minWidth = 0;
     QFontMetrics fm = fontMetrics(); //apparently it's an expensive call