From 43b7b84182285652f4f160d38088d15d295a1a31 Mon Sep 17 00:00:00 2001 From: Laxmikant Rashinkar Date: Tue, 7 Jan 2014 19:50:20 -0800 Subject: [PATCH] missed some files for microphone redirection using rdesktop --- sesman/chansrv/pulse/Makefile | 23 +- sesman/chansrv/pulse/module-xrdp-sink.c | 2 +- sesman/chansrv/pulse/pulse-notes.ubuntu.txt | 94 ++- sesman/chansrv/sound.c | 701 ++++++++++++++++---- sesman/chansrv/sound.h | 42 +- 5 files changed, 698 insertions(+), 164 deletions(-) diff --git a/sesman/chansrv/pulse/Makefile b/sesman/chansrv/pulse/Makefile index 6efbfc16..da1a89a1 100644 --- a/sesman/chansrv/pulse/Makefile +++ b/sesman/chansrv/pulse/Makefile @@ -1,18 +1,17 @@ +# +# build xrdp pulseaudio modules +# +PULSE_DIR = /home/lk/pulseaudio-1.1 +CFLAGS = -Wall -O2 -I$(PULSE_DIR) -I$(PULSE_DIR)/src -DHAVE_CONFIG_H -fPIC -#PULSE_DIR=/home/jay/temp/pulseaudio-0.9.21 -#PULSE_DIR=/home/jay/pulseaudio-0.9.22 -#PULSE_DIR=/home/jay/pulseaudio-0.9.21 -PULSE_DIR=/home/jay/pulseaudio-2.0 +all: module-xrdp-sink.so module-xrdp-source.so -OBJS = module-xrdp-sink.o +module-xrdp-sink.so: module-xrdp-sink.o + $(CC) $(LDFLAGS) -shared -o module-xrdp-sink.so module-xrdp-sink.o -CFLAGS = -Wall -O2 -I$(PULSE_DIR) -I$(PULSE_DIR)/src -DHAVE_CONFIG_H -fPIC - -all: module-xrdp-sink.so - -module-xrdp-sink.so: $(OBJS) - $(CC) $(LDFLAGS) -shared -o module-xrdp-sink.so $(OBJS) +module-xrdp-source.so: module-xrdp-source.o + $(CC) $(LDFLAGS) -shared -o module-xrdp-source.so module-xrdp-source.o clean: - rm -f $(OBJS) module-xrdp-sink.so + rm -f module-xrdp-sink.o module-xrdp-sink.so module-xrdp-source.o module-xrdp-source.so diff --git a/sesman/chansrv/pulse/module-xrdp-sink.c b/sesman/chansrv/pulse/module-xrdp-sink.c index 3f09b727..eb7211a0 100644 --- a/sesman/chansrv/pulse/module-xrdp-sink.c +++ b/sesman/chansrv/pulse/module-xrdp-sink.c @@ -75,7 +75,7 @@ PA_MODULE_USAGE( #define DEFAULT_SINK_NAME "xrdp" #define BLOCK_USEC 30000 //#define BLOCK_USEC (PA_USEC_PER_SEC * 2) -#define CHANSRV_PORT_STR "/tmp/.xrdp/xrdp_chansrv_audio_socket_%d" +#define CHANSRV_PORT_STR "/tmp/.xrdp/xrdp_chansrv_audio_out_socket_%d" struct userdata { pa_core *core; diff --git a/sesman/chansrv/pulse/pulse-notes.ubuntu.txt b/sesman/chansrv/pulse/pulse-notes.ubuntu.txt index cb6ec90f..51fc5060 100644 --- a/sesman/chansrv/pulse/pulse-notes.ubuntu.txt +++ b/sesman/chansrv/pulse/pulse-notes.ubuntu.txt @@ -1,34 +1,80 @@ -this is /etc/apt/sources.list -I added the deb-src line +o append the following line to /etc/apt/sources.list ----------------------- -deb http://packages.linuxmint.com/ maya main upstream import -deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse -deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse -deb http://archive.canonical.com/ubuntu/ precise partner -deb http://packages.medibuntu.org/ precise free non-free + deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse -#deb http://archive.getdeb.net/ubuntu precise-getdeb apps -#deb http://archive.getdeb.net/ubuntu precise-getdeb games -deb http://drbl.sourceforge.net/drbl-core drbl stable ----------------------- + this is what my /etc/apt/sources.list looks like -do all this in a new directory + deb http://packages.linuxmint.com/ maya main upstream import + deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse + deb http://archive.canonical.com/ubuntu/ precise partner + deb http://packages.medibuntu.org/ precise free non-free -root -sudo apt-get install dpkg-dev + #deb http://archive.getdeb.net/ubuntu precise-getdeb apps + #deb http://archive.getdeb.net/ubuntu precise-getdeb games + deb http://drbl.sourceforge.net/drbl-core drbl stable + deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse + + NOTE: If you get an error message that goes something like this: -non root -apt-get source pulseaudio + E: You must put some 'source' URIs in your sources.list -root -sudo apt-get build-dep pulseaudio + try running the following command first: -cd pulseaudio-1.1 + apt-get source pulseaudio -non root -dpkg-buildpackage -rfakeroot -uc -b +o run these commands in your home directory + cd + sudo apt-get install dpkg-dev + apt-get source pulseaudio + sudo apt-get build-dep pulseaudio + + cd pulseaudio-1.1 + dpkg-buildpackage -rfakeroot -uc -b + +o edit Makefile and point PULSE_DIR to ~/pulseaudio dir + +o run make; the outputs will be + module-xrdp-sink.so + module-xrdp-source.so + +o sudo cp module-xrdp-sink.so /usr/lib/pulse-/modules + sudo cp module-xrdp-source.so /usr/lib/pulse-/modules + note: on a 64bit machine use lib64 instead of lib + +o cd /etc/pulse + +o sudo mv default.pa default.pa.orig + +o sudo vi default.pa and add the following lines to it + +.nofail +.fail +load-module module-augment-properties +#load-module module-alsa-sink device=hw:0 +#load-module module-alsa-source device=hw:0 +#load-module module-pipe-sink +#load-module module-pipe-source +#load-module module-null-sink +load-module module-xrdp-sink +load-module module-xrdp-source +load-module module-native-protocol-unix +#load-module module-udev-detect tsched=0 + +o sudo apt-get install pavucontrol + +o pulseaudio --kill + +o mplayer -ao pulse