Results 1 to 7 of 7

Thread: Tip: Quick, easy, sweet improvement of the sound quality

  1. #1
    Join Date
    Sep 2005
    Location
    France
    Beans
    11

    Lightbulb Tip: Quick, easy, sweet improvement of the sound quality

    Something most users ignore is that the default Dmix's resampling to 48khz quite screws up 44.1khz sound. The Dmix behaviour might change in the future, but for now this isn't the right behaviour for most users.. If you have a standard usage of your desktop, you would like the best sound quality from music and movies and, on the other hand, while listening music you might do other stuff requiring sound ( watching Web videos, gaming, voip, .. ). Almost all music is 44.1khz material, so the first right thing to do is to set Dmix default samplerate to 44.1khz.. :
    Code:
    #Into /etc/asound.conf
    
    pcm.!default {
       type plug
       slave.pcm {
           type dmix
           ipc_key 1024
           slave {
               pcm "hw:0,0"
               rate 44100
           }
       }
    }
    ..in such a way you can enjoy Dmix ( the "default" pseudo-device ) in your music players without quality loss. And if you want to avoid 48khz->44.1khz resampling in movies either, setup your movies players to use the "plughw:0,0" device ( for mono/stereo ), taking into account that no other sound will be played when watching movies ( which may be what you want )

    Also from Feisty, there will be the "samplerate" plugin available in official packages. Once you will have upgraded ( not before ), install the "libasound2-plugins" package and add this line at the top of /etc/asound.conf :
    Code:
    defaults.pcm.rate_converter "samplerate"
    Dmix will then employ a much better resampling algorithm than the default one, and some apps such as Skype(32khz) will greatly benefit from it.


    NOTE 1 :
    My tip doesn't take into account arts, esound, and other sound servers, which may "replace" Dmix and hide your configuration. Note that there's always a way to get rid of them - at least for non-too-exotic software.

    NOTE 2 :
    There are others resampling algorithms in the libasound2-plugins package :
    samplerate_best
    samplerate_linear
    samplerate_medium
    samplerate_order
    IMO (just) "samplerate" is the best load/quality compromise, but if you're interested in testing also the others simply replace "samplerate" in the asound.conf file by one of the above.

    NOTE 3 :
    A specific case is for soundcards doing resampling everything to 48khz themselves : AC'97 onboard chipsets, all Creative Live and Audigy series, Hercules Fortissimo I/II/III ( not the IV ). Due to their limited power and flexibility, they perform quite crappy resampling on non-48khz material. On Windows this is avoided because kmixer resample everything by default to 48khz ( and certainely perform some other nasty destructive voodoo.. ). We might want something like this in that case :
    Code:
    defaults.pcm.rate_converter "samplerate"  # from Feisty only
    
    pcm.!default {
       type plug
       slave.pcm {
           type dmix
           ipc_key 1024
           slave {
               pcm "hw:0,0"
               rate 48000
           }
       }
    }
    Same than above except the rate set to 48000. This is the default Dmix configuration, but Dmix is not enabled by default on soundcards featuring "hardware" mixing. Software mixing instead of hardware mixing increases of course the CPU load, but it's negligible on all modern machines, and the difference in sound quality is really worth it.

    Et voilà!
    Last edited by SuperDindon; March 14th, 2007 at 09:21 PM.

  2. #2
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: Tip: Quick, easy, sweet improvement of the sound quality

    And the CPU load? How’s it affected?

  3. #3
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: Tip: Quick, easy, sweet improvement of the sound quality

    Pay attention that you listen to this with headphones and low volume first. This sample contains inaudible high frequency content at full intensity and may fry your tweeters.

    Listening to udial.wav I still get bad sirening artifatcs with only "samplerate". EDIT: bah, stupid me, I named th file .asound.conf instead of .asoundrc. Now sampelrate alone works well. Thanks!

    obsolete ↓

    How about you? If you don’t know it udial can reveal low quality resampling cards. Normally you shouldn’t hear any weird alien-like noises.
    Attached Files Attached Files
    Last edited by hugmenot; February 15th, 2007 at 01:58 AM.

  4. #4
    Join Date
    Aug 2006
    Beans
    137

    Re: Tip: Quick, easy, sweet improvement of the sound quality

    I know this is an old thread, but if anyone still reads it... I tried the suggestions on Feisty, featuring the Audigy SE. The value versions of those cards come without hardware mixing, and here comes dmix, mixing everything to 48k.

    As suggested in Note3:

    Code:
    defaults.pcm.rate_converter "samplerate" ....
    putting this in .asoundrc doesn't change anything from the default setup.

    using


    Code:
    defaults.pcm.rate_converter "samplerate_best" ....
    improves slightly treble reproduction (removes "aliasing"), however CPU usage while playing mp3 file with Rhythmbox jumps from default 7% to a whooping 25%. Measured on Ahtlon 64 3200+, Feisty running Compiz. 1 GHz or so CPU would hardly avoid skipping with this setting.

  5. #5
    Join Date
    Sep 2005
    Location
    France
    Beans
    11

    Re: Tip: Quick, easy, sweet improvement of the sound quality

    Quote Originally Posted by Jonie View Post
    As suggested in Note3:

    Code:
    defaults.pcm.rate_converter "samplerate" ....
    putting this in .asoundrc doesn't change anything from the default setup.
    As the time I was writing this topic Dmix's default resampling algorithm was an internal algorithm, not "samplerate", and this likely hasn't changed yet since I can't find any line in the changelog and "samplerate" is still part of the alsa-plugins package ( "samplerate***" are actually plugins taking advantage of libsamplerate, i.e an external library not really closely related to ALSA )

  6. #6
    Join Date
    Apr 2006
    Beans
    16

    Re: Tip: Quick, easy, sweet improvement of the sound quality

    I'm using the on-board sound on my motherboard which uses the Realtek ALC850. I was experiencing bad sound quality, popping, crackling, and major distortion of any loud really low or high frequency sounds.

    After reading through all the guides in this thread, none helped, but I did notice a trend, most said to lower the volume. After further inspection, I noticed alsamixer provides the user with the measure of adjustment to the dB gain, to all channels.

    My fix was to lower the PCM level so that the dB gain shown at the top left hand corner in alsamixer was equal to zero. Any higher or lower than that would lead to major distortion of sound.

  7. #7
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: Tip: Quick, easy, sweet improvement of the sound quality

    Yeah, for some strange reason the PCM slider is set to amplify above 0dB. Of course this leads to clipping of the audio. The General slider should be safe to put to the max, though.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •