From b822540787bcecffb5170ac808ebb7df9f01a0d1 Mon Sep 17 00:00:00 2001 From: James Courtier-Dutton Date: Mon, 1 Sep 2003 04:08:41 +0000 Subject: Add proper support for 4.1 and 5 channel setups. For 4.1, the output comes out on 3 stereo jacks, but the Center has been mixed with the Front speakers. For 5, the LFE channel has been dropped. CVS patchset: 5324 CVS date: 2003/09/01 04:08:41 --- src/audio_out/audio_alsa_out.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'src/audio_out/audio_alsa_out.c') diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 09a13fe15..c88e1291c 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -26,7 +26,7 @@ * (c) 2001 James Courtier-Dutton * * - * $Id: audio_alsa_out.c,v 1.105 2003/09/01 00:51:45 jcdutton Exp $ + * $Id: audio_alsa_out.c,v 1.106 2003/09/01 04:08:41 jcdutton Exp $ */ #ifdef HAVE_CONFIG_H @@ -321,22 +321,14 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int 10, NULL, NULL); break; + case AO_CAP_MODE_4_1CHANNEL: case AO_CAP_MODE_5CHANNEL: - this->num_channels = 5; - pcm_device = config->register_string(config, - "audio.alsa_surround50_device", - "surround51", - _("device used for 5-channel output"), - NULL, - 10, NULL, - NULL); - break; case AO_CAP_MODE_5_1CHANNEL: this->num_channels = 6; pcm_device = config->register_string(config, "audio.alsa_surround51_device", "surround51", - _("device used for 5.1-channel output"), + _("device used for 5+ channel output"), NULL, 10, NULL, NULL); @@ -1204,13 +1196,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da NULL, 10, NULL, NULL); - pcm_device = config->register_string(config, - "audio.alsa_surround50_device", - "surround51", - _("device used for 5-channel output"), - NULL, - 10, NULL, - NULL); pcm_device = config->register_string(config, "audio.alsa_surround51_device", "surround51", @@ -1298,7 +1283,21 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { printf ("(4-channel not enabled in xine config) " ); } - if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 5)) && + if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 6)) && + config->register_bool (config, + "audio.four_lfe_channel", + 0, + _("used to inform xine about what the sound card can do"), + NULL, + 0, NULL, + NULL) ) { + this->capabilities |= AO_CAP_MODE_4_1CHANNEL; + if (class->xine->verbosity >= XINE_VERBOSITY_LOG) + printf ("4.1-channel "); + } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { + printf ("(4.1-channel not enabled in xine config) " ); + } + if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 6)) && config->register_bool (config, "audio.five_channel", 0, -- cgit v1.2.3