Bug 2633 - ltsp-sound.sh is bugged
Summary: ltsp-sound.sh is bugged
Status: ASSIGNED
Alias: None
Product: LTSP
Classification: Unclassified
Component: LTSP Core (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Jim McQuillan
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-01 08:28 UTC by Aki Tossavainen
Modified: 2013-03-15 14:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Aki Tossavainen 2005-03-01 08:28:45 UTC
It appears that ltsp-sound.sh is not well thought, as it bugs in certain
conditions. Patch attached fixes these bugs.

Problems fixed:
- If no domain is set, the address loses it's first dot, which causes it to not
work anymore
- If the IP address used when connecting with nc is not set, warning is given.
Functionality changed to check return value of nc instead, which is non-zero if
no one is listening.

--- old/ltsp-sound.sh   2005-03-01 18:17:33.000000000 +0200
+++ new/ltsp-sound.sh   2005-03-01 18:17:27.000000000 +0200
@@ -33,8 +33,11 @@
 ################################################################################

 DOMAIN=`dnsdomainname`
-MYNAME=`echo $DISPLAY | cut -d: -f1 | sed s/\\\.${DOMAIN}//`
-
+if [ "${DOMAIN}" = "" ]; then
+ MYNAME=`echo $DISPLAY | cut -d: -f1`
+else
+ MYNAME=`echo $DISPLAY | cut -d: -f1 | sed s/\\\.${DOMAIN}//`
+fi
 if [ -n "${MYNAME}" -a "${MYNAME}" != "localhost" ]; then
   #
   # Usage:  get_cfg PARM [DEFAULT]
@@ -66,9 +69,8 @@
              # terminal is listening
              #
              if [ "$REMOTESOUNDIP" -a -x "`which nc 2> /dev/null`" ]; then
-               NC=`/usr/bin/nc -v -w 1 -z $REMOTESOUNDIP $REMOTESOUNDPORT 2>&1 \
-                   | grep -v open$`
-               if [ "${NC}" ]; then
+               NC=`/usr/bin/nc -w 1 -z $REMOTESOUNDIP $REMOTESOUNDPORT
>/dev/null 2>&1 `
+               if [ $? -ne 0 ]; then
                  #
                  # netcat says the terminal is not listening, bail!
                  #
@@ -83,11 +85,9 @@
              # don't use this hack for local X sessions, root, and only if
              # the pre-load libraries are found
              #
-             if [      "${REMOTESOUNDIP}" \
-                 -a -x "$LIBESDPATH"      \
-                 -a -x "$LIBESDDSPPATH" ]
+             if [ "${REMOTESOUNDIP}" -a -x "$LIBESDPATH" -a -x "$LIBESDDSPPATH" ]
              then
-               export ESPEAKER=${REMOTESOUNDIP}:16001
+               export ESPEAKER=${REMOTESOUNDIP}:${REMOTESOUNDPORT}
                export ESDDSP_MIXER=1
                export LD_PRELOAD="$LIBESDPATH $LIBESDDSPPATH"
                /usr/bin/esdctl unlock
Comment 1 andrewz 2005-11-04 08:56:28 UTC
The nc fix posted here also should fix another bug.  On my system, nc does not
return "open" as ltsp-sound.sh expects, so ltsp-sound.sh always thinks the
terminal is not listening.

$ rpm -q nc
nc-1.82-fc4.1
$ /usr/bin/nc -v -w 1 -z ws0017 16002
nc: connect to ws0017 port 16002 (tcp) failed: Connection refused
$ /usr/bin/nc -v -w 1 -z ws0017 16001
Connection to ws0017 16001 port [tcp/*] succeeded!
Comment 2 chemtech 2013-03-15 14:09:02 UTC
Aki Tossavainen 
Do you still experience this issue with newer drivers ?
Please check the status of your issue.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.