Partially fixing ALSA device selection + env. variables - Alex
authorterminatorX <>
Thu, 26 Jun 2003 20:56:35 +0000 (20:56 +0000)
committerterminatorX <>
Thu, 26 Jun 2003 20:56:35 +0000 (20:56 +0000)
16 files changed:
terminatorX/ChangeLog
terminatorX/INSTALL
terminatorX/README
terminatorX/README.PERFORMANCE
terminatorX/configure.in
terminatorX/src/main.cc
terminatorX/src/tX_audiodevice.cc
terminatorX/src/tX_dialog.cc
terminatorX/src/tX_engine.cc
terminatorX/src/tX_global.c
terminatorX/src/tX_global.h
terminatorX/src/tX_legacy_global.c
terminatorX/src/tX_midiin.cc
terminatorX/src/tX_midiin.h
terminatorX/src/tX_seqpar.cc
terminatorX/terminatorX.spec.in

index b9cbc9a2ae11de3d5c6b034ed50664da9d47fd22..9d78bc4c188f4f74ced61b9c52a6b132c1056c81 100644 (file)
@@ -3,7 +3,29 @@ All changes were done by me (Alexander K
 This is not a GNU-style ChangeLog but you sort of get the idea what was
 changed.
 
-[v3.81 pre-release]
+[v3.81]
+- some ALSA installations seem to core on snd_pcm_hw_params_free() after sound
+  device init. So freeing the hw_params can now be explicitly disabled in
+  the Preferences - if terminatorX crashes right after hitting the "Power On"
+  button it might be necessary to activate this for your ALSA setup. This
+  probably results in a memory leak - but on leak vs core you might decide for
+  leak.
+- fixed a bug that caused turntable 1 to get the focus on entering Mouse Grab
+  mode even when it's audio panel was minimized.
+- introduced a new way of assigning MIDI controllers to parameters: simply 
+  right-click on a parameters control: a menu with "MIDI Learn" and 
+  "Remove MIDI Binding" will pop up. Simply select "MIDI Learn" and send the 
+  corresponding MIDI event.
+- fixed a bug in the MIDI callback thanks to 
+- the realtime scheduling reproducibly stalled separate machines. Unluckily 
+  an OS-stall situation is somewhat hard to debug. Additionally the new 2.5.*
+  and the 2.4.*-ckX kernels have significantly improved scheduling that renders
+  the use of SCHED_FIFO unnecessary. 
+- running suid root was reported exploitable by Andrew Griffiths
+  <andrewg@felinemenace.org> - the described environment variable based exploit 
+  was fixed - however there are possibly other ways to exploit it. Therefor 
+  running suid root has been explicitly disabled by default - configure with 
+  --enable-suidroot if you really, really want it. You have been warned.
 - often, you record events and mess things up - in this case I'd often prefer 
   dropping the complete take instead of recording a bad perfomance - which is 
   why you now can activate "Confirm Recorded Events" from the "Sequencer" menu.
index 6b8326b4e90777892822363671b83f44a7549a03..272958910a6605e371e4f50381b487b0015a9e05 100644 (file)
@@ -25,51 +25,13 @@ Step 1: Configure terminatorX.
        if use bash: > export CFLAGS="-O2"
        with tcsh:   > setenv CFLAGS "-O2"
 
-       I use CFLAGS="-O3 -mathlon" btw. You'll need to have a
-       "athlon-aware" compiler to use that though (gcc > 2.95.?).
+       Optionally you might want to add your platform specific tunings (-m* stuff).
 
        All of the following configure options can be either enabled with
        --enable-option or disabled with --disable-option.
 
        The configure Options:
        
-               Performance Options:
-               --------------------
-               
-               --enable-scheduler
-               
-               This option is now enabled by default. When run with root 
-               privileges terminatorX creates the engine thread with realtime
-               scheduling priorities which should result in much better
-               playback performance. Since Version 3.73 terminatorX supports
-               running suid root. If you install the terminatorX binary suid
-               root with the following commands: (with the default install
-               you should find the terminatorX binary in /usr/local/bin)
-               
-               > chown root terminatorX
-               > chmod u+s terminatorX
-               
-               terminatorX will be started with root privileges even when an
-               "unprivileged" user runs the binary. terminatorX will then 
-               create the engine thread with realtime priority before any files
-               are written, any parameters are evaluated or connections to the 
-               X11 display are established. Right after that terminatorX will
-               drop root privileges, so the actual terminatorX code runs 
-               unprivileged.
-               
-               The problem is, with Linux' pthreads implementation the pthread
-               manager thread (that can not be influenced by terminatorX) will 
-               still run with root privileges.
-               
-               So there is a small chance that a malicious attacker could 
-               utilize terminatorX to acquire root privileges if installed suid
-               root, although it should require quite some effort to create an
-               exploit for that. On the other hand realtime scheduling 
-               massively improves the playback performance. So depending on who
-               can access your computer you will have to decide for yourself on
-               performance vs security. Alternatively you can of course run
-               terminatorX as root to achieve realtime scheduling.
-                                               
                File support options:
                ---------------------
                
index f37dc1d65eb9d1520055f6fc76cbd1aa4cc331e8..9ec81c2ae2f0a2fcba635718b9be61d6a27f9048 100644 (file)
@@ -1,4 +1,4 @@
-terminatorX V3.80 README
+terminatorX V3.81 README
 ------------------------
 
 Copyright (C) 1999 - 2003 Alexander König
@@ -19,6 +19,6 @@ Read that fine Manual:
     o ./README.GNOME        - Some hints on GNOME-integration
     o ./README.PERFORMANCE  - Some hints on tuning terminatorX
     o ./doc/terminatorX-manual/C/terminatorX-manual.xml
-                           - The user manual browsable with "yelp"
-                             (yelp is the gnome2 help browser).
+                                                       - The user manual browsable with "yelp"
+                                                         (yelp is the gnome2 help browser).
     o ./COPYING             - The license
index 4145a2bed74ba7469c87c491e99ee0ff8f2a7faa..d727dc1619c029f6c82d5e8918b83f11cd2c5e2a 100644 (file)
@@ -27,35 +27,7 @@ kind of themes, neither.
 2. Install suid root
 --------------------
 
-When run with root privileges terminatorX creates the engine thread
-with realtime scheduling priorities which should result in much better
-playback performance. Since Version 3.73 terminatorX supports running
-suid root. If you install the terminatorX binary suid root with the
-following commands: (with the default install you should find the
-terminatorX binary in /usr/local/bin)
-                
- > chown root terminatorX
- > chmod u+s terminatorX
-                
-terminatorX will be started with root privileges even when an
-"unprivileged" user runs the binary. terminatorX will then create the
-engine thread with realtime priority before any files are written, any
-parameters are evaluated or connections to the X11 display are
-established. Right after that terminatorX will drop root privileges,
-so the actual terminatorX code runs unprivileged.
-                
-The problem is, with Linux' pthreads implementation the pthread
-manager thread (that can not be influenced by terminatorX) will still
-run with root privileges.
-               
-So there is a small chance that a malicious attacker could utilize
-terminatorX to acquire root privileges if installed suid root,
-although it should require quite some effort to create an exploit for
-that. On the other hand realtime scheduling massively improves the
-playback performance. So depending on who can access your computer you
-will have to decide for yourself on performance vs security.
-Alternatively you can of course run terminatorX as root to achieve
-realtime scheduling.
+Update: This is now considered dangerous and not recommended.
 
 3. Compile an optimized binary
 ------------------------------
@@ -74,12 +46,7 @@ in the options dialog.
 5. Optimize your kernel
 -----------------------
 
-The current 2.2.X-kernels show a pretty high latency. This is problematic for
-near-realtime apps and therefore most linux-audio-apps. Ingo Molnar is
-maintaining a patch against the 2.2.x kernels that reduces latency. They are
-called "low-latency-patches" and are available from:
-http://people.redhat.com/mingo/lowlatency-patches/
-
-Now although latency has improved with the 2.4 releases there is still some
-tuning possible with those kernels. There exist patches for those kernels as
-well and they may go into the main kernel tree as soon as they're finished.
+2.5 Kernels have much lower latency than older Kernels - if you want to work 
+with a stable Kernel however I recommend patching the 2.4 Series with Kolivas
+ck patches. They improve terminatorX performace signifcally - if you dont 
+forget to renice your X to '0' (see Kolivas' FAQ).
index a856ca65ea472febae127a7dd40bb292f39bc695..c06885cf34a8c87cdae89d61cbfa71ec79df42e3 100644 (file)
@@ -4,28 +4,26 @@ AM_INIT_AUTOMAKE(terminatorX, 3.81)
 AM_CONFIG_HEADER(config.h)
 
 dnl AC_ARG_ENABLE(closedev, [  --enable-closedev       close audio device if not in use. [default=yes] ])
-AC_ARG_ENABLE(sox, [  --enable-sox            use sox as input converter. (default=auto) ])
-AC_ARG_ENABLE(mpg123, [  --enable-mpg123         use mpg123 as input converter. (default=auto) ])
-AC_ARG_ENABLE(ogg123, [  --enable-ogg123         use ogg123 as input converter. (default=auto) ])
-dnl AC_ARG_ENABLE(wavonly,  [  --enable-wavonly        enable the builtin wav routines. ])
-dnl AC_ARG_ENABLE(scheduler,[  --enable-scheduler      enable rt-scheduling (req. root-priv). (default=yes) ])
-AC_ARG_ENABLE(debug,    [  --enable-debug          enable debug output. (default=no) ])
-dnl AC_ARG_ENABLE(3dnow,    [  --enable-3dnow          enables 3DNow! support. (default=no) ])
+AC_ARG_ENABLE(sox,                     [  --enable-sox            use sox as input converter. (default=auto) ])
+AC_ARG_ENABLE(mpg123,          [  --enable-mpg123         use mpg123 as input converter. (default=auto) ])
+AC_ARG_ENABLE(ogg123,          [  --enable-ogg123         use ogg123 as input converter. (default=auto) ])
+AC_ARG_ENABLE(scheduler,       [  --enable-scheduler      enable rt-scheduling (default=no) ])
+AC_ARG_ENABLE(debug,           [  --enable-debug          enable debug output. (default=no) ])
 dnl AC_ARG_ENABLE(benchmark,[  --enable-benchmark      creates a non-functional test version (default=no) ])
 AC_ARG_ENABLE(wav,          [  --enable-wav            enables the builtin wav-loader (default=yes) ])
 AC_ARG_ENABLE(xsetpointer,  [  --enable-xsetpointer    enables executing of xsetpointer (default=auto) ])
 AC_ARG_ENABLE(alsa,         [  --enable-alsa           use ALSA for sound output (default=auto) ])
 AC_ARG_ENABLE(oss,          [  --enable-oss            use OSS for sound output (default=auto) ])
-dnl AC_ARG_ENABLE(movqfix,         [  --disable-movqfix       don't use movq fix for gcc >= 2.96 [default=on] ])
 dnl AC_ARG_ENABLE(dga2,     [  --enable-dga2           use DGA2 instead of DGA1. (experimental) (default=no) ])
 AC_ARG_ENABLE(libxml2,     [  --disable-libxml2       use libxml even if verion 2 detected (default=auto) ])
-AC_ARG_ENABLE(mad,             [  --disable-mad           disable mad for mp3 support (default=auto) ])
-AC_ARG_ENABLE(vorbis,  [  --disable-vorbis        disable libvorbis support (default=auto) ])
+AC_ARG_ENABLE(mad,                     [  --disable-mad           disable mad for mp3 support (default=auto) ])
+AC_ARG_ENABLE(vorbis,          [  --disable-vorbis        disable libvorbis support (default=auto) ])
 AC_ARG_ENABLE(audiofile,       [  --disable-audiofile     disable audiofile support (default=auto) ])
-AC_ARG_ENABLE(legacy,          [  --disable-legacy        disable support for old terminatorX files (default=on) ])
+AC_ARG_ENABLE(legacy,          [  --enable-legacy         enable support for old terminatorX files (default=no) ])
 AC_ARG_ENABLE(alsamidi,                [  --disable-alsamidi      disable support  ALSA MIDI in (default=auto) ])
 AC_ARG_ENABLE(lrdf,                    [  --disable-lrdf          disable support for liblrdf (default=auto) ])
-AC_ARG_WITH(docdir,            [  --with-docdir=/some/dir the final location the docs will be installed to. ])
+AC_ARG_ENABLE(suidroot,                [  --enable-suidroot       enable suid-root exec - dangerous (default=no) ])
+AC_ARG_WITH(docdir,                    [  --with-docdir=/some/dir the final location the docs will be installed to. ])
 
 dnl Checks for programs.
 AC_PROG_AWK
@@ -47,6 +45,7 @@ OPTION_SCHEDULER="no"
 OPTION_ALSAMIDI="no"
 OPTION_LEGACY="no"
 OPTION_LRDF="no"
+OPTION_SUIDROOT="no"
 
 dnl Checks for libraries.
 AC_CHECK_LIB(m, floor,, AC_MSG_ERROR([** math-lib not installed or broken **]))
@@ -358,15 +357,11 @@ then
        OPTION_WAV="yes"
 fi
 
-dnl if test "$enable_flash" = "no"; then
-dnl    AC_DEFINE(DONT_USE_FLASH)
-dnl fi 
-
 if test "$enable_3dnow" = "yes"; then
        AC_DEFINE_UNQUOTED([USE_3DNOW], 1, [Do not define this])
 fi 
 
-if test "$enable_scheduler" != "no"; then
+if test "$enable_scheduler" = "yes"; then
        OPTION_SCHEDULER="yes";
        AC_DEFINE_UNQUOTED([USE_SCHEDULER], 1, [Define this to compile with rt scheduling support])
 fi
@@ -379,23 +374,22 @@ if test "$enable_benchmark" = yes; then
        AC_DEFINE_UNQUOTED([CREATE_BENCHMARK], 1, [Define this to build an performance benchmark - WARNING: You cannot use the resulting binary for normal operation])
 fi
 
-dnl AC_MSG_CHECKING(whether to use dials)
-dnl if test "$enable_dial" = no; then
-dnl    AC_MSG_RESULT(no)
-dnl else
-dnl    AC_MSG_RESULT(yes)
-       AC_DEFINE_UNQUOTED([USE_DIAL], 1, [Keep this defined])
-dnl fi
+if test "$enable_suidroot" = yes; then
+       OPTION_SUIDROOT="yes";
+       AC_DEFINE_UNQUOTED([ALLOW_SUID_ROOT], 1, [Define this only if you know what you're doing.])
+fi
 
 AC_MSG_CHECKING(for necessary scratching skillz)
 AC_MSG_RESULT(yes)
 
+AC_DEFINE_UNQUOTED([USE_DIAL], 1, [ Define this. ])
+
 dnl if test "$enable_bigdial" = yes; then
 dnl    AC_DEFINE(USE_DIAL)
 dnl    AC_DEFINE(USE_BIG_BUTTONS)
 dnl fi
 
-if test "$enable_legacy" != no; then
+if test "$enable_legacy" = yes; then
        AC_DEFINE_UNQUOTED([ENABLE_TX_LEGACY], 1, [Define this to enable support for old tX set files])
        OPTION_LEGACY="yes"
 fi
@@ -588,6 +582,11 @@ option_info;
 option=lrdf; option_val=$OPTION_LRDF; option_url=http://plugin.org.uk/releases/lrdf/
 option_info;
 
+if test "$OPTION_SUIDROOT" = "yes"; then
+       option="suid-root exec \(dangerous\)"; option_val=$OPTION_SUIDROOT;
+       option_info;
+fi
+
 echo "legacy files supprt: $OPTION_LEGACY"
 echo "builtin-wav support: $OPTION_WAV"
 echo "enhanced scheduling support: $OPTION_SCHEDULER"
index 85d8bddbec750971316f40f844e614ec6d2ee84d..4da4f7c366085ffde65892bbfd33ea37ce68ff86 100644 (file)
@@ -183,11 +183,30 @@ int parse_args(int *argc, char **argv)
        return 1;
 }
 
+void checkenv(const char *name) {
+       char *value;
+       int length;
+       
+       value=getenv(name);
+       if (value) {
+               length=strlen(value);
+               
+               if (length>=PATH_MAX) {
+                       tX_error("Your \"%s\" environment variable seems malicious (%i chars).", name, length);
+                       tX_error("Please correct that and restart terminatorX.");
+                       exit(-1);
+               }
+       }
+}
+
 int main(int argc, char **argv)
 {
        fprintf(stderr, "%s - Copyright (C) 1999-2003 by Alexander König\n", VERSIONSTRING);
        fprintf(stderr, "terminatorX comes with ABSOLUTELY NO WARRANTY - for details read the license.\n");
 
+       checkenv("HOME");
+       checkenv("XLOCALEDIR"); 
+       
        tX_engine *engine=tX_engine::get_instance();
        
        gtk_init (&argc, &argv);
index 5aaafa2bc9941c6a8a0c6fe002a401df00db00ff..cd96657afd39e21fea7684a0304af85170b14c62 100644 (file)
@@ -204,12 +204,7 @@ int tX_audiodevice_alsa :: open()
        char pcm_name[64];
        char foo[PATH_MAX];
        
-       
-       int card;
-       int device;
-       
-       sscanf(globals.alsa_device, "%i-%i: %s", &card, &device, foo);
-       sprintf(pcm_name, "hw:%i,%i", card, device);
+       strcpy(pcm_name, globals.alsa_device_id);
        
        if (snd_pcm_open(&pcm_handle, pcm_name, stream, 0) < 0) {
                tX_error("ALSA: Failed to access PCM device \"%s\"", pcm_name);
index 261c6e85e4b0ded89b18de20407b06ce027cb370..f2cc72a4fd6d2125f14024218e0067764bc08ff3 100644 (file)
@@ -52,6 +52,30 @@ extern char *logo_xpm[];
 GtkWidget *opt_dialog;
 int opt_hidden=0;
 
+static GtkWidget *last_alsa_device_widget=NULL;
+static GtkWidget *alsa_device_entry=NULL;
+
+static void alsa_device_changed(GtkList *list, GtkWidget *widget, gpointer user_data) {
+       if (widget) {
+               if (widget != last_alsa_device_widget) {
+                       last_alsa_device_widget = widget;
+                       GtkWidget *label=gtk_bin_get_child(GTK_BIN(widget));
+                       
+                       if (label) {
+                               char foo[PATH_MAX];
+                               char tmp[PATH_MAX];
+                               int card;
+                               int device;
+                               sscanf(gtk_label_get_text(GTK_LABEL(label)), "%i-%i: %s", &card, &device, foo);
+                               sprintf(tmp, "hw:%i,%i", card, device);
+                               
+                               gtk_entry_set_text(GTK_ENTRY(alsa_device_entry), tmp);
+                       }
+               }
+       }
+}
+
 void apply_options(GtkWidget *dialog) {
        /* Audio */
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "alsa_driver")))) {
@@ -69,7 +93,7 @@ void apply_options(GtkWidget *dialog) {
        globals.oss_samplerate=atoi(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "oss_samplerate"))->entry)));
        
        /* Audio: ALSA */
-       strcpy(globals.alsa_device, gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "alsa_audio_device"))->entry)));
+       strcpy(globals.alsa_device_id, gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "alsa_audio_device"))->entry)));
        globals.alsa_buffer_time=(int) gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "alsa_buffer_time")));
        globals.alsa_buffer_time*=1000;
        globals.alsa_period_time=(int) gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "alsa_period_time")));
