mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-04 10:26:02 -05:00
Merge pull request #288 from pcoultha/mixer_device
[ALSA] Add mixer_device configuration file option for ALSA
This commit is contained in:
commit
89e3f05585
@ -163,13 +163,17 @@ audio {
|
|||||||
# Type of the output (alsa, pulseaudio or dummy)
|
# Type of the output (alsa, pulseaudio or dummy)
|
||||||
# type = "alsa"
|
# type = "alsa"
|
||||||
|
|
||||||
# Audio device name for local audio output - ALSA only
|
# Audio PCM device name for local audio output - ALSA only
|
||||||
# card = "default"
|
# card = "default"
|
||||||
|
|
||||||
# Mixer channel to use for volume control - ALSA only
|
# Mixer channel to use for volume control - ALSA only
|
||||||
# If not set, PCM will be used if available, otherwise Master.
|
# If not set, PCM will be used if available, otherwise Master.
|
||||||
# mixer = ""
|
# mixer = ""
|
||||||
|
|
||||||
|
# Mixer device to use for volume control - ALSA only
|
||||||
|
# If not set, the value for "card" will be used.
|
||||||
|
# mixer_device = ""
|
||||||
|
|
||||||
# Syncronization - ALSA only
|
# Syncronization - ALSA only
|
||||||
# If your local audio is out of sync with AirPlay, you can adjust this
|
# If your local audio is out of sync with AirPlay, you can adjust this
|
||||||
# value. Positive values correspond to moving local audio ahead,
|
# value. Positive values correspond to moving local audio ahead,
|
||||||
|
@ -99,6 +99,7 @@ static cfg_opt_t sec_audio[] =
|
|||||||
CFG_STR("type", NULL, CFGF_NONE),
|
CFG_STR("type", NULL, CFGF_NONE),
|
||||||
CFG_STR("card", "default", CFGF_NONE),
|
CFG_STR("card", "default", CFGF_NONE),
|
||||||
CFG_STR("mixer", NULL, CFGF_NONE),
|
CFG_STR("mixer", NULL, CFGF_NONE),
|
||||||
|
CFG_STR("mixer_device", NULL, CFGF_NONE),
|
||||||
CFG_INT("offset", 0, CFGF_NONE),
|
CFG_INT("offset", 0, CFGF_NONE),
|
||||||
CFG_END()
|
CFG_END()
|
||||||
};
|
};
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
// TODO Unglobalise these and add support for multiple sound cards
|
// TODO Unglobalise these and add support for multiple sound cards
|
||||||
static char *card_name;
|
static char *card_name;
|
||||||
static char *mixer_name;
|
static char *mixer_name;
|
||||||
|
static char *mixer_device_name;
|
||||||
static snd_pcm_t *hdl;
|
static snd_pcm_t *hdl;
|
||||||
static snd_mixer_t *mixer_hdl;
|
static snd_mixer_t *mixer_hdl;
|
||||||
static snd_mixer_elem_t *vol_elem;
|
static snd_mixer_elem_t *vol_elem;
|
||||||
@ -316,7 +317,7 @@ mixer_open(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = snd_mixer_attach(mixer_hdl, card_name);
|
ret = snd_mixer_attach(mixer_hdl, mixer_device_name);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_LAUDIO, "Failed to attach mixer: %s\n", snd_strerror(ret));
|
DPRINTF(E_LOG, L_LAUDIO, "Failed to attach mixer: %s\n", snd_strerror(ret));
|
||||||
@ -989,6 +990,9 @@ alsa_init(void)
|
|||||||
|
|
||||||
card_name = cfg_getstr(cfg_audio, "card");
|
card_name = cfg_getstr(cfg_audio, "card");
|
||||||
mixer_name = cfg_getstr(cfg_audio, "mixer");
|
mixer_name = cfg_getstr(cfg_audio, "mixer");
|
||||||
|
mixer_device_name = cfg_getstr(cfg_audio, "mixer_device");
|
||||||
|
if (mixer_device_name == NULL || strlen(mixer_device_name) == 0)
|
||||||
|
mixer_device_name = card_name;
|
||||||
nickname = cfg_getstr(cfg_audio, "nickname");
|
nickname = cfg_getstr(cfg_audio, "nickname");
|
||||||
offset = cfg_getint(cfg_audio, "offset");
|
offset = cfg_getint(cfg_audio, "offset");
|
||||||
if (abs(offset) > 44100)
|
if (abs(offset) > 44100)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user