Hissing noise on Realtek HD onboard audio in Debian

It was because mics were enabled. Open gnome-alsamixer, and disable the following:

“Front Mi”, “Mic”


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Fix for low sound volume on Realtek onboard audio Realtek ALC662 rev1

I have Realtek Onboard Audio which I use to power my headphones, when I dont want to use the Creative speakers. I found that had miniscule sound output after installing Debian. As with most of the stuff I did with Debian, I went around to the cause of this and workarounds. I had already compiled a kernel with alsa support, and Debian unlike Ubuntu doesnt ship with the annoying Pulseaudio. So the drivers werent the issue. I discovered that I could create a “virtual” PCM device and insert another slider in the alsa  configuration system, and get it to boost volume tremendously. I couldnt even perceive any distortion as such.

Create a new file /etc/asound.conf or create ~/.asoundrc. I believe that the system version overrides the user version.

[[email protected] ~]$ cat /etc/asound.conf
pcm.!default {
      type plug
      slave.pcm "softvol"
  }

  pcm.softvol {
      type softvol
      slave {
          pcm "dmix"
      }
      control {
          name "Pre-Amp"
          card 0
      }
      min_dB -5.0
      max_dB 120.0
      resolution 10
  }

It creates a new slider in alsamixer, which can be used to boost the sound volume significantly.

I also added the following line to the end of /etc/modprobe.d/alsa-base.conf:

#Fix for HDAudio card
options snd-hda-intel model=ALC662

To see the difference, restart the service:

sudo alsa force-reload

I did some more tweaking with it, and I believe increased the sound even further. However it was supposed to display an additional volume slider (in adddition to the one which I added via above code).

[[email protected] ~]$cat /etc/asound.conf
pcm.!default {
      type plug
      slave.pcm "softvol"
  }

  pcm.softvol {
      type softvol
      slave {
          pcm "dmix"
      }
      control {
          name "Pre-Amp"
          card 0
      }
      min_dB -5.0
      max_dB 120.0
      resolution 10
  }
pcm.softvol {
    type            softvol
    slave {
        pcm         "ALC662"
    }
    control {
        name        "SpecialBoost"
        card        0
    }
}

 

Some debug info:

[[email protected] ~]$ cat /proc/asound/card0/codec* | grep Codec
1:Codec: Realtek ALC662 rev1

Some useful resources:
1. Alsa howto


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Restarting sound on Ubuntu

sudo /sbin/alsa force-reload[/code]


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Restore alsa mixer settings on boot

Warning: If you use kmix, make sure to configure it to not restore sound levels at startup. This will conflict with the configuration detailed below.

  • Run alsactl -f /var/lib/alsa/asound.state store once to create /var/lib/alsa/asound.state.
# alsactl -f /var/lib/alsa/asound.state store[/code]

  • Edit /etc/rc.conf and add "alsa" to the list of daemons to start on boot-up. This will store the mixer settings on every shutdown and restore them when you boot.
  • If the mixer settings are not loaded on boot-up, add the following line to /etc/rc.local:
# alsactl -f /var/lib/alsa/asound.state restore[/code]

  • These methods still may not work, or you may prefer to have audio settings for individual users. In this case, run alsactl store -f ~/.asoundrc as a normal user. This will save and restore volume settings on a per user basis. To automate this process, add the respective commands to ~/.bash_login and ~/.bash_logout, or the correct locations for the shell of your choice.

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Ubuntu not saving sound settings (Alsa Mixer)

I found that my Creative Soundblaster doesnt play sound if IEC958 is enabled in alsa mixer settings (gnome-alsamixer). So I had to disable it manually every time I boot.

To restore alsa settings automatically at boot:

First save settings after properly configuring it:

alsactl store 0[/code]

or

sudo alsactl store 0
sudo kate /etc/rc.local[/code]

Add the following to /etc/rc.local:

#!/bin/sh -e

 #
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
alsactl restore
exit 0[/code]

If while running alsactl store, you get a message "Cannot open /var/lib/alsa/asound.state for writing: Permission denied", and furthermore another message "Home directory not ours" while running it as sudo, then you have to temporarily change the permissions on the file to enable write

sudo chmod 777 /var/lib/alsa/asound.state
alsactl store 0
sudo chmod 644 /var/lib/alsa/asound.state[/code]

You may also require to clear the pulse audio settings to be certain that they dont get loaded up.

rm ~/.pulse/*[/code]


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Renabling CA0106 (Creative Soundblaster Audigy) on Kubuntu

This was the most annoying issue, and apparently a conformed bug, which causes Ubuntu to fail to send sound through the Audigy device. It is shown as working, but there isnt any sound output:

Workaround as posted here.

  1. Install Gnome Alsa mixer: sudo apt-get install gnome-alsamixer
  2. Open Alsa Mixer (Type Alsa in search bar), under CA0106 and any other Audio device, untick IEC958, no need to enable anything else if it isnt already enabled. In fact none of the checkboxes are enabled on my system.
  3. Now right click the Audio icon on the Start bar, Select Mixer.
  4. Settings>Audio setup
  5. Audio playback>Music>CA0106 Soundblaster Analog Stereo>Test
  6. Now system should play sound normally!

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.