@@ -302,12 +326,18 @@ void init_tx_options(GtkWidget *dialog) {
        
        
        /* Audio: ALSA */
+       GtkCombo *combo=GTK_COMBO(lookup_widget(dialog, "alsa_audio_device"));
        GList *alsa_list=get_alsa_device_list();
+       last_alsa_device_widget=NULL;
+       alsa_device_entry=combo->entry;
+       
        if (alsa_list) {
-               gtk_combo_set_popdown_strings(GTK_COMBO(lookup_widget(dialog, "alsa_audio_device")), get_alsa_device_list());
+               gtk_combo_set_popdown_strings(combo, get_alsa_device_list());
        }
-       gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "alsa_audio_device"))->entry), globals.alsa_device);
+       gtk_entry_set_text(GTK_ENTRY(combo->entry), globals.alsa_device_id);
 
+       g_signal_connect(G_OBJECT(combo->list), "select_child", G_CALLBACK(alsa_device_changed), NULL);
+       
        gtk_range_set_value(GTK_RANGE(lookup_widget(dialog, "alsa_buffer_time")), globals.alsa_buffer_time/1000);
        gtk_tooltips_set_tip(tooltips, lookup_widget(dialog, "alsa_buffer_time"), "Sets the size of the ALSA ring buffer. On slower systems you might have to increase this value (if you hear \"clicks\" or drop-outs). Lower values mean lower latency though.", NULL);       
        gtk_range_set_value(GTK_RANGE(lookup_widget(dialog, "alsa_period_time")), globals.alsa_period_time/1000);
