From 73b074d602993c5e6c9610f33846a4f01a2f3cfe Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 31 Mar 2013 18:06:33 -0700 Subject: chansrv: work on pulse sink --- sesman/chansrv/chansrv.c | 10 ++++++++-- sesman/chansrv/pulse/module-xrdp-sink.c | 14 ++++---------- sesman/chansrv/pulse/pulse-notes.txt | 29 +++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 12 deletions(-) (limited to 'sesman') diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index 74e2db4a..0f7ff042 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2009-2012 + * Copyright (C) Jay Sorg 2009-2013 * Copyright (C) Laxmikant Rashinkar 2009-2012 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,6 +45,7 @@ static int g_rdpsnd_index = -1; static int g_rdpdr_index = -1; static int g_rail_index = -1; static int g_drdynvc_index = -1; +static int g_sent = 0; /* if sent data to xrdp, waiting response */ /* state info for dynamic virtual channels */ static struct xrdp_api_data *g_dvc_channels[MAX_DVC_CHANNELS]; @@ -149,6 +150,7 @@ send_data_from_chan_item(struct chan_item *chan_item) s_mark_end(s); LOGM((LOG_LEVEL_DEBUG, "chansrv::send_channel_data: -- " "size %d chan_flags 0x%8.8x", size, chan_flags)); + g_sent = 1; error = trans_force_write(g_con_trans); if (error != 0) @@ -214,7 +216,10 @@ send_channel_data(int chan_id, char *data, int size) if (g_chan_items[index].id == chan_id) { add_data_to_chan_item(g_chan_items + index, data, size); - check_chan_items(); + if (g_sent == 0) + { + check_chan_items(); + } return 0; } } @@ -478,6 +483,7 @@ static int APP_CC process_message_channel_data_response(struct stream *s) { LOG(10, ("process_message_channel_data_response:")); + g_sent = 0; check_chan_items(); return 0; } diff --git a/sesman/chansrv/pulse/module-xrdp-sink.c b/sesman/chansrv/pulse/module-xrdp-sink.c index 017d757e..92f4b674 100644 --- a/sesman/chansrv/pulse/module-xrdp-sink.c +++ b/sesman/chansrv/pulse/module-xrdp-sink.c @@ -262,7 +262,6 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) { char *data; int bytes; int sent; - int display_num; int fd; struct header h; struct sockaddr_un s; @@ -276,9 +275,8 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) { fd = socket(PF_LOCAL, SOCK_STREAM, 0); memset(&s, 0, sizeof(s)); s.sun_family = AF_UNIX; - display_num = get_display_num_from_display(getenv("DISPLAY")); bytes = sizeof(s.sun_path) - 1; - snprintf(s.sun_path, bytes, CHANSRV_PORT_STR, display_num); + snprintf(s.sun_path, bytes, CHANSRV_PORT_STR, u->display_num); pa_log("trying to conenct to %s", s.sun_path); if (connect(fd, (struct sockaddr *)&s, sizeof(struct sockaddr_un)) != 0) { @@ -296,15 +294,11 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) { //pa_log("bytes %d", bytes); /* from rewind */ - if (u->skip_bytes > 0) - { - if (bytes > u->skip_bytes) - { + if (u->skip_bytes > 0) { + if (bytes > u->skip_bytes) { bytes -= u->skip_bytes; u->skip_bytes = 0; - } - else - { + } else { u->skip_bytes -= bytes; return bytes; } diff --git a/sesman/chansrv/pulse/pulse-notes.txt b/sesman/chansrv/pulse/pulse-notes.txt index 4a4b7273..e99b3ec5 100644 --- a/sesman/chansrv/pulse/pulse-notes.txt +++ b/sesman/chansrv/pulse/pulse-notes.txt @@ -25,3 +25,32 @@ autospawn = no daemon-binary = /bin/true xfreerdp -a 24 -z --plugin rdpsnd --data alsa:hw:0,0 -- 127.0.0.1 + + +to get ./configure on pulse source to run +apt-get install libsndfile1-dev +apt-get install libspeex-dev +apt-get install libspeexdsp-dev + +alsamixer +apt-get install alsa-utils + +/etc/asound.conf +--------------------------------- +pcm.pulse { + type pulse +} + +ctl.pulse { + type pulse +} + +pcm.!default { + type pulse +} + +ctl.!default { + type pulse +} +--------------------------------- + -- cgit v1.2.1 From d8d35f05139b1609182502eb755ac2d4092bace1 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 31 Mar 2013 19:50:12 -0700 Subject: chansrv: added some pulse sink notes --- sesman/chansrv/pulse/pulse-notes.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'sesman') diff --git a/sesman/chansrv/pulse/pulse-notes.txt b/sesman/chansrv/pulse/pulse-notes.txt index e99b3ec5..b5d51572 100644 --- a/sesman/chansrv/pulse/pulse-notes.txt +++ b/sesman/chansrv/pulse/pulse-notes.txt @@ -4,7 +4,7 @@ Pulse audio notes. to see what version of PA is on your machine pulseaudio --version - +IMA ADPCM To build xrdp pulse sink, get the pulse source that most closely matches your version on @@ -35,6 +35,7 @@ apt-get install libspeexdsp-dev alsamixer apt-get install alsa-utils + /etc/asound.conf --------------------------------- pcm.pulse { @@ -54,3 +55,18 @@ ctl.!default { } --------------------------------- + +/etc/pulse/default.pa +--------------------------------- +.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-native-protocol-unix +#load-module module-udev-detect tsched=0 +--------------------------------- -- cgit v1.2.1 From b4ce83a685eae2f8aa0589b9a306b35eeb3b6e10 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Wed, 3 Apr 2013 20:49:01 -0700 Subject: ipv6 fix for sesman --- sesman/libscp/libscp_tcp.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'sesman') diff --git a/sesman/libscp/libscp_tcp.c b/sesman/libscp/libscp_tcp.c index 29870563..30e8006c 100644 --- a/sesman/libscp/libscp_tcp.c +++ b/sesman/libscp/libscp_tcp.c @@ -26,12 +26,6 @@ #include "libscp_tcp.h" -#include -#include -#include -#include -#include - extern struct log_config *s_log; /*****************************************************************************/ @@ -124,11 +118,5 @@ scp_tcp_force_send(int sck, char *data, int len) int DEFAULT_CC scp_tcp_bind(int sck, char *addr, char *port) { - struct sockaddr_in s; - - memset(&s, 0, sizeof(struct sockaddr_in)); - s.sin_family = AF_INET; - s.sin_port = htons(atoi(port)); - s.sin_addr.s_addr = inet_addr(addr); - return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_in)); + return g_tcp_bind_address(sck, port, addr); } -- cgit v1.2.1