Differences between revisions 22 and 23
Revision 22 as of 2008-12-26 23:11:37
Size: 10001
Editor: ?PaulMenzel
Comment: aptitude is recommended package manager.
Revision 23 as of 2008-12-26 23:13:26
Size: 9993
Editor: ?PaulMenzel
Comment: Correct command.
Deletions are marked like this. Additions are marked like this.
Line 106: Line 106:
aptitude install -t experimental install alsa-source aptitude -t experimental install alsa-source

Translation(s): [:DebianEeePCFrench/HowTo/Sound:French] [:DebianEeePCGerman/HowTo/Sound:German] [:DebianEeePCPortuguese/HowTo/Sound:Portuguese]

Sound for most Eee PC models with Alsa should ‘just work’. The following are tips to make it work optimally for certain applications or to work around problems with specific models.

?TableOfContents

Model 900A, 901, 1000 and 1000H front Microphone

See [#head-18b220763f041b831de7207ecfeabf28a696aff9 Install an updated Alsa driver] below.

Alsamixer

If you’re setting up your system to use an application like Ekiga to do VoIP/video conferencing then you will probably want to know how to use [:AlsaMixer:alsamixer] utility to access the low-level mixer channels on your audio card. There are GUI versions of alsamixer, but the alsamixer program is almost always installed by default. It is provided by the alsa-utils package.

To use it open up a terminal and use the 'alsamixer' program. It has three views (Playback settings, Capture settings, all settings) and you can switch between them with the tab button. You can press left arrow key or right arrow key to move from mixer to mixer and up arrow and down arrow key to change volumes. The m button will toggle mute for the devices that support it and space bar will toggle capture status for settings that support that. The '?' button will show the help dialog for more controls.

For the EeePC’s microphone you’ll probably want to adjust these settings: use the tab button to select the all view.

Arrow over to the capture setting and toggle it on using the space bar. Make sure the volume is around 70 %.

Make sure that i-mic (internal mic) is selected as the input source. (If i-mic doesn’t appear, try Front Mic.) Press up and down arrow to select input device.

Arrow over to the i-mic mixer settings. Set the volume at 70 % and then set the i-mic boost to 33 %.

That should give a good basis for playing around with your own settings till you get it perfect. The i-mic boost should be set to zero or 33 %. Anything above that and I get horrible sound distortion through Ekiga.

For testing audio performance Audacity is a good choice. Make sure that you go through the preferences and it is setup to use ["ALSA"].

GNOME Sound Recorder application from gnome-media is ok for doing recording. You just have to make sure that the codec it uses is either WAV, ["MP3"], or speex when doing the recording. The default is to use Ogg/Vorbis and the EeePC isn’t quite fast enough to do that encoding in real-time leading to very bad sound quality.

ALSA configuration

This can improve performance for your sound system when playing multiple sounds, recording to multiple programs, playing games, or watching videos on your EeePC.

For more details on what this file is and what to do with it see http://alsa.opensrc.org/.asoundrc.

pcm.my_card {
  type hw
  card 0
  # mmap_emulation true
}
pcm.dmixed {
  ## This provides software mixing for audio out
  type dmix
  ipc_key 1024
  slave {
  pcm "my_card"
  ## period_size and buffer_size
  ## can be modified to reduce
  ## latency or add more 'cusion'
  ## through the buffer
  period_size 1024
  buffer_size 4096
  rate 44100
  }
}
pcm.dsnooped {
  ## this provides software mixing for audio in
  type dsnoop
  ipc_key 2048
  slave {
  pcm "my_card"
  period_size 1024
  buffer_size 4096
  rate 44100
  }
}
pcm.asymed {
  ## this plugin allows you to bind both
  ## the dmix and dsnoop plugins together
  type asym
  playback.pcm "dmixed"
  capture.pcm "dsnooped"
}
pcm.pasymed {
  ## if you do not want to use use
  ## mixing by default, you can delete
  ## !default entry below and direct
  ## apps to use this 'device' as a
  ## extra option
  type plug
  slave.pcm "asymed"
}
pcm.dsp0 {
  ## this allows most OSS-only apps
  ## to use this mixing stuff
  ## through the use of the aoss wrapper
  type plug
  slave.pcm "asymed"
}
pcm.!default {
  ## this makes alsa apps default
  ## to use this config
  type plug
  slave.pcm "asymed"
}

Install an updated Alsa driver

A convenient way to update your Alsa driver is to use the alsa-source package from experimental (1.0.18.dfsg-1 as of the time of writing). Just add [:DebianExperimental] to your /etc/apt/sources.list and:

aptitude install module-assistant
m-a prepare
aptitude -t experimental install alsa-source
m-a build alsa
m-a install alsa

Testing your updated driver

After updating the alsa driver, you need to reboot.

After the reboot, have a look at your mixer settings with alsamixer or the gnome-volume-control, the channels have changed from the stock driver.

FixMe: the following advice is in dispute. We need to correct it, simplify it and/or fix it in the eeepc-acpi-scripts package.

  • Playback: PCM. this is the master volume for the speakers
  • Playback: ?LineOut. this is the volume for the headphone socket

  • Recording: Capture. this is the record level for the front mic. it only seems usable at about 30% otherwise it’s just really distorted
  • Recording: Digital. this is the record level for the external mic in. It’s a lot quieter than the front mic even at 100%, perhaps we’re missing some ?MicBoost like the stock driver has.

To get your hot keys to work again you need to edit /etc/default/eee-acpi-scripts and change the mixer labels

VOLUME_LABEL='LineOut'
VOLUME_LABEL='iSpeaker'

to

VOLUME_LABEL='PCM'
VOLUME_LABEL='LineOut'

[psyche] Are you sure there should be two VOLUME_LABEL keys? I think for the second item should be HEADPHONE_LABEL='?LineOut'

[?TimoZimmermann] After installing eeepc-acpi-scripts 1.0.10 the following steps were unnecessary for me.

You also need to add the line

I_SWITCH_LABEL='iSpeaker'

This should get the volume keys working again.

To get the mute key to work you need to edit /etc/acpi/actions/hotkey.sh. Comment out the line (around line number 50)

status=$(amixer get $VOLUME_LABEL | sed -n '/%/{s/.*\[\(on\|off\)\].*/\u\1/p;q}')

and add this line underneath it

status=$(amixer get $I_SWITCH_LABEL | sed -n 's/.*\[\(on\|off\)\].*/\1/;ta;d;:a;p;q')

Further down in the ‘# Fn+F7 -- mute/unmute speakers’ section, comment out the line

amixer -q set $VOLUME_LABEL toggle

and add instead

amixer -q set $I_SWITCH_LABEL toggle

You should now be all set.

ALSA OSS

On my system the oss_mixer did not work at all (using i.e. wmmixer as ?DockApp in fvwm2). The reason seemed to be the mapping of ALSA to OSS by kernel module snd_mixer_oss. It can be seen in /proc/asound/card0/oss_mixer. On my system i saw no matchings:

eee1000:~# cat /proc/asound/card0/oss_mixer
VOLUME "" 0
BASS "" 0
TREBLE "" 0
SYNTH "" 0
PCM "" 0
SPEAKER "" 0
LINE "" 0
MIC "" 0
CD "" 0
IMIX "" 0
ALTPCM "" 0
RECLEV "" 0
IGAIN "" 0
OGAIN "" 0
LINE1 "" 0
LINE2 "" 0
LINE3 "" 0
DIGITAL1 "" 0
DIGITAL2 "" 0
DIGITAL3 "" 0
PHONEIN "" 0
PHONEOUT "" 0
VIDEO "" 0
RADIO "" 0
MONITOR "" 0

The right mappings can be written to the file when booting by adding these four lines to the end of /etc/init.d/rc.local file:

echo 'VOLUME "PCM" 0' > /proc/asound/card0/oss_mixer
echo 'LINE "LineOut" 0' > /proc/asound/card0/oss_mixer
echo 'MIC "Capture" 0' > /proc/asound/card0/oss_mixer
echo 'PHONEIN "Digital" 0' > /proc/asound/card0/oss_mixer

Afterwards we have a working configuration:

eee1000:~# cat /proc/asound/card0/oss_mixer
VOLUME "PCM" 0
BASS "" 0
TREBLE "" 0
SYNTH "" 0
PCM "" 0
SPEAKER "" 0
LINE "LineOut" 0
MIC "Capture" 0
CD "" 0
IMIX "" 0
ALTPCM "" 0
RECLEV "" 0
IGAIN "Capture" 0
OGAIN "" 0
LINE1 "" 0
LINE2 "" 0
LINE3 "" 0
DIGITAL1 "" 0
DIGITAL2 "" 0
DIGITAL3 "" 0
PHONEIN "Digital" 0
PHONEOUT "" 0
VIDEO "" 0
RADIO "" 0
MONITOR "" 0

Alternate versions: updated kernel or upstream source for Alsa driver

Although the alsa-source from experimental should be sufficient to solve the front mic issue, if you are interested in trying new things, you may instead use a more recent kernel or get the latest alsa driver from upstream.

TODO: List reasons why a user would want to do this instead of just using the recommended experimental alsa-source.

Linux kernel 2.6.28-rc1 and later contain a sufficiently-recent ALSA driver. If you have that version or later (if you're using a stock lenny kernel, you don't), there is no point in you rebuilding the driver.

Otherwise, grab the upstream source from here: ftp://ftp.alsa-project.org/pub/driver/. At the time of writing, alsa-driver-1.0.18a.tar.bz2 is current. We have verified that 1.0.18rc1 works as well.

You will need the appropriate linux-headers package installed.

Next you need to unpack it somewhere like /usr/src/ then build it. You may want to backup your old driver first

/lib/modules/2.6.26-1-686/kernel/sounds/pci/hda/# cp snd-hda-intel.ko snd-hda-intel.ko.stock
/usr/src/alsa-driver-1.0.18rc1# ./configure --with-cards=hda-intel --with-options=all
/usr/src/alsa-driver-1.0.18rc1# make
/usr/src/alsa-driver-1.0.18rc1# make install
/usr/src/alsa-driver-1.0.18rc1# ./snddevices

According to the INSTALL file in alsa-driver, the last step is unnecessary when running udev. That file also recommends using 'make install-modules' rather than 'make install', assuming that the Debian alsa-utils and alsa-base packages are already installed.

You can verify your new driver with

ls -l /lib/modules/2.6.26-1-686/updates/alsa/

Check that the date on the snd-hda-intel.ko is about the time you compiled it :)

Now follow the rest of the instructions from [#head-6a6736b51e5eb1fc167a090056015171a60998e4 Testing your updated driver].