summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_alsa_out.c170
-rwxr-xr-xsrc/audio_out/audio_directx_out.c12
-rw-r--r--src/audio_out/audio_esd_out.c9
-rw-r--r--src/audio_out/audio_irixal_out.c10
-rw-r--r--src/audio_out/audio_oss_out.c149
-rw-r--r--src/audio_out/audio_sun_out.c15
6 files changed, 212 insertions, 153 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c
index 0f1f77a10..d0a62dd4b 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 <James@superbug.demon.co.uk>
*
*
- * $Id: audio_alsa_out.c,v 1.134 2004/03/21 03:29:43 jcdutton Exp $
+ * $Id: audio_alsa_out.c,v 1.135 2004/04/10 14:53:42 mroi Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -349,56 +349,26 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int
switch (mode) {
case AO_CAP_MODE_MONO:
this->num_channels = 1;
- pcm_device = config->register_string(config,
- "audio.alsa_default_device",
- "default",
- _("device used for mono output"),
- NULL,
- 10, NULL,
- NULL);
+ pcm_device = config->lookup_entry(config, "audio.alsa_default_device")->str_value;
break;
case AO_CAP_MODE_STEREO:
this->num_channels = 2;
- pcm_device = config->register_string(config,
- "audio.alsa_front_device",
- "plug:front",
- _("device used for stereo output"),
- NULL,
- 10, NULL,
- NULL);
+ pcm_device = config->lookup_entry(config, "audio.alsa_front_device")->str_value;
break;
case AO_CAP_MODE_4CHANNEL:
this->num_channels = 4;
- pcm_device = config->register_string(config,
- "audio.alsa_surround40_device",
- "plug:surround40",
- _("device used for 4-channel output"),
- NULL,
- 10, NULL,
- NULL);
+ pcm_device = config->lookup_entry(config, "audio.alsa_surround40_device")->str_value;
break;
case AO_CAP_MODE_4_1CHANNEL:
case AO_CAP_MODE_5CHANNEL:
case AO_CAP_MODE_5_1CHANNEL:
this->num_channels = 6;
- pcm_device = config->register_string(config,
- "audio.alsa_surround51_device",
- "plug:surround51",
- _("device used for 5+ channel output"),
- NULL,
- 10, NULL,
- NULL);
+ pcm_device = config->lookup_entry(config, "audio.alsa_surround51_device")->str_value;
break;
case AO_CAP_MODE_A52:
case AO_CAP_MODE_AC5:
this->num_channels = 2;
- pcm_device = config->register_string(config,
- "audio.alsa_a52_device",
- "iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2",
- _("device used for 5.1-channel output"),
- NULL,
- 10, NULL,
- NULL);
+ pcm_device = config->lookup_entry(config, "audio.alsa_a52_device")->str_value;
break;
default:
xprintf (this->class->xine, XINE_VERBOSITY_DEBUG,
@@ -1118,14 +1088,7 @@ static void ao_alsa_mixer_init(ao_driver_t *this_gen) {
this->mixer.elem = 0;
snd_ctl_card_info_alloca(&hw_info);
- pcm_device = config->register_string(config,
- "audio.alsa_default_device",
- "default",
- _("device used for mono output"),
- NULL,
- 10, NULL,
- NULL);
-
+ pcm_device = config->lookup_entry(config, "audio.alsa_default_device")->str_value;
if ((err = snd_ctl_open (&ctl_handle, pcm_device, 0)) < 0) {
xprintf (this->class->xine, XINE_VERBOSITY_DEBUG, "audio_alsa_out: snd_ctl_open(): %s\n", snd_strerror(err));
return;
@@ -1262,13 +1225,7 @@ static void ao_alsa_mixer_init(ao_driver_t *this_gen) {
config->update_string(config, "audio.alsa_mixer_name", "PCM");
}
- this->mixer.name = config->register_string(config,
- "audio.alsa_mixer_name",
- "PCM",
- _("alsa mixer device"),
- NULL,
- 10, NULL,
- NULL);
+ this->mixer.name = config->lookup_entry(config, "audio.alsa_mixer_name")->str_value;
goto __again;
@@ -1292,8 +1249,10 @@ static void ao_alsa_mixer_init(ao_driver_t *this_gen) {
/* Create a thread which wait/handle mixer events */
send_events = config->register_num(config, "audio.alsa_hw_mixer", 1,
- _("Whether to generate an event when the hardware mixer values change"),
- _("When the hardware mixer changes, an event will be sent to the front-end"),
+ _("notify changes to the hardware mixer"),
+ _("When the hardware mixer changes, your application will receive "
+ "a notification so that it can update its graphical representation "
+ "of the mixer settings on the fly."),
10, NULL, NULL);
if (send_events == 1)
@@ -1348,58 +1307,69 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
xine_log(this->class->xine, XINE_LOG_MSG, _("snd_lib_error_set_handler() failed: %d"), err);
snd_pcm_hw_params_alloca(&params);
- /* Fill the .xinerc file with options */
+
this->mmap = config->register_bool (config,
"audio.alsa_mmap_enable",
0,
- _("used to inform xine about what the sound card can do"),
- NULL,
- 0, NULL,
+ _("sound card can do mmap"),
+ _("Enable this, if your sound card and alsa driver "
+ "support memory mapped IO.\nYou can try enabling it "
+ "and check, if everything works. If it does, this "
+ "will increase performance."),
+ 10, NULL,
NULL);
pcm_device = config->register_string(config,
"audio.alsa_default_device",
"default",
_("device used for mono output"),
- NULL,
+ _("xine will use this alsa device to output "
+ "mono sound.\nSee the alsa documentation "
+ "for information on alsa devices."),
10, NULL,
NULL);
pcm_device = config->register_string(config,
"audio.alsa_front_device",
"front",
_("device used for stereo output"),
- NULL,
+ _("xine will use this alsa device to output "
+ "stereo sound.\nSee the alsa documentation "
+ "for information on alsa devices."),
10, NULL,
NULL);
pcm_device = config->register_string(config,
"audio.alsa_surround40_device",
"surround40",
_("device used for 4-channel output"),
- NULL,
+ _("xine will use this alsa device to output "
+ "4 channel (4.0) surround sound.\nSee the "
+ "alsa documentation for information on alsa "
+ "devices."),
10, NULL,
NULL);
pcm_device = config->register_string(config,
"audio.alsa_surround51_device",
"surround51",
_("device used for 5.1-channel output"),
- NULL,
+ _("xine will use this alsa device to output "
+ "5 channel plus LFE (5.1) surround sound.\n"
+ "See the alsa documentation for information "
+ "on alsa devices."),
10, NULL,
NULL);
pcm_device = config->register_string(config,
"audio.alsa_a52_device",
"iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2",
_("device used for 5.1-channel output"),
- NULL,
+ _("xine will use this alsa device to output "
+ "undecoded digital surround sound. This can "
+ "be used be external surround decoders.\nSee the "
+ "alsa documentation for information on alsa "
+ "devices."),
10, NULL,
NULL);
/* Use the default device to open first */
- pcm_device = config->register_string(config,
- "audio.alsa_default_device",
- "default",
- _("device used for mono output"),
- NULL,
- 10, NULL,
- NULL);
+ pcm_device = config->lookup_entry(config, "audio.alsa_default_device")->str_value;
/*
* find best device driver/channel
@@ -1452,8 +1422,13 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
config->register_bool (config,
"audio.four_channel",
0,
- _("used to inform xine about what the sound card can do"),
- NULL,
+ _("sound system can handle 4.0 audio"),
+ _("Enable this, if you want your sound system to "
+ "receive four channel surround sound from xine. "
+ "This means two front channels (left and right) "
+ "and two rear channels (left and right).\n"
+ "You need to connect the necessary speakers to "
+ "take advantage of this."),
0, NULL,
NULL) ) {
this->capabilities |= AO_CAP_MODE_4CHANNEL;
@@ -1466,8 +1441,13 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
config->register_bool (config,
"audio.four_lfe_channel",
0,
- _("used to inform xine about what the sound card can do"),
- NULL,
+ _("sound system can handle 4.1 audio"),
+ _("Enable this, if you want your sound system to "
+ "receive four channel plus LFE surround sound from "
+ "xine. This means two front channels (left and "
+ "right), two rear channels (left and right) and a "
+ "subwoofer (LFE) channel.\nYou need to connect "
+ "the necessary speakers to take advantage of this."),
0, NULL,
NULL) ) {
this->capabilities |= AO_CAP_MODE_4_1CHANNEL;
@@ -1480,8 +1460,13 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
config->register_bool (config,
"audio.five_channel",
0,
- _("used to inform xine about what the sound card can do"),
- NULL,
+ _("sound system can handle 5.0 audio"),
+ _("Enable this, if you want your sound system to "
+ "receive four channel surround sound from xine. "
+ "This means three front channels (left, center and "
+ "right) and two rear channels (left and right).\n"
+ "You need to connect the necessary speakers to "
+ "take advantage of this."),
0, NULL,
NULL) ) {
this->capabilities |= AO_CAP_MODE_5CHANNEL;
@@ -1494,8 +1479,13 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
config->register_bool (config,
"audio.five_lfe_channel",
0,
- _("used to inform xine about what the sound card can do"),
- NULL,
+ _("sound system can handle 5.1 audio"),
+ _("Enable this, if you want your sound system to "
+ "receive five channel plus LFE surround sound from "
+ "xine. This means three front channels (left, center "
+ "and right), two rear channels (left and right) and "
+ "a subwoofer (LFE) channel.\nYou need to connect "
+ "the necessary speakers to take advantage of this."),
0, NULL,
NULL) ) {
this->capabilities |= AO_CAP_MODE_5_1CHANNEL;
@@ -1510,17 +1500,11 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
snd_pcm_close (this->audio_fd);
this->audio_fd=NULL;
-/* Fallback to "default" if device "front" does not exist */
-/* Needed for some very basic sound cards. */
- pcm_device = config->register_string(config,
- "audio.alsa_front_device",
- "front",
- _("device used for stereo output"),
- NULL,
- 10, NULL,
- NULL);
+ /* Fallback to "default" if device "front" does not exist */
+ /* Needed for some very basic sound cards. */
+ pcm_device = config->lookup_entry(config, "audio.alsa_front_device")->str_value;
err=snd_pcm_open(&this->audio_fd, pcm_device, SND_PCM_STREAM_PLAYBACK, 1); /* NON-BLOCK mode */
- if(err <0 ) {
+ if(err < 0) {
config->update_string(config, "audio.alsa_front_device", "default");
} else {
snd_pcm_close (this->audio_fd);
@@ -1531,8 +1515,12 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
if (config->register_bool (config,
"audio.a52_pass_through",
0,
- _("used to inform xine about what the sound card can do"),
- NULL,
+ _("sound system can handle undecoded digital sound"),
+ _("Enable this, if you want your sound system to "
+ "receive undecoded digital sound from xine.\n"
+ "You need to connect a digital surround decoder "
+ "capable of decoding the formats you want to play "
+ "to your sound card's digital output. "),
0, alsa_passthru_cb,
this) ) {
this->capabilities |= AO_CAP_MODE_A52;
@@ -1548,7 +1536,9 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
"audio.alsa_mixer_name",
"PCM",
_("alsa mixer device"),
- NULL,
+ _("xine will use this alsa mixer device to change "
+ "the volume.\nSee the alsa documentation for "
+ "information on alsa devices."),
10, NULL,
NULL);
diff --git a/src/audio_out/audio_directx_out.c b/src/audio_out/audio_directx_out.c
index 73b7fb7c4..688f1628b 100755
--- a/src/audio_out/audio_directx_out.c
+++ b/src/audio_out/audio_directx_out.c
@@ -20,7 +20,7 @@
* audio_directx_out.c, direct sound audio output plugin for xine
* by Matthew Grooms <elon@altavista.com>
*
- * $Id: audio_directx_out.c,v 1.10 2004/01/05 00:51:44 valtri Exp $
+ * $Id: audio_directx_out.c,v 1.11 2004/04/10 14:53:43 mroi Exp $
*/
/*
@@ -58,7 +58,7 @@ typedef unsigned char boolean;
/*****************************************************************************
* DirectDraw GUIDs.
- * Defining them here allows us to get rid of the dxguid library during
+ * Defining them here allows us to get rid of the dxguid library during
* the linking stage.
*****************************************************************************/
#if 1
@@ -109,7 +109,6 @@ typedef struct {
typedef struct {
audio_driver_class_t driver_class;
config_values_t *config;
- char *device_name;
xine_t *xine;
} audiox_class_t;
@@ -840,15 +839,9 @@ static void dispose_class (audio_driver_class_t *this_gen) {
static void *init_class (xine_t *xine, void *data) {
audiox_class_t *audiox;
- char* device_name;
lprintf("init_class() Enter\n");
- device_name = xine->config->register_string(xine->config,
- "audio.directx_device", "/dev/audio_directx",
- _("xine audio output plugin for win32 using directx"),
- NULL, 10, NULL, NULL);
-
/*
* from this point on, nothing should go wrong anymore
*/
@@ -861,7 +854,6 @@ static void *init_class (xine_t *xine, void *data) {
audiox->xine = xine;
audiox->config = xine->config;
- audiox->device_name = device_name;
lprintf("init_class() Exit! Returning audiox=%08x\n", audiox);
diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c
index 1eab49728..42c1fd3e0 100644
--- a/src/audio_out/audio_esd_out.c
+++ b/src/audio_out/audio_esd_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_esd_out.c,v 1.29 2003/12/14 22:13:22 siggi Exp $
+ * $Id: audio_esd_out.c,v 1.30 2004/04/10 14:53:43 mroi Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -534,7 +534,12 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
this->latency = config->register_range (config, "audio.esd_latency", 0,
-30000, 90000,
_("esd audio output latency (adjust a/v sync)"),
- NULL, 0, NULL, NULL);
+ _("If you experience audio being not in sync "
+ "with the video, you can enter a fixed offset "
+ "here to compensate.\nThe unit of the value "
+ "is one PTS tick, which is the 90000th part "
+ "of a second."),
+ 10, NULL, NULL);
this->ao_driver.get_capabilities = ao_esd_get_capabilities;
this->ao_driver.get_property = ao_esd_get_property;
diff --git a/src/audio_out/audio_irixal_out.c b/src/audio_out/audio_irixal_out.c
index 86db2f8db..be0c2c577 100644
--- a/src/audio_out/audio_irixal_out.c
+++ b/src/audio_out/audio_irixal_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_irixal_out.c,v 1.10 2003/12/09 00:02:29 f1rmb Exp $
+ * $Id: audio_irixal_out.c,v 1.11 2004/04/10 14:53:43 mroi Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -382,8 +382,12 @@ static void *init_audio_out_plugin (config_values_t *config)
/* TODO: anything can change during runtime... move check to the right location */
this->gap_tolerance = config->register_range (config, "audio.irixal_gap_tolerance",
DEFAULT_GAP_TOLERANCE, 0, 90000,
- _("irixal audio output maximum gap length in 1/90000s"),
- NULL, NULL, NULL);
+ _("irixal audio output maximum gap length"),
+ _("You can specify the maximum offset between audio "
+ "and video xine will tolerate before trying to "
+ "resync them.\nThe unit of this value is one PTS tick, "
+ "which is the 90000th part of a second."),
+ 30, NULL, NULL);
this->ao_driver.get_capabilities = ao_irixal_get_capabilities;
this->ao_driver.get_property = ao_irixal_get_property;
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index e91b68390..3b6bddcbd 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_oss_out.c,v 1.102 2004/03/18 09:07:00 pmhahn Exp $
+ * $Id: audio_oss_out.c,v 1.103 2004/04/10 14:53:43 mroi Exp $
*
* 20-8-2001 First implementation of Audio sync and Audio driver separation.
* Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk
@@ -500,6 +500,7 @@ static void ao_oss_exit(ao_driver_t *this_gen) {
if (this->audio_fd != -1)
close(this->audio_fd);
+ free (this->mixer.name);
free (this);
}
@@ -737,18 +738,19 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
devname_val = config->register_enum (config, "audio.oss_device_name", 0,
devname_opts,
_("OSS audio device name"),
- _("Specify base part of the audio device name "
- "then use oss_device_number to set the device number. "
- "Select auto if you want to probe for the device."),
+ _("Specifies the base part of the audio device name, "
+ "to which the OSS device number is appended to get the "
+ "full device name.\nSelect \"auto\" if you want xine to "
+ "auto detect the corret setting."),
10, NULL, NULL);
/* devname_num is the N in '/dev[/sound]/dsp[N]'. Set to -1 for nothing */
devname_num = config->register_num(config, "audio.oss_device_number", -1,
- _("OSS number N to append to audio device name /dev/dsp[N], -1 for none"),
- _("The audio device name is created by concatenating the "
- "oss_device_name and the audio device number (eg /dev/sound/dsp2). "
- "If you do not need a "
- "number, set to -1 (eg /dev/sound/dsp). "
- "The range of this variable is -1 or 0-15."),
+ _("OSS audio device number, -1 for none"),
+ _("The full audio device name is created by concatenating the "
+ "OSS device name and the audio device number.\n"
+ "If you do not need a number because you are happy with "
+ "your system's default audio device, set this to -1.\n"
+ "The range of this value is -1 or 0-15."),
10, NULL, NULL);
if (devname_val == 0) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
@@ -756,8 +758,8 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
if ( ! probe_audio_devices(this)) { /* Returns zero on fail */
xprintf(class->xine, XINE_VERBOSITY_LOG,
_("audio_oss_out: Auto probe for audio device failed\n"));
- free (this);
- return NULL;
+ free (this);
+ return NULL;
}
}
else {
@@ -798,8 +800,33 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
this->sync_method = config->register_enum (config, "audio.oss_sync_method", OSS_SYNC_AUTO_DETECT,
sync_methods,
- _("A/V sync method to use by OSS, depends on driver/hardware"),
- NULL, 20, NULL, NULL);
+ _("a/v sync method to use by OSS"),
+ _("xine can use different methods to keep audio and video "
+ "synchronized. Which setting works best depends on the "
+ "OSS driver and sound hardware you are using. Try the "
+ "various methods, if you experience sync problems.\n\n"
+ "The meaning of the values is as follows:\n\n"
+ "auto\n"
+ "xine attempts to automatically detect the optimal setting\n\n"
+ "getodelay\n"
+ "uses the SNDCTL_DSP_GETODELAY ioctl to achieve true a/v "
+ "sync even if the driver claims not to support realtime "
+ "playback\n\n"
+ "getoptr\n"
+ "uses the SNDCTL_DSP_GETOPTR ioctl to achieve true a/v "
+ "sync even if the driver supports the preferred "
+ "SNDCTL_DSP_GETODELAY ioctl\n\n"
+ "softsync\n"
+ "uses software synchronization with the system clock; audio "
+ "and video can get severly out of sync if the system clock "
+ "speed does not precisely match your sound card's playback "
+ "speed\n\n"
+ "probebuffer\n"
+ "probes the sound card buffer size on initialization to "
+ "calculate the latency for a/v sync; thy this if your "
+ "system does not support any of the realtime ioctls and "
+ "you experience sync errors after long playback"),
+ 20, NULL, NULL);
if (this->sync_method == OSS_SYNC_AUTO_DETECT) {
@@ -826,6 +853,16 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
"audio_oss_out: ...will use system real-time clock for soft-sync instead\n"
"audio_oss_out: ...there may be audio/video synchronization issues\n"));
gettimeofday(&this->start_time, NULL);
+
+ this->latency = config->register_range (config, "audio.oss_latency", 0,
+ -3000, 3000,
+ _("OSS audio output latency (adjust a/v sync)"),
+ _("If you experience audio being not in sync "
+ "with the video, you can enter a fixed offset "
+ "here to compensate.\nThe unit of the value "
+ "is one PTS tick, which is the 90000th part "
+ "of a second."),
+ 20, NULL, NULL);
}
if (this->sync_method == OSS_SYNC_PROBEBUFFER) {
@@ -864,12 +901,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
}
}
- this->latency = config->register_range (config, "audio.oss_latency", 0,
- -3000, 3000,
- _("Adjust a/v sync for OSS softsync"),
- _("Use this to manually adjust a/v sync if you're using softsync"),
- 10, NULL, NULL);
-
this->capabilities = 0;
arg = AFMT_U8;
@@ -902,8 +933,14 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==4) ) {
if (config->register_bool (config, "audio.four_channel", 0,
- _("Enable 4.0 channel analog surround output"),
- NULL, 0, NULL, NULL)) {
+ _("sound system can handle 4.0 audio"),
+ _("Enable this, if you want your sound system to "
+ "receive four channel surround sound from xine. "
+ "This means two front channels (left and right) "
+ "and two rear channels (left and right).\n"
+ "You need to connect the necessary speakers to "
+ "take advantage of this."),
+ 0, NULL, NULL)) {
this->capabilities |= AO_CAP_MODE_4CHANNEL;
xprintf(class->xine, XINE_VERBOSITY_DEBUG, "4-channel ");
}
@@ -914,8 +951,14 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==5) ) {
if (config->register_bool (config, "audio.five_channel", 0,
- _("Enable 5.0 channel analog surround output"),
- NULL, 0, NULL, NULL)) {
+ _("sound system can handle 5.0 audio"),
+ _("Enable this, if you want your sound system to "
+ "receive four channel surround sound from xine. "
+ "This means three front channels (left, center and "
+ "right) and two rear channels (left and right).\n"
+ "You need to connect the necessary speakers to "
+ "take advantage of this."),
+ 0, NULL, NULL)) {
this->capabilities |= AO_CAP_MODE_5CHANNEL;
xprintf(class->xine, XINE_VERBOSITY_DEBUG, "5-channel ");
}
@@ -926,8 +969,14 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==6) ) {
if (config->register_bool (config, "audio.five_lfe_channel", 0,
- _("Enable 5.1 channel analog surround output"),
- NULL, 0, NULL, NULL)) {
+ _("sound system can handle 5.1 audio"),
+ _("Enable this, if you want your sound system to "
+ "receive five channel plus LFE surround sound from "
+ "xine. This means three front channels (left, center "
+ "and right), two rear channels (left and right) and "
+ "a subwoofer (LFE) channel.\nYou need to connect "
+ "the necessary speakers to take advantage of this."),
+ 0, NULL, NULL)) {
this->capabilities |= AO_CAP_MODE_5_1CHANNEL;
xprintf(class->xine, XINE_VERBOSITY_DEBUG, "5.1-channel ");
}
@@ -937,31 +986,45 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
ioctl(audio_fd,SNDCTL_DSP_GETFMTS,&caps);
- if ((caps & AFMT_AC3) || config->register_bool (config, "audio.oss_pass_through_bug", 0,
- _("used to inform xine about what the sound card can do"),
- NULL, 20, NULL, NULL)) {
- if (config->register_bool (config, "audio.a52_pass_through", 0,
- _("used to inform xine about what the sound card can do"),
- NULL, 0, NULL, NULL)) {
- this->capabilities |= AO_CAP_MODE_A52;
- this->capabilities |= AO_CAP_MODE_AC5;
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "a/52-pass-through ");
- }
- else
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "(a/52-pass-through not enabled in xine config)");
- }
+ /* one would normally check for (caps & AFMT_AC3) before asking about passthrough,
+ * but some buggy OSS drivers do not report this properly, so we ask anyway */
+ if (config->register_bool (config, "audio.a52_pass_through", 0,
+ _("sound system can handle undecoded digital sound"),
+ _("Enable this, if you want your sound system to "
+ "receive undecoded digital sound from xine.\n"
+ "You need to connect a digital surround decoder "
+ "capable of decoding the formats you want to play "
+ "to your sound card's digital output. "),
+ 0, NULL, NULL)) {
+ this->capabilities |= AO_CAP_MODE_A52;
+ this->capabilities |= AO_CAP_MODE_AC5;
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "a/52-pass-through ");
+ }
+ else
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "(a/52-pass-through not enabled in xine config)");
/*
* mixer initialisation.
*/
-
- this->mixer.name = config->register_string(config, "audio.mixer_name", "/dev/mixer",
- _("OSS mixer device"), NULL,
- 10, NULL, NULL);
{
+ char mixer_name[32];
+ char *mixer_num;
int mixer_fd;
int audio_devs;
+ /* get the mixer device name from the audio device name by replacing "dsp" with "mixer" */
+ strcpy(mixer_name, this->audio_dev);
+ if ((mixer_num = strstr(mixer_name, "dsp"))) {
+ mixer_num[0] = '\0';
+ mixer_num += 3;
+ this->mixer.name = (char *)malloc(strlen(mixer_name) + sizeof("mixer") + strlen(mixer_num));
+ sprintf(this->mixer.name, "%smixer%s", mixer_name, mixer_num);
+ } else {
+ this->mixer.name = (char *)malloc(1);
+ this->mixer.name[0] = '\0';
+ }
+ _x_assert(this->mixer.name[0] != '\0');
+
mixer_fd = open(this->mixer.name, O_RDONLY);
if(mixer_fd != -1) {
diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c
index 000086614..f21e441e1 100644
--- a/src/audio_out/audio_sun_out.c
+++ b/src/audio_out/audio_sun_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_sun_out.c,v 1.35 2004/03/18 09:07:00 pmhahn Exp $
+ * $Id: audio_sun_out.c,v 1.36 2004/04/10 14:53:44 mroi Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -882,13 +882,18 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v
audiodev = getenv("AUDIODEV");
- /* Fill the .xinerc file with options */
+ /* This config entry is security critical, is it really necessary? */
devname = config->register_string(config,
"audio.sun_audio_device",
audiodev && *audiodev ? audiodev : "/dev/audio",
- _("device used for audio output with the 'Sun' audio plugin"),
- NULL,
- 10, NULL,
+ _("Sun audio device name"),
+ _("Specifies the file name for the Sun audio device
+ "to be used.\nThis setting is security critical, "
+ "because when changed to a different file, xine "
+ "can be used to fill this file with arbitrary content."
+ "So you should be careful that the value you enter "
+ "really is a proper Sun audio device."),
+ XINE_CONFIG_SECURITY, NULL,
NULL);
/*