[pulseaudio-tickets] [PulseAudio] #44: Esound-sink module respecting the ESPEAKER enviroment variable
PulseAudio
trac-noreply at tango.0pointer.de
Thu Nov 23 08:16:59 PST 2006
#44: Esound-sink module respecting the ESPEAKER enviroment variable
--------------------------------------+-------------------------------------
Reporter: michiel | Owner: lennart
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: module-esound-* | Severity: normal
Keywords: sink, enviroment, cookie |
--------------------------------------+-------------------------------------
I want to have module-esound-sink to respect the ESPEAKER enviroment
variable and use it. This is because, sometimes ESD is started with
autospawn and that uses the ESPEAKER enviroment variable to connect with
the ESD server. I also want it to use the cookie which is in the
homedirectory of the user.
I want to use this feature, because I need to use ESD for network
transparancy. I can't use PulseAudio for it. I only want PulseAudio to be
a "sound proxy" and redirects all trafic to ESD.
The ESPEAKER enviroment variable isset as the following
ESPEAKER="127.0.0.1:16001". The Esound cookie files are, in my case,
located in the home folder (/home/<user>/.esd_auth).
I've created some C code for it, to respect the ESPEAKER enviroment
variable, but I don't know if it's going to work (not tested yet).
{{{
/* Beginning from line 366 of the original src/modules/module-esound-
sink.c of the stable (0.9.5) version */
char* esdenviroment = getenv("ESPEAKER");
char* envserver;
char* envport;
int intenvport = 16001;
char* delimitpos = 0;
delimitpos = strchr(*esdenviroment, ':');
if (delimitpos != NULL)
{
strncpy(*envserver, *esdenviroment, delimitpos - esdenviroment +
1);
esdenviroment = delimitpos;
esdenviroment++;
strncpy(*envport, *esdenviroment, strlen(esdenviroment));
intenvport = atoi(envport);
}
if (!(u->client = pa_socket_client_new_string(u->core->mainloop, p =
pa_modargs_get_value(ma, "server", ESD_UNIX_SOCKET_NAME),
ESD_DEFAULT_PORT))) {
pa_log("failed to connect to server. Trying to use the ESPEAKER
enviroment variable.");
if (!(u->client = pa_socket_client_new_string(u->core->mainloop, p
= envserver, intenvport))) {
pa_log("faild to connect to server.");
goto fail;
}
}
}}}
--
Ticket URL: <http://pulseaudio.org/ticket/44>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server
More information about the pulseaudio-bugs
mailing list