<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
if I do chrt -p PID, I get<br>
<br>
... current scheduling policy: SCHED_OTHER<br>
... current scheduling priority: 0 // i.e. "<font face="Arial">options.priority
= 15;"</font><br>
<br>
Starting the program with<br>
<br>
chrt 65 ...<br>
<br>
I get:<br>
... current scheduling policy: SCHED_RR<br>
... current scheduling priority: 0 // i.e. "<font face="Arial">options.priority
= 65;"</font><br>
<br>
<br>
Regards<br>
Thomas<br>
<br>
<br>
Am 22.08.2012 16:44, schrieb TJF:
<blockquote cite="mid:5034F045.5030308@web.de" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<font face="Arial">Hi Gary,<br>
<br>
I did this:<br>
<br>
//------------------------------------------------<br>
<br>
RtAudio::StreamOptions options;<br>
options.flags = RTAUDIO_MINIMIZE_LATENCY;<br>
options.flags = RTAUDIO_SCHEDULE_REALTIME;<br>
options.flags = RTAUDIO_HOG_DEVICE;<br>
options.flags = RTAUDIO_ALSA_USE_DEFAULT;<br>
options.numberOfBuffers = 2;<br>
options.priority = max;<br>
<br>
<br>
std::cout << "\nPriority min: " << min <<
std::endl;<br>
std::cout << "\nPriority max: " << max <<
std::endl;<br>
<br>
// min and max are 1 and 99 ...<br>
<br>
struct sched_param sched_p;<br>
//std::cout << "\nPriority IST: " <<
sched_getparam(getpid(), &sched_p) << std::endl;<br>
std::cout << "\nPriority IST: " <<
sched_getparam(0, &sched_p) << std::endl;<br>
<br>
</font><font face="Arial">//------------------------------------------------<br>
<br>
For the last line I get always "0". I is in an Linux environment
with RT-Kernel (only command-line OS). The same with another
"normal" Kernel and XFCE... The task manager also shows "0".<br>
<br>
Do you have any idea?<br>
<br>
Regards<br>
Thomas<br>
</font><font face="Arial"><br>
<br>
</font>
<div class="moz-cite-prefix">Am 16.08.2012 06:57, schrieb Gary
Scavone:<br>
</div>
<blockquote
cite="mid:A0D80F52-D88F-4AFD-B27A-3416EADE33E4@ccrma.stanford.edu"
type="cite">
<pre wrap="">Hi Tomas,
The "priority" option is only used if you also set the RTAUDIO_SCHEDULE_REALTIME flag. The priority value (a number) corresponds to the linux realtime scheduling system … I can't remember the valid range of values, though whatever you provide is checked against:
int min = sched_get_priority_min( SCHED_RR );
int max = sched_get_priority_max( SCHED_RR );
Regards,
--gary
On 2012-08-13, at 9:41 AM, TJF <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:tjfoerster@web.de"><tjfoerster@web.de></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi everybody,
I am changing some things to bring my Windows application to Linux. I want to use the StreamOption "priority".
Am I right to to use it this way (the second line)? May be also a second process - the process name of my application?
RtAudio::StreamOptions options;
options.priority = ALSA;
My other question: In Windows I used system keyboard events like this to control the command-line app from outside:
(Ctrl+o)
if(GetAsyncKeyState(VK_CONTROL)&&GetAsyncKeyState(0x4F))
{
...
}
For Linux I couln't find something similar. What would be a "light-weight" solution: Using SDL (only keyboard-events)?
Thanks a lot!
Regards
Thomas
_______________________________________________
Stk mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Stk@ccrma.stanford.edu">Stk@ccrma.stanford.edu</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://ccrma-mail.stanford.edu/mailman/listinfo/stk">http://ccrma-mail.stanford.edu/mailman/listinfo/stk</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Stk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Stk@ccrma.stanford.edu">Stk@ccrma.stanford.edu</a>
<a class="moz-txt-link-freetext" href="http://ccrma-mail.stanford.edu/mailman/listinfo/stk">http://ccrma-mail.stanford.edu/mailman/listinfo/stk</a>
</pre>
</blockquote>
</body>
</html>