From cyril.brulebois@enst-bretagne.fr Thu Nov 23 21:56:03 2006 Received: (at submit) by bugs.debian.org; 24 Nov 2006 05:56:03 +0000 Return-path: Received: from coliposte.enst-bretagne.fr ([192.108.115.12]) by spohr.debian.org with esmtp (Exim 4.50) id 1GnU2c-0006Nq-RB for submit@bugs.debian.org; Thu, 23 Nov 2006 21:56:03 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by coliposte.enst-bretagne.fr (8.13.7/8.13.7/2006.08.11) with ESMTP id kAO5tSh0010624; Fri, 24 Nov 2006 06:55:28 +0100 Received: from maisel-gw.enst-bretagne.fr (maisel-gw.enst-bretagne.fr [192.44.76.8]) by coliposte.enst-bretagne.fr (8.13.7/8.13.7/2006.08.14) with ESMTP id kAO5tNxs010601; Fri, 24 Nov 2006 06:55:24 +0100 Received: from localhost (localhost.maisel.enst-bretagne.fr [127.0.0.1]) by maisel-gw.enst-bretagne.fr (Postfix) with ESMTP id D1E1149054; Fri, 24 Nov 2006 06:55:22 +0100 (CET) Received: from duckcorp.org (evy.maisel.enst-bretagne.fr [172.16.24.79]) by maisel-gw.enst-bretagne.fr (Postfix) with ESMTP id 13D6A4902B; Fri, 24 Nov 2006 06:55:14 +0100 (CET) Received: by duckcorp.org (Postfix, from userid 1000) id 6EE7BC8C6D; Fri, 24 Nov 2006 06:54:25 +0100 (CET) Content-Type: multipart/mixed; boundary="===============1829543400==" MIME-Version: 1.0 From: Cyril Brulebois To: Debian Bug Tracking System Subject: xine-lib: Please add support for remote esound server Tag: patch Message-ID: <20061124055423.2051.61473.reportbug@localhost.localdomain> X-Mailer: reportbug 3.31 Date: Fri, 24 Nov 2006 06:54:23 +0100 X-Virus-Scanned: amavisd-new at enst-bretagne.fr Delivered-To: submit@bugs.debian.org X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 (1.212-2003-09-23-exp) on spohr.debian.org X-Spam-Level: X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE autolearn=no version=2.60-bugs.debian.org_2005_01_02 This is a multi-part MIME message sent by reportbug. --===============1829543400== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Package: xine-lib Severity: wishlist Hi, please find attached a patch which adds support for remote esound server. Until now, only `localhost' is used, since the `NULL' parameter is specified when calling esd_* functions. With this patch, one can specify a `audio.device.esd_server' parameter, which will be used to determine the esound server to use. By default, when one has selected the `esd' output with the following line in the configuration file, localhost is used automatically, as before, so that the default behaviour isn't changed. audio.driver:esd The new configuration item can be used as follows, either by specifying `localhost' (or leaving it blank, which has the same effect), or by specifying a remote server. audio.device.esd_server:my_remote_server I didn't get really how configuration item types are determined, so instead of querying the `str_value' of the configuration item, I query `unknown_value'. But I guess that upstream will know how to handle this tiny imperfection. Of course, I checked all the above-mentioned behaviours. Cheers, -- Cyril Brulebois PS: Looks like a call to a xine_config_register_string() should do the job, but that would be in xine-ui, I guess. However, documenting this new feature could be sufficient at the moment, e.g. in a README.Debian file. --===============1829543400== Content-Type: text/x-c; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xine-remote-esound-support.diff" diff -r e4154180d171 src/audio_out/audio_esd_out.c --- a/src/audio_out/audio_esd_out.c Thu Apr 19 16:58:54 2007 +0100 +++ b/src/audio_out/audio_esd_out.c Thu Apr 19 21:06:34 2007 +0100 @@ -92,6 +92,8 @@ typedef struct esd_driver_s { int reblock_rem; #endif + char *server_name; /* ESD server, NULL for localhost */ + } esd_driver_t; typedef struct { @@ -160,7 +162,7 @@ static int ao_esd_open(ao_driver_t *this #endif this->output_sample_k_rate = this->output_sample_rate / 1000; - this->audio_fd = esd_play_stream(format, this->output_sample_rate, NULL, this->pname); + this->audio_fd = esd_play_stream(format, this->output_sample_rate, this->server_name, this->pname); if (this->audio_fd < 0) { char *server = getenv("ESPEAKER"); xprintf(this->xine, XINE_VERBOSITY_LOG, @@ -343,6 +345,7 @@ static void ao_esd_exit(ao_driver_t *thi if (this->audio_fd != -1) esd_close(this->audio_fd); + free(this->server_name); free(this->pname); free (this); @@ -357,7 +360,7 @@ static int ao_esd_get_property (ao_drive switch(property) { case AO_PROP_MIXER_VOL: - if((mixer_fd = esd_open_sound(NULL)) >= 0) { + if((mixer_fd = esd_open_sound(this->server_name)) >= 0) { if((esd_i = esd_get_all_info(mixer_fd)) != NULL) { for(esd_pi = esd_i->player_list; esd_pi != NULL; esd_pi = esd_pi->next) { if(!strcmp(this->pname, esd_pi->name)) { @@ -398,7 +401,7 @@ static int ao_esd_set_property (ao_drive /* need this to get source_id */ (void) ao_esd_get_property(&this->ao_driver, AO_PROP_MIXER_VOL); - if((mixer_fd = esd_open_sound(NULL)) >= 0) { + if((mixer_fd = esd_open_sound(this->server_name)) >= 0) { int v = (value * 256) / 100; esd_set_stream_pan(mixer_fd, this->mixer.source_id, v, v); @@ -422,7 +425,7 @@ static int ao_esd_set_property (ao_drive (void) ao_esd_get_property(&this->ao_driver, AO_PROP_MIXER_VOL); if(mute) { - if((mixer_fd = esd_open_sound(NULL)) >= 0) { + if((mixer_fd = esd_open_sound(this->server_name)) >= 0) { int v = 0; esd_set_stream_pan(mixer_fd, this->mixer.source_id, v, v); @@ -430,7 +433,7 @@ static int ao_esd_set_property (ao_drive } } else { - if((mixer_fd = esd_open_sound(NULL)) >= 0) { + if((mixer_fd = esd_open_sound(this->server_name)) >= 0) { int v = (this->mixer.volume * 256) / 100; esd_set_stream_pan(mixer_fd, this->mixer.source_id, v, v); @@ -478,6 +481,8 @@ static ao_driver_t *open_plugin (audio_d esd_server_info_t *esd_svinfo; int server_sample_rate; sigset_t vo_mask, vo_mask_orig; + char *esd_server_name; + cfg_entry_t *config_entry; /* * open stream to ESD server @@ -491,13 +496,21 @@ static ao_driver_t *open_plugin (audio_d * (Otherwise xine hangs in esd_open_sound on a machine without sound) */ + /* We need it to test the esd server, before storing it inside this->server_name */ + + config_entry = config->lookup_entry(config, "audio.device.esd_server"); + if (config_entry) + esd_server_name = strdup(config_entry->unknown_value); // str_value! + else + esd_server_name = NULL; + sigemptyset(&vo_mask); sigaddset(&vo_mask, SIGALRM); if (sigprocmask(SIG_UNBLOCK, &vo_mask, &vo_mask_orig)) xprintf(class->xine, XINE_VERBOSITY_DEBUG, "audio_esd_out: cannot unblock SIGALRM: %s\n", strerror(errno)); xprintf(class->xine, XINE_VERBOSITY_LOG, _("audio_esd_out: connecting to esd server...\n")); - audio_fd = esd_open_sound(NULL); + audio_fd = esd_open_sound(esd_server_name); err = errno; if (sigprocmask(SIG_SETMASK, &vo_mask_orig, NULL)) @@ -527,6 +540,7 @@ static ao_driver_t *open_plugin (audio_d if (!this) return NULL; this->xine = class->xine; + this->server_name = esd_server_name; this->pname = strdup("xine esd audio output plugin"); if (!this->pname) { free (this);