Sound tips and tricks
From MEPIS Documentation Wiki
Contents |
Introduction
Here various tips are collected that may be of help in particular situations.
Software Sound Mixing
Solution One
One of the biggest complaints heard about Linux's sound system is its inability to play multiple sounds at once. The reason for this is the software expects your hardware to do the mixing for you. However, only expensive cards do this. If you put the file below into your home folder as the file .asoundrc it will tell the software to do the mixing. However, some applications are known to ignore this
To create the file, copy and paste this text to konsole as normal user:
cat > ~/.asoundrc << "EOF"
pcm.my_card {
type hw
card 0
# mmap_emulation true
}
pcm.dmixed {
type dmix
ipc_key 1024
slave {
pcm "my_card"
# rate 48000
# period_size 512
}
}
pcm.dsnooped {
type dsnoop
ipc_key 2048
slave {
pcm "my_card"
# rate 48000
# period_size 128
}
}
pcm.asymed {
type asym
playback.pcm "dmixed"
capture.pcm "dsnooped"
}
pcm.pasymed {
type plug
slave.pcm "asymed"
}
pcm.dsp0 {
type plug
slave.pcm "asymed"
}
pcm.!default {
type plug
slave.pcm "asymed"
}
EOF
Solution Two
If the above file does not work, you can try configuration, which is known to work with Intel HDA on board audio chips.
To create the file, copy and paste this text to konsole as normal user:
cat > ~/.asoundrc << "EOF"
pcm.CARD_0 {
type hw
card 0
}
ctl.CARD_0 {
type hw
card 0
}
EOF
Duplicate output on multiple cards
If you have two sound cards, for example an USB sound device and an analog Intel card, here's an example of .asoundrc file that will help you sending the output to both cards at the same time (modify the .asoundrc config file as needed for your hardware). You can find more details on ALSA project page].
To create the file, copy and paste this text to konsole as normal user:
cat > ~/.asoundrc << "EOF"
pcm.!default plug:both
ctl.!default {
type hw
card "Audio"
}
pcm.both {
type route;
slave.pcm {
type multi;
slaves.a.pcm "intel";
slaves.b.pcm "usb";
slaves.a.channels 2;
slaves.b.channels 2;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
}
ttable.0.0 1;
ttable.1.1 1;
ttable.0.2 1;
ttable.1.3 1;
}
ctl.both {
type hw;
card "Audio";
}
pcm.usb {
type dmix
ipc_key 1024
slave {
pcm "hw:1"
period_time 0
period_size 2048
buffer_size 65536
buffer_time 0
periods 128
rate 48000
channels 2
}
bindings {
0 0
1 1
}
}
ctl.usb {
type hw
card "USB Audio"
}
pcm.intel {
type dmix
ipc_key 2048
slave {
pcm "hw:0"
period_time 0
period_size 2048
buffer_size 65536
buffer_time 0
periods 128
rate 48000
channels 2
}
bindings {
0 0
1 1
}
}
ctl.intel {
type hw
card "Intel Audio"
}
EOF
Check user's group permissions
A user experiencing sound problems must be a member of the "audio" group.
To check group membership: click KMenu --> System --> More Applications --> User Manager (KUser), and click on the Groups tab. Double-click the audio entry, and you should see your username in the left-hand panel. If not, highlight your username in the right-hand panel and click Add <- to move it over.
Check for muting
Sometimes the sound may be muted. You can use alsamixer or KMix to configure the audio channels correctly.
Using alsamixer
To start, type in Konsole as root (#).
alsamixer
Adjust sound levels using the following controls:
- Selected slider is highlighted in red.
- Up/down arrows move the selected slider's settings up/down.
- Left/right arrows select new slider.
- Use m to toggle mute status for the slider (MM is off, 00 is on (highlighted in green).
- Press Esc to quit alsamixer.
To save these new settings:
alsactl store
Using Kmix
- Kmenu > Multimedia > Sound Mixer (Kmix) > Output.
- Make sure that all slider buttons are on (green).
- Also ensure all sliders are up, especially PCM (second left) which has no button.
Sound howto | FAQ | Main Page
Add a pre-amp slide
Check if you have a file called /etc/asound.conf if you do skip step 1 and simply paste the code in the file
- alt F2
kdesu kwrite /etc/asound.conf
2. paste this code in
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 20.0
resolution 6
}
Now reboot and when you open kmix the new slider on the right of Output is your pre-amp, if the Pre-amp slider does not appear replace the second line of code type plugwith
type hwthis may be necessary with some laptops.
The original code was from increase the maximum sound level in Ubuntu