<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <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 &lt;&lt; "\nPriority min: " &lt;&lt; min &lt;&lt;
      std::endl;<br>
      std::cout &lt;&lt; "\nPriority max: " &lt;&lt; max &lt;&lt;
      std::endl;<br>
      <br>
      // min and max are 1 and 99 ...<br>
      <br>
      struct sched_param sched_p;<br>
        //std::cout &lt;&lt; "\nPriority IST: " &lt;&lt;
      sched_getparam(getpid(), &amp;sched_p) &lt;&lt; std::endl;<br>
        std::cout &lt;&lt; "\nPriority IST: " &lt;&lt; sched_getparam(0,
      &amp;sched_p) &lt;&lt; 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 class="moz-txt-link-rfc2396E" href="mailto:tjfoerster@web.de">&lt;tjfoerster@web.de&gt;</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)&amp;&amp;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 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>
      <pre wrap="">

</pre>
    </blockquote>
    <br>
  </body>
</html>