Here is the wiki i fallowed : http://mpd.wikia.com/wiki/Alsa
and more exactly this part :
And this works greatly, i got two sperated sound chanels : one callled "MPD" for any mpd client, and the other called "Software" for the rest of the system's sounds,but this asound.conf also include a minor issue with my macbook's internal microphone which doesn't work anymore.ALSA MPD software volume control
The following is what is needed to get a working software volume control that can be controlled by alsamixer, as well as the mpd volume control. This allows mpd to be lowered in volume, but not the other sounds on your system (or vice-versa)
An alternative to this ALSA configuration would be to simply add the following to /etc/mpd.conf and restart mpd:
mixer_type "software"
[edit] Create asound.conf
First, the following lines are required in /etc/asound.conf. Note the software mixer mpdvol with the name "MPD". This will be used when editing the /etc/mpd.conf file. The software mixer "softvol" controls the level of the other sounds on your computer, and has the generic name of "Software".
# the sound card
pcm.real {
type hw
card 0
device 0
}
# the ipc stuff is needed for permissions, etc.
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave.pcm "real"
slave {
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.dmixer {
type hw
card 0
}
# software volume
pcm.softvol {
type softvol
slave.pcm "dmixer"
control {
name "Software"
card 0
}
}
# mpd volume control
pcm.mpdvol {
type softvol
slave.pcm "dmixer"
control {
name "MPD"
card 0
}
}
# ctrl for mpd volume
ctl.mpdvol {
type hw
card 0
}
# input
pcm.input {
type dsnoop
ipc_key 3129398
ipc_key_add_uid false
ipc_perm 0660
slave.pcm "810"
}
# duplex device
pcm.duplex {
type asym
playback.pcm "softvol"
capture.pcm "input"
}
# default devices
pcm.!default {
type plug
slave.pcm "duplex"
}
# for oss devices
pcm.dsp0 {
type plug
slave.pcm "duplex"
}
[edit] Edit mpd.conf
Next, the following lines need to be edited in /etc/mpd.conf:
The device line in the audio_output below should be set to the device name for the mpd volume that was specified above in the asound.conf file. Note that the mixer_device line uses the same device as the device line in the audio_output section, but that the mixer_control line should be set to the NAME that was given in asound.conf.
audio_output {
type "alsa"
name "Alsa Software Volume"
device "mpdvol"
}
and
mixer_type "alsa"
mixer_device "mpdvol"
mixer_control "MPD"
You will need to restart the mpd daemon before these settings to work. If they aren't working, you may try rebooting your system. You should see a listing for the volume for MPD using gnome-alsamixer or alsamixer. You can also control the volume setting using any other client for mpd (mpc, ncmpc, gmpc, sonata, etc.). It doesn't affect the other sounds on your system!
If i remove the asound.conf file from /etc/ to somewhere else, and restart /etc/init.d/alsasound mic comes back but i loose the possibility to set volume when i listen to music with my mpd client.
My sound device :
Code: Select all
00:08.0 Audio device: nVidia Corporation MCP79 High Definition Audio (rev b1)