Re: [seq24-users] Fwd: [Seq24-devel] [PATCH] adjustable realtime priority
Brought to you by:
rcbuse
|
From: Ben S. <ben...@fa...> - 2007-02-11 02:11:20
|
Thanks for this patch - hopefully it will be integrated into the official
source.
Ben
On Saturday 10 February 2007 16:11, Florian Schmidt wrote:
> Ah well, since noone answered on seq24-devel, i'll post this here, too.
> Maybe someone has a need for it..
>
> Flo
>
> ----------------------------
> A patch (also attached) to make the RT prio adjustable (if you use other
> RT software like jack, you want seq24's midi timing thread to be higher
> prio than jackd's process cycle).
>
> Also in such a setup a non root user can usually make processes run
> SCHED_FIFO thus,
> the help output was adjusted to reflect that.
>
> Regards,
> Flo
>
> diff -Nru /tmp/seq24-0.8.7/src/globals.h seq24-0.8.7/src/globals.h
> --- /tmp/seq24-0.8.7/src/globals.h 2006-05-30 15:42:18.000000000 +0200
> +++ seq24-0.8.7/src/globals.h 2007-01-27 02:42:49.000000000 +0100
> @@ -159,7 +159,7 @@
> const int c_perf_scale_x = 32; /*ticks per pixel */
>
> extern bool global_showmidi;
> -extern bool global_priority;
> +extern int global_priority;
> extern bool global_stats;
> extern bool global_pass_sysex;
> extern bool global_with_jack_transport;
> diff -Nru /tmp/seq24-0.8.7/src/perform.cpp seq24-0.8.7/src/perform.cpp
> --- /tmp/seq24-0.8.7/src/perform.cpp 2006-08-13 22:42:38.000000000 +0200
> +++ seq24-0.8.7/src/perform.cpp 2007-01-27 02:45:51.000000000 +0100
> @@ -1006,7 +1006,7 @@
> if ( global_priority ){
>
> memset(schp, 0, sizeof(sched_param));
> - schp->sched_priority = 1;
> + schp->sched_priority = global_priority;
>
> if (sched_setscheduler(0, SCHED_FIFO, schp) != 0) {
>
> @@ -1564,7 +1564,7 @@
> if ( global_priority ){
>
> memset(schp, 0, sizeof(sched_param));
> - schp->sched_priority = 1;
> + schp->sched_priority = global_priority;
>
> if (sched_setscheduler(0, SCHED_FIFO, schp) != 0) {
>
> Binary files /tmp/seq24-0.8.7/src/.perform.cpp.swp and
> seq24-0.8.7/src/.perform.cpp.swp differ
> diff -Nru /tmp/seq24-0.8.7/src/seq24.cpp seq24-0.8.7/src/seq24.cpp
> --- /tmp/seq24-0.8.7/src/seq24.cpp 2006-05-30 15:42:45.000000000 +0200
> +++ seq24-0.8.7/src/seq24.cpp 2007-01-27 02:47:50.000000000 +0100
> @@ -38,7 +38,7 @@
> {"help", 0, 0, 'h'},
> {"showmidi", 0, 0, 's'},
> {"stats", 0, 0, 'S' },
> - {"priority", 0, 0, 'p' },
> + {"priority", required_argument, 0, 'p' },
> {"ignore",required_argument, 0, 'i'},
> {"jack_transport",0, 0, 'j'},
> {"jack_master",0, 0, 'J'},
> @@ -53,7 +53,7 @@
>
> bool global_manual_alsa_ports = false;
> bool global_showmidi = false;
> -bool global_priority = false;
> +int global_priority = 0;
> bool global_device_ignore = false;
> int global_device_ignore_num = 0;
> bool global_stats = false;
> @@ -160,7 +160,7 @@
> printf( " --file <filename> : load midi file on
> startup\n" );
> printf( " --manual_alsa_ports : seq24 won't attach
> alsa ports\n" );
> printf( " --showmidi : dumps incoming midi to
> screen\n" ); - printf( " --priority : runs higher
> priority with FIFO scheduler (must be root)\n" );
> + printf( " --priority <priority>: runs higher priority
> with FIFO scheduler\n" );
> printf( " --pass_sysex : passes any incoming sysex
> messages to all outputs \n" );
> printf( " --show_keys : prints pressed key value\n"
> ); printf( " --jack_transport : seq24 will sync to jack transport\n"
> );
> @@ -187,7 +187,7 @@
>
> case 'p':
>
> - global_priority = true;
> + global_priority = atoi ( optarg );
>
> break;
>
>
>
> --
> Palimm Palimm!
> http://tapas.affenbande.org
|