@@ -444,16 +474,14 @@ void show_about(int nag)
 
 //     GTK_WINDOW(window)->use_uposition=TRUE;
 
-       gtk_widget_realize(window);
-       
-       gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+       g_object_set (G_OBJECT (window), "type", GTK_WINDOW_TOPLEVEL, NULL);
+       if (nag) { gtk_window_set_decorated(GTK_WINDOW(window), FALSE); }
+       gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+       //gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
        gtk_window_set_title(GTK_WINDOW(window), "terminatorX - About");
+       //gtk_widget_set_size_request(window, 640, 210);
        
-       if (nag)
-       {
-               gdk_window_set_decorations(window->window, (enum GdkWMDecoration) 0);
-       }
-
+       gtk_widget_realize(window);
        
        style = gtk_widget_get_style( window );
 
index 6a625412360825eadad115f78ffede0279b572f2..165646da42e4f477d6d318437ab5d32d9bd0cf5c 100644 (file)
@@ -134,6 +134,12 @@ void *engine_thread_entry(void *engine_void) {
        /* Dropping root privileges for the engine thread - if running suid. */
        
        if ((!geteuid()) && (getuid() != geteuid())) {
+               
+#ifndef ALLOW_SUID_ROOT
+               tX_error("This binary doesn't support running suid-root.");
+               tX_error("Reconfigure with --enable-suidroot if you really want that.");
+               exit(-1);
+#endif         
                tX_debug("engine_thread_entry() - Running suid root - dropping privileges.");
                
                result=setuid(getuid());
index 1434f2784e24d964d511e1a0fef8e80a6a7021b8..6281e59016a516397532ebe89f982b4b97a47b5d 100644 (file)
@@ -81,7 +81,7 @@ void set_global_defaults() {
        globals.oss_buff_size=9;
        globals.oss_samplerate=44100;
 
-       strcpy(globals.alsa_device, "00-00: Default");  
+       strcpy(globals.alsa_device_id, "hw:0,0");       
        globals.alsa_buffer_time=80000;
        globals.alsa_period_time=20000;
        globals.alsa_samplerate=44100;
@@ -185,7 +185,7 @@ int load_globals_xml() {
                        restore_int("oss_buff_size", globals.oss_buff_size);
                        restore_int("oss_samplerate", globals.oss_samplerate);
 
-                       restore_string("alsa_device", globals.alsa_device);
+                       restore_string("alsa_device_id", globals.alsa_device_id);
                        restore_int("alsa_buffer_time", globals.alsa_buffer_time);
                        restore_int("alsa_period_time", globals.alsa_period_time);
                        restore_int("alsa_samplerate", globals.alsa_samplerate);
@@ -236,7 +236,7 @@ int load_globals_xml() {
 }
 
 void store_globals() {
-       char rc_name[PATH_MAX]="";
+       char rc_name[PATH_MAX+256]="";
        char device_type[16];
        char indent[]="\t";
        FILE *rc=NULL;
@@ -275,7 +275,7 @@ void store_globals() {
                store_int("oss_buff_size", globals.oss_buff_size);
                store_int("oss_samplerate", globals.oss_samplerate);
 
-               store_string("alsa_device", globals.alsa_device);
+               store_string("alsa_device_id", globals.alsa_device_id);
                store_int("alsa_buffer_time", globals.alsa_buffer_time);
                store_int("alsa_period_time", globals.alsa_period_time);
                store_int("alsa_samplerate", globals.alsa_samplerate);          
index d3b9e9e8a1bef538e2d5a7dd5d1a8992ce6cfbab..816507f4b91af179dc8da9755cd9b63fa6d2bb43 100644 (file)
@@ -128,7 +128,7 @@ typedef struct {
        int oss_samplerate;
        
        /* ALSA specific options */
-       char alsa_device[PATH_MAX];
+       char alsa_device_id[PATH_MAX];
        int alsa_buffer_time;
        int alsa_period_time;
        int alsa_samplerate;
index 5f97b4ad6fecaec948617c5e0d692d02e4572289..4f39537420ed78062c72425014f724d8d2114056 100644 (file)
@@ -43,7 +43,7 @@ void get_rc_name_old(char *buffer)
 }
 
 void load_globals_old() {      
-       char rc_name[PATH_MAX]="";      
+       char rc_name[PATH_MAX+256]="";  
        FILE *rc;
        get_rc_name_old(rc_name);
        
index 7087cd17da4eb3ecf2e22b328c78cf75ab712885..df977e5ef143d1cfc6d44200aba7c3337fc8e4e8 100644 (file)
@@ -121,9 +121,27 @@ int tX_midiin::check_event()
                        case SND_SEQ_EVENT_PITCHBEND:
                                event.type = tX_midievent::PITCHBEND;
                                event.number = ev->data.control.param;
-                               event.value = ev->data.control.value / 127.0;
+                               event.value = (ev->data.control.value + 8191.0) / 16382.0; // 127.0;
                                event.channel = ev->data.control.channel;
                                break;
+                       case SND_SEQ_EVENT_CONTROL14:
+                               event.type = tX_midievent::CC14;
+                               event.number = ev->data.control.param;
+                               event.value = ev->data.control.value / 16383.0;
+                               event.channel = ev->data.control.channel;
+                               break;
+                       case SND_SEQ_EVENT_REGPARAM:
+                               event.type = tX_midievent::RPN;
+                               event.number = ev->data.control.param;
+                               event.value = ev->data.control.value / 16383.0;
+                               event.channel = ev->data.control.channel;
+                               break;
+                       case SND_SEQ_EVENT_NONREGPARAM:
+                               event.type = tX_midievent::NRPN;
+                               event.number = ev->data.control.param;
+                               event.value = ev->data.control.value / 16383.0;
+                               event.channel = ev->data.control.channel;
+                               break;                                          
                        case SND_SEQ_EVENT_NOTEON:
                                event.type = tX_midievent::NOTE;
                                event.number = ev->data.note.note;
index 42ed1bb6fdbb0941009637c2e0a6b5cd96a4700e..60770c55a49d1815dd6d41708f8224849d9a2da3 100644 (file)
@@ -43,6 +43,9 @@ class tX_midievent
                CC=1,
                NOTE,
                PITCHBEND,
+               CC14,
+               RPN,
+               NRPN
        } type;
        int number; // note # or controller #
        
index c22eb0874482d0c9c621dbb705edee57f0f23759..ebc3b3f75b83ad1a58118f3eacd4216d9fc0243d 100644 (file)
@@ -83,17 +83,19 @@ void tX_seqpar :: handle_midi_input( const tX_midievent& event )
        
        if( !is_boolean )
        {
-               if( event.type == tX_midievent::CC || event.type == tX_midievent::PITCHBEND )
-               {       
-                       tmpvalue = event.value * (max_value-min_value) + min_value;
-               }
-               else if( event.type == tX_midievent::NOTE )
-               {
-                       tmpvalue = event.is_noteon;
-               }
-               else
-               {
-                       return;
+               switch (event.type) {
+                       case tX_midievent::CC:
+                       case tX_midievent::CC14:
+                       case tX_midievent::PITCHBEND:
+                       case tX_midievent::RPN:
+                       case tX_midievent::NRPN:
+                                       tmpvalue = event.value * (max_value-min_value) + min_value;                             
+                               break;
+                       case tX_midievent::NOTE:
+                                       tmpvalue = event.is_noteon;
+                               break;
+                       default:
+                               return;
                }
 
                if (tmpvalue>max_value) tmpvalue=max_value;
@@ -242,6 +244,12 @@ void tX_seqpar :: restore_meta(xmlNodePtr node) {
                        bound_midi_event.type=tX_midievent::NOTE;
                } else if (strcmp("pitchbend", buffer)==0) {
                        bound_midi_event.type=tX_midievent::PITCHBEND;
+               } else if (strcmp("cc14", buffer)==0) {
+                       bound_midi_event.type=tX_midievent::CC14;
+               } else if (strcmp("rpn", buffer)==0) {
+                       bound_midi_event.type=tX_midievent::RPN;
+               } else if (strcmp("nrpn", buffer)==0) {
+                       bound_midi_event.type=tX_midievent::NRPN;
                } else {
                        tX_error("unknown midiType \"%s\" for seqpar %s", buffer, this->get_name());
                }
@@ -267,6 +275,9 @@ void tX_seqpar :: store_meta(FILE *rc, gzFile rz) {
                        case tX_midievent::NOTE: type="note"; break;
                        case tX_midievent::CC: type="cc"; break;
                        case tX_midievent::PITCHBEND: type="pitchbend"; break;
+                       case tX_midievent::CC14: type="cc14"; break;
+                       case tX_midievent::RPN: type="rpn"; break;
+                       case tX_midievent::NRPN: type="nrpn"; break;
                        default: type="error";
                }
                sprintf(buffer, "id=\"%i\" midiType=\"%s\" midiChannel=\"%i\" midiNumber=\"%i\"", persistence_id, type, bound_midi_event.channel, bound_midi_event.number);
index 2d4b94ebb04612c96251aa71717f12e1f7a99cc9..4babaafdaa47f4d94f75926aaf18bd7f44887c0b 100644 (file)
@@ -23,6 +23,8 @@ effects (buit-in as well as LADSPA plugin effects), a sequencer and MIDI
 interface - all accessible through an easy-to-use gtk+ GUI.
 
 %changelog
+* Fri Apr 11 2003 Alexander König <alex@lisas.de>
+ - disabled the suid root stuff
 * Fri Apr 11 2003 Alexander König <alex@lisas.de>
  - scrollkeeper changes and updates
 * Sat Sep 14 2002 Alexander König <alex@lisas.de>
@@ -103,11 +105,12 @@ rm -rf $RPM_BUILD_ROOT/var
 
 %post
 if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update -q -o %{_datadir}/omf/terminatorX; fi
-echo Note: Installing terminatorX \"suid root\" improves terminatorX\' performance 
-echo for non-root users, but poses a potential security threat. See \'INSTALL\' for
-echo details. To install terminatorX \"suid root\" run the following command:
-echo
-echo chmod u+s /usr/bin/terminatorX
+
+#echo Note: Installing terminatorX \"suid root\" improves terminatorX\' performance 
+#echo for non-root users, but poses a potential security threat. See \'INSTALL\' for
+#echo details. To install terminatorX \"suid root\" run the following command:
+#echo
+#echo chmod u+s /usr/bin/terminatorX
 
 %postun
 if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update -q; fi