Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Multimedia & Video
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Multimedia & Video
Have multimedia question? ATI, Nvidia, Sound cards. Just ask here.

 
Thread Tools Display Modes
Old June 16th, 2007   #1
psyke83
Chocolate-Covered Ubuntu Beans
 
Join Date: Nov 2005
Location: Ireland
Beans: 2,302
Ubuntu 9.04 Jaunty Jackalope
Lightbulb Bad sound? Try this...

Hi,

I have a Dell Inspiron 510m laptop with an Intel 82801DB-ICH4 (STAC9750/51 / AC'97) sound chipset. Under Windows, sound reproduction is pretty good considering that it's coming from a pair of laptop speakers - clear with good bass. Under linux (Ubuntu, Fedora and others), however, something is wrong...

When the volume is beyond around 50%, the sound seems distorted, particularly with bass sounds; it seems as though the speakers are damaged/loose, with a rattling sound at the higher frequencies, and overall sound seems "muffled". Upon experimenting with VLC's equalizers, I managed to tweak sound until it sounded almost perfect, just like XP's sound reproduction. Unfortunately, this only solved audio playback in VLC, so after some research and experimentation, I found out how to equalize sounds system-wide, using ALSA with a LADSPA (audio processing) plugin.

If anybody is suffering a similar issue, here's the solution:

1. Install the "C* Audio Plugin Suite" (caps), which contains the required ladspa plugin (requires the universe repository):
Code:
$ sudo apt-get install caps
2. Create a new .asoundrc file:
Code:
gedit ~/.asoundrc
Insert the following text into the new file:
Code:
   pcm.!default {
       type plug
       slave.pcm "equalized";
   }

   pcm.equalized {
       type ladspa
       slave.pcm "plug:dmix";
       path "/usr/lib/ladspa";
       plugins [
           {
               id 1773
               input {
                   controls [ 8 5 3 -5 -6 -10 -6 -5 8 8 ]
               }
           }
       ]
   }
NOTE: Regarding the part highlighted red. There's a bug in ALSA causing crackles if the sound volume on any mixer is above 75%, causing disturbing pops. To work around this problem you can either keep the volume mixers below 75% or disable mixing which eliminates the popping, but allows only one application to play sound at a time. To disable mixing, change the part in red to:
Code:
plughw:0,0
Save the file, and try playing an audio or movie file with a high volume (but make sure that you restart any apps that may be using the sound card).

Can I ask that anybody who notices a difference (positive, negative or indifferent) report back? This fixes audio for me under Feisty, but may work for earlier releases.

Last edited by psyke83; August 21st, 2007 at 02:39 PM.. Reason: Changed equalization settings, added further instructions
psyke83 is offline   Reply With Quote
Old June 16th, 2007   #2
nSTER
5 Cups of Ubuntu
 
Join Date: Apr 2007
Beans: 32
Re: Bad sound? Try this...

This is great, I think it is working but for some reason in VLC while the audio is playing it would randomly start crackling, everything would stop playing in terms of the actual audio and will start to crackle for about 10 seconds then resumes again with the audio. This does not happen in any other media player. And this also only happens with my laptop speakers not my usb headsets. ATI IXP is my laptop audio driver. Great tip though thanks!
nSTER is offline   Reply With Quote
Old June 16th, 2007   #3
psyke83
Chocolate-Covered Ubuntu Beans
 
Join Date: Nov 2005
Location: Ireland
Beans: 2,302
Ubuntu 9.04 Jaunty Jackalope
Re: Bad sound? Try this...

nSTER,

That's a different issue (that I experienced in the past as well) . VLC's ALSA output plugin is buggy, try changing it to OSS in the preferences (you may need to enable advanced options to find it). That eliminated the crackling sound on my systems with VLC (which isn't the same as the the issue I posted in this thread initially).
psyke83 is offline   Reply With Quote
Old June 23rd, 2007   #4
Morbett
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 100
Re: Bad sound? Try this...

Wow, the sound on my Dell Inspiron 1300 laptop sounds much better now.
Morbett is offline   Reply With Quote
Old June 23rd, 2007   #5
Wiseman1024
First Cup of Ubuntu
 
Join Date: Jun 2007
Beans: 2
Re: Bad sound? Try this...

I admire the work, though this is just running circles around the issue which must be in something gone horribly wrong in the sound drivers. You're basically getting bad quality sound, and fixing it artificially, introducing even more noise and distortion, even if it gives the impression of higher quality. The sound you're getting is not so close to how it should sound as it seems, I'm afraid.
Wiseman1024 is offline   Reply With Quote
Old June 23rd, 2007   #6
psyke83
Chocolate-Covered Ubuntu Beans
 
Join Date: Nov 2005
Location: Ireland
Beans: 2,302
Ubuntu 9.04 Jaunty Jackalope
Re: Bad sound? Try this...

Quote:
Originally Posted by Wiseman1024 View Post
I admire the work, though this is just running circles around the issue which must be in something gone horribly wrong in the sound drivers. You're basically getting bad quality sound, and fixing it artificially, introducing even more noise and distortion, even if it gives the impression of higher quality. The sound you're getting is not so close to how it should sound as it seems, I'm afraid.
I understand what you mean. I've reported the issue to the ALSA bug tracker with no response as of yet, and I discussed it with some ALSA developers on IRC regarding this issue several times.

Under XP, I've made a discovery of sorts: Windows XP's generic "Intel AC'97 Audio" driver has the same bad quality as ALSA, whilst the "Sigmatel C-Major Audio" drivers (from Dell's site) has excellent quality.The impression I have been given by the ALSA developers is that the Sigmatel drivers equalize the audio, perhaps because the laptop's speakers can't exploit the full frequency range of the audio chipset.

Either way, this is the only way to somewhat fix the poor audio quality on my laptop at the moment.
psyke83 is offline   Reply With Quote
Old June 24th, 2007   #7
Morbett
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 100
Re: Bad sound? Try this...

Hmm, yeah, I sort of discovered that's an artificial fix today. In Exaile I put on an album that is very recent (great production and high levels) and the louder parts of songs were distorting.

So now I reverted back to the way my speakers were before I followed these instructions. Unfortunate the drivers/ALSA don't work properly!
Morbett is offline   Reply With Quote
Old June 24th, 2007   #8
psyke83
Chocolate-Covered Ubuntu Beans
 
Join Date: Nov 2005
Location: Ireland
Beans: 2,302
Ubuntu 9.04 Jaunty Jackalope
Re: Bad sound? Try this...

Morbett,

You need to keep the PCM volume below 74% to avoid distortions. That's a bug with ALSA's ladspa plugin system. Using the same caps ladspa filter in Audacious with it's ladspa plugin system, there's no distortion at higher volumes. However, keeping the PCM/Master below 74 almost always avoids distortion.

This isn't a perfect fix by any means, but the ALSA developers aren't responding to my bug report...
psyke83 is offline   Reply With Quote
Old June 24th, 2007   #9
Morbett
A Carafe of Ubuntu
 
Join Date: Feb 2006
Beans: 100
Re: Bad sound? Try this...

Ah, ok, thank you for the tip! I had it above 74%.
Morbett is offline   Reply With Quote
Old June 24th, 2007   #10
CompactDestruction
5 Cups of Ubuntu
 
Join Date: Jun 2007
Beans: 34
Re: Bad sound? Try this...

I have a laptop too and also think this issue is simply from being able to turn up the volume much higher than in Windows, thereby causing distortion to occur on those tinny laptop speakers.

I notice on your equalizer controls that your settings are to reduce the volume of mid-frequencies, which would help by lowering the volume and allowing less audible portions of audio to come through better.
CompactDestruction is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:24 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry