darkice macosx in sync with trunk

This commit is contained in:
rafael@riseup.net 2010-07-19 21:05:31 +00:00
parent 89921c7e5e
commit 3d3422f9b9
6 changed files with 43 additions and 12 deletions

View File

@ -1,14 +1,23 @@
Next release
o fixed a bug in BufferedSink.cpp that leads to some buffers
being written twice, causing corruption of datastream,
thanks to Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
o implemented samplerate conversion for all codecs using libsamplerate,
and keeping internal aflibConverter as fallback,
thanks to Sergiy <piratfm@gmail.com>
o bugfix: fix for alsa driver - closes ticked #8
thanks to Clemens Ladisch <clemens@ladisch.de>
Darkice next release
o Added rtprio parameter and revisited realtime priority
closes ticket #21
thanks to Cheerio <adi@drcomp.erfurt.thur.de>
o Fixed a call to a deprecated jack call
closes ticket #22
thanks to Cheerio again.
o Implemented CoreAudio driver for MacOS X
09-05-2010 Darkice 1.0 released
o fixed a bug in BufferedSink.cpp that leads to some buffers
being written twice, causing corruption of datastream,
closes ticked #20
thanks to Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
o implemented samplerate conversion for all codecs using libsamplerate,
and keeping internal aflibConverter as fallback,
thanks to Sergiy <piratfm@gmail.com>
o bugfix: fix for alsa driver - closes ticked #8
thanks to Clemens Ladisch <clemens@ladisch.de>
14-11-2009 Darkice 0.20.1 released
o added rc.darkice init script
thanks to Niels Dettenbach <nd@syndicat.com>

View File

@ -6,6 +6,8 @@
duration = 60 # duration of encoding, in seconds. 0 means forever
bufferSecs = 5 # size of internal slip buffer, in seconds
reconnect = yes # reconnect to the server(s) if disconnected
realtime = yes # run the encoder with POSIX realtime priority
rtprio = 3 # scheduling priority for the realtime threads
# this section describes the audio input that will be streamed
[input]

View File

@ -62,6 +62,10 @@ streaming, "yes" or "no". (optional parameter, defaults to "yes")
.I realtime
Use POSIX realtime scheduling, "yes" or "no".
(optional parameter, defaults to "yes")
.TP
.I rtprio
Scheduling priority for the realtime threads.
(optional parameter, defaults to 4)
.PP

View File

@ -164,6 +164,13 @@ DarkIce :: init ( const Config & config ) throw ( Exception )
str = cs->get( "realtime" );
enableRealTime = str ? (Util::strEq( str, "yes") ? true : false) : true;
// get realtime scheduling priority. If unspecified, set it to 4.
// Why 4? jackd's default priority is 10, jackd client threads run
// at 5, so make the encoder thread use 4. jackd automatically sets
// the process callback priority to the right value, so all we have
// to care about is the encoder priority.
str = cs->get( "rtprio" );
realTimeSchedPriority = (str != NULL) ? Util::strToL( str ) : 4;
// the [input] section
if ( !(cs = config.get( "input")) ) {
@ -1111,13 +1118,17 @@ DarkIce :: setRealTimeScheduling ( void ) throw ( Exception )
}
origSchedPriority = param.sched_priority;
/* set SCHED_FIFO with max - 1 priority */
/* set SCHED_FIFO with max - 1 priority or user configured value */
if ( (high_priority = sched_get_priority_max(SCHED_FIFO)) == -1 ) {
throw Exception(__FILE__,__LINE__,"sched_get_priority_max",errno);
}
reportEvent( 8, "scheduler high priority", high_priority);
param.sched_priority = high_priority - 1;
if (realTimeSchedPriority > high_priority) {
param.sched_priority = high_priority - 1;
} else {
param.sched_priority = realTimeSchedPriority;
}
if ( sched_setscheduler( 0, SCHED_FIFO, &param) == -1 ) {
reportEvent( 1,

View File

@ -124,6 +124,11 @@ class DarkIce : public virtual Referable, public virtual Reporter
*/
int enableRealTime;
/**
* Scheduling priority for the realtime threads
*/
int realTimeSchedPriority;
/**
* Original scheduling policy
*/

View File

@ -206,7 +206,7 @@ JackDspSource :: open ( void ) throw ( Exception )
snprintf(client_name, 255, "darkice-%d", getpid());
}
if ((client = jack_client_new(client_name)) == NULL) {
if ((client = jack_client_open(client_name, (jack_options_t)0, NULL)) == NULL) {
throw Exception( __FILE__, __LINE__, "JACK server not running?");
}
Reporter::reportEvent( 1, "Registering as JACK client", client_name);