[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] No sound at all with nasd



On Wed, 2003-10-01 at 06:13, David Trask wrote:
> Hi,
> 
> I tried the SOUND_DAEMON = nasd in lts.conf and all I got was no sound at
> all.  I was wondering if it has anything to do with the file in called
> ltsp-esound.sh in /etc/profile.d?  I remember when I was earlier having
> problems with Flash not running Eric told me to comment out some stuff (I
> think) in that file.  Could this be part of the problem....can someone
> post a clean copy of that file?  Any other ideas?  Switching back
> (commenting out the SOUND_DAEMON = nasd line brings my sound back.  I even
> tried rebooting the server....that made no difference for the nasd stuff. 
> I'd love to get sound working for nearly everything including Flash.  Let
> me know of any ideas.  (yes...I've upgraded to 3.12 with the new rpm's
> Eric posted a few days ago)

The current /etc/profile.d/ltsp-esound.sh is attached.

-Eric
#!/bin/sh


# LTSP sound v0.3 for LTSP => v3.0.0
# This package is released under the auspices of the GPL
# Copyright (c) 2002 by Andrew Williams (Vartech Solutions)
# Enhancements by Eric Harrison <eharrison mesd k12 or us>
# This package is release under the auspices of the GPL
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# VARTECH SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

DOMAIN=`dnsdomainname`
MYNAME=`echo $DISPLAY | cut -d: -f1 | sed s/\\\.${DOMAIN}//`


if [ -f /etc/sysconfig/k12ltsp ]
then
   . /etc/sysconfig/k12ltsp
fi

#
# Don't bother setting up remote sound for root, and also
# don't bother if the user is NOT running X Windows.
#
if [ "${UID}" -ne 0 -a -n "${MYNAME}" ]; then

    #
    # Suck in some info about LTSP
    #
    . /etc/ltsp.conf

    function get_cfg(){
        #
        # Usage:  get_cfg PARM [DEFAULT]
        #
        VALUE=`${LTSP_DIR}/i386/bin/getltscfg  \
                  -c ${LTSP_DIR}/i386/etc/lts.conf $1`
#                  -n ${MYNAME}                 \

        if [ "$#" -gt 1 -a -z "${VALUE}" ]; then
            echo $2
        else
            echo ${VALUE}
        fi

        unset VALUE
    }

    function export_libs() {
    if [ "$PRELOAD_LIBS" ]
    then
        for lib in $PRELOAD_LIBS
        do
            if [ -x "$lib" ]
            then
                if [ "$LD_PRELOAD" ]
                then
                       if [ "`echo $LD_PRELOAD | grep -v $lib`" ]
                       then
                           LD_PRELOAD=$LD_PRELOAD:$lib
                       fi
                else
                       LD_PRELOAD=$lib
                fi
            else
                echo "WARNING: library not found: $lib"
            fi
        done
        export LD_PRELOAD
    fi
    }


    SOUND_DAEMON=`get_cfg SOUND_DAEMON esd`
    case "${SOUND_DAEMON}" in

        esd) if [ "${MYNAME}"  ]
             then
                 if [ "$REMOTE_SOUND_HACKS" = "YES" ]
                 then
                      PRELOAD_LIBS="/usr/lib/libesd.so.0 /usr/lib/libesddsp.so.0"
                      export_libs
                 fi
                 export ESPEAKER=${MYNAME}:${REMOTESOUNDPORT}
                 export ESDDSP_MIXER=1
                 /usr/bin/esdctl unlock
             fi
             ;;

        nasd)
            #
            # Lets do a better job of environment checking here so we dont goof up
            # sound for the user when logged into the server machine or when you
            # login as root.
            #
            if [ "${MYNAME}"  ]
            then
                 PRELOAD_LIBS="/lib/libaudiooss.so.1.0"
                 export_libs
                 export AUDIOSERVER="$DISPLAY"
            fi
            #
            # Uncomment the following to enable this to work with "wine"
            # This also works well with the Linux ICA client.

            # export AUDIOOSS_WINE_HACK="y"
            ;;

       rplay)
            if [ "${MYNAME}"  ]
            then
                PRELOAD_LIBS="/usr/local/lib/devrplay.so"
                export_libs
            fi
            ;;

       artsd)
            if [ "${MYNAME}"  ]
            then
                #
                # This is real nice for apps that require mmap IE: Quake :)
                #
                export ARTSDSP_MMAP=1

                #
                # Set this option if you want verbose reporting from artsd.
                #

                # export ARTSDSP_VERBOSE=1

                #
                # setup artsdsp preload to hijack calls made to /dev/dsp
                #
                prefix=/usr
                exec_prefix=${prefix}
                libdir=${exec_prefix}/lib

                PRELOAD_LIBS="${libdir}/libartsdsp.so.0 ${libdir}/libartsc.so.0 /lib/libdl.so.2"
                export_libs
            fi
            ;;

       *)
            #
            # No more options available get on with Life
            #
            ;;
    esac
fi

# clean up temporary variables
unset DOMAIN
unset MYNAME
unset get_cfg
unset REMOTESOUNDPORT

Attachment: signature.asc
Description: This is a digitally signed message part


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]