Hi,

I've been trying to figure out how to use sound using KDE and ltsp. As there 
are probably some who could use this information, I wrote this short HOWTO.

I figured out two ways to get the sound from KDE working:
The first way (and by far the simplest) is using the esd and reroute the 
artsd-output to the remote esd:

Here's what I did:
I configured my thin-client to use esd as sound-daemon:
This is what I included in /opt/ltsp/i386/etc/lts.conf:

       SOUND              = Y
        SOUND_DAEMON       = esd
        SMODULE_01         = soundcore
        SMODULE_02         = uart401
        SMODULE_03         = sb

(You may need different SMODULEs, see the documentation for the sound-package 
for ltsp).

Then I modified /etc/X11/xdm/xsession to include the following lines right 
before the final execution of the local .xsession-files:

shopt -s extglob
if [ ${DISPLAY%%:*([0-9]|.)} == "" ]; then   #local Session (DISPLAY=0.0)
  echo /opt/kde3/bin/artswrapper&               # start artsd using artswrapper
else
  /usr/bin/esddsp --server=${DISPLAY%%:*([0-9]|.)}:16001 --mixer  
/opt/kde3/bin/artsplay &
fi

Important to note is that it's only one line starting with /usr/bin/esddsp and 
ending with artsplay &.

This code executes artswrapper (and thus starts artsd) when it detects that it 
is running a local X-Server on the console. When it detects a remote 
connection it reroutes kde-sound-output to the remote-server using esddsp. 
The important thing seems to be to have the LD_PRELOAD-settings (s. esddsp) 
correctly set. I use artsplay here as rerouted program. Probably you can use 
any other program (even /bin/echo?).

As a final step I disabled the start of artsd by kde using the control-center, 
submenu sound & multimedia, submenu sound-system.

That was it.

The other way was using artsd directly on the remote client. Artsd seems not 
to be as remote-friendly as esd is. So there were several steps involved 
getting it running.

First was to observe that there was no artsd included in the 
ltsp-sound-package. So I had to use my own (as I didn't want to compile a new 
one) which unfortunately didn't work with the libraries provided by ltsp. So 
I did the following: I created a new directory /opt/ltsp/i386/opt/artsdlibs 
and copied the following files and libs into it:

-rwxr-xr-x    1 root     root        43811 2004-02-18 21:03 esd*
-rwxr-xr-x    1 root     root        97518 2004-02-13 14:05 ld-linux.so.2*
-rwxr-xr-x    1 root     root       702179 2004-02-13 14:05 libasound.so.2*
-rwxr-xr-x    1 root     root       170967 2004-02-13 14:05 libaudiofile.so.0*
-rwxr-xr-x    1 root     root      1491599 2004-02-13 14:05 libc.so.6*
-rwxr-xr-x    1 root     root        12392 2004-02-13 14:05 libdl.so.2*
-rwxr-xr-x    1 root     root        39016 2004-02-13 14:05 libgcc_s.so.1*
-rwxr-xr-x    1 root     root       184056 2004-02-13 14:05 libm.so.6*
-rwxr-xr-x    1 root     root        50169 2004-02-13 14:05 
libnss_compat.so.2*
-rwxr-xr-x    1 root     root        17395 2004-02-13 14:05 libnss_dns.so.2*
-rwxr-xr-x    1 root     root        42881 2004-02-13 14:05 libnss_files.so.2*
-rwxr-xr-x    1 root     root        19213 2004-02-13 14:05 
libnss_hesiod.so.2*
-rwxr-xr-x    1 root     root        62980 2004-02-13 14:05 libnss_ldap.so.2*
-rwxr-xr-x    1 root     root        40825 2004-02-13 14:05 libnss_nis.so.2*
-rwxr-xr-x    1 root     root        48759 2004-02-13 14:05 
libnss_nisplus.so.2*
-rwxr-xr-x    1 root     root        15721 2004-02-13 14:05 libnss_winbind.so*
-rwxr-xr-x    1 root     root        15721 2004-02-13 14:05 
libnss_winbind.so.2*
-rwxr-xr-x    1 root     root        18332 2004-02-13 14:05 libogg.so.0*
-rwxr-xr-x    1 root     root        82840 2004-02-13 14:05 libpthread.so.0*
-rwxr-xr-x    1 root     root       418036 2004-02-13 14:05 
libsoundserver_idl.so.1*
-rwxr-xr-x    1 root     root       941384 2004-02-13 14:05 libstdc++.so.5*
-rwxr-xr-x    1 root     root       143411 2004-02-13 14:05 libvorbis.so.0*
-rwxr-xr-x    1 root     root      1055373 2004-02-13 14:05 libvorbisenc.so.2*
-rwxr-xr-x    1 root     root        26715 2004-02-13 14:05 
libvorbisfile.so.3*

