output: use the software mixer plugin

Do all the software volume stuff inside each output thread, not in the
player thread.  This allows one software mixer per output device, and
also allows the user to configure the mixer type (hardware or
software) for each audio output.

This moves the global "mixer_type" setting into the "audio_output"
section, deprecating the "mixer_enabled" flag.
This commit is contained in:
Max Kellermann
2009-07-06 22:00:50 +02:00
parent da8095db54
commit 0275690b5c
12 changed files with 80 additions and 153 deletions

View File

@@ -285,6 +285,12 @@ whatever audio format is passed to the audio output.
.B device <dev>
This specifies the device to use for audio output. The default is "default".
.TP
.B mixer_type <hardware, software or none>
Specifies which mixer should be used for this audio output: the
hardware mixer (available for ALSA, OSS and PulseAudio), the software
mixer or no mixer ("none"). By default, the hardware mixer is used
for devices which support it, and none for the others.
.TP
.B mixer_device <mixer dev>
This specifies which mixer to use. The default is "default". To use
the second sound card in a system, use "hw:1".

View File

@@ -179,6 +179,7 @@ input {
# name "My ALSA Device"
# device "hw:0,0" # optional
# format "44100:16:2" # optional
# mixer_type "hardware" # optional
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
@@ -191,6 +192,7 @@ input {
# name "My OSS Device"
# device "/dev/dsp" # optional
# format "44100:16:2" # optional
# mixer_type "hardware" # optional
# mixer_device "/dev/mixer" # optional
# mixer_control "PCM" # optional
#}
@@ -214,6 +216,7 @@ input {
# genre "jazz" # optional
# public "no" # optional
# timeout "2" # optional
# mixer_type "software" # optional
#}
#
# An example of a httpd output (built-in HTTP streaming server):
@@ -255,6 +258,7 @@ input {
#audio_output {
# type "null"
# name "My Null Output"
# mixer_type "none" # optional
#}
#
# This setting will change all decoded audio to be converted to the specified
@@ -273,33 +277,6 @@ input {
###############################################################################
# Volume control mixer ########################################################
#
# These are the global volume control settings. By default, this setting will
# be detected to the available audio output device, with preference going to
# hardware mixing. Hardware and software mixers for individual audio_output
# sections cannot yet be mixed.
#
# An example for controlling an ALSA, OSS or Pulseaudio mixer; If this
# setting is used other sound applications will be affected by the volume
# being controlled by MPD.
#
#mixer_type "hardware"
#
# An example for controlling all mixers through software. This will control
# all controls, even if the mixer is not supported by the device and will not
# affect any other sound producing applications.
#
#mixer_type "software"
#
# This example will not allow MPD to touch the mixer at all and will disable
# all volume controls.
#
#mixer_type "disabled"
#
###############################################################################
# Normalization automatic volume adjustments ##################################
#
# This setting specifies the type of ReplayGain to use. This setting can have

View File

@@ -289,13 +289,15 @@ cd mpd-0.14.2</programlisting>
</row>
<row>
<entry>
<varname>mixer_enabled</varname>
<parameter>yes|no</parameter>
<varname>mixer_type</varname>
<parameter>hardware|software|none</parameter>
</entry>
<entry>
Specifies whether the hardware mixer of this audio
output should be used. By default, all hardware
mixers are enabled if available.
Specifies which mixer should be used for this audio
output: the hardware mixer (available for ALSA, OSS
and PulseAudio), the software mixer or no mixer
("none"). By default, the hardware mixer is used for
devices which support it, and none for the others.
</entry>
</row>
</tbody>