(you can figure out which libraries your artsd needs by calling 
ldd /opt/kde3/bin/artsd.
The libnss*-libs were needed for artsd to be able to figure out the right 
usernams for its /tmp/mcop-root-directory.)

For all this to work I had to use the libs from my stock SuSE 8.2-system, not 
the ltsp-provided ones. Note that I included also the dynamic linker 
ld-linux.so.2 as my artsd needed it also in the provided version to run. If 
you own a Linux-System where artsd runs with the libraries provided by ltsp 
(i.e. Red Hat 7.0?) you can skip this step.

artsd seems to need the sound-files of kde on the system it runs (otherwise it 
complains about missing .wav-files) so I NFS-mounted my whole kde-tree to my 
thin-client:

/etc/exports:
/opt/kde3                 192.168.0.0/255.255.255.0(ro,no_root_squash,sync)

and then I mounted it using the command:
mount -t nfs -o nolock 192.168.0.10:/opt/kde3        /opt/kde3
which can be put in the rc.local-script.

Then starting artsd worked using:


export HOME=/tmp  #for tradercache
/opt/artsdlibs/ld-linux.so.2 --library-path /opt/artsdlibs /opt/kde3/bin/artsd  
-n -p 16002 -N -u -a oss

(this call uses the dynamic-linker in /opt/artsdlibs and all the libraries in 
there!)

When I tried to execute these two commands from within rc.sound in the section 
called artsd) I discovered the following problems: From reasons I didn't 
figure out until now my kdm refused to let me login as soon I had 
SOUND_DAEMON = artsd in etc/lts.conf. So I renamed this section to myartsd, 
set SOUND_DAEMON=myartsd and started artsd the way I wrote above. But then I 
noted that artsd didn't survive the runlevel-change after finishing the 
rc.sound-script and also dies when all connected clients log off. So I 
decided to start artsd using init and modified /opt/ltsp/i386/etc/inittab to 
include the following line: 

s:35:respawn:/etc/rcartsd

and I created /opt/ltsp/i386/etc/rcartsd to include the following:

#!/bin/bash
#
# start artsd and esd
#

export HOME=/tmp  #for tradercache

echo "starting artsd"
/opt/artsdlibs/ld-linux.so.2 --library-path /opt/artsdlibs /opt/kde3/bin/artsd  
-n -p 16002 -N -u -a oss

echo "starting esd"
# aus /opt/kde3/bin/artsdsp

export 
LD_PRELOAD=/opt/kde3/lib/libartsdsp.so.0:/opt/kde3/lib/libartsc.so.0:/opt/artsdlibs/libdl.so.2
/opt/artsdlibs/ld-linux.so.2 --library-path /opt/artsdlibs /opt/artsdlibs/esd 
-public -nobeeps -tcp -port 16001 &

echo "done rcartsd"
######################## end rcartsd #######################

Additionally I increased the RAMDISK_SIZE to 4096 in lts.conf to provide 
enough space for the trader_cache of artsd.

As you can see I also included a call to esd to be run in a wrapper using 
artsdsp (actually I copied only the relevant lines out of artsdsp). This 
provided a way for applications to connect to the remote esd and output their 
sound using artsd. It seemed to work with esdplay but not for frozen-bubbles.

Hope this helps someone to have their remote clients output some sound.

Yours
  Andreas Bergen
-- 
Andreas Bergen
E-Mail: andreas dot bergen at in-jesus dot de 
PGP/GnuPG-encrypted / -signed Email welcome. PGP-key-ID: 8CDEC18F
Gott ist Liebe, und wer in der Liebe bleibt, bleibt in Gott und Gott in ihm.


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to