<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Require Thread permissions in audio primary hal in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Require-Thread-permissions-in-audio-primary-hal/m-p/1186802#M165307</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating two threads in audio primary Hal with &lt;STRONG&gt;SCHED_FIFO&lt;/STRONG&gt; policy but is failing to create the thread, it seems it require &lt;STRONG&gt;SYS_NICE&lt;/STRONG&gt; capability. So how to provide &lt;STRONG&gt;CAP_SYS_NICE&lt;/STRONG&gt; capability for audio primary Hal. Thanks in advance for the response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Fri, 20 Nov 2020 16:06:15 GMT</pubDate>
    <dc:creator>vinothkumars</dc:creator>
    <dc:date>2020-11-20T16:06:15Z</dc:date>
    <item>
      <title>Require Thread permissions in audio primary hal</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Require-Thread-permissions-in-audio-primary-hal/m-p/1186802#M165307</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating two threads in audio primary Hal with &lt;STRONG&gt;SCHED_FIFO&lt;/STRONG&gt; policy but is failing to create the thread, it seems it require &lt;STRONG&gt;SYS_NICE&lt;/STRONG&gt; capability. So how to provide &lt;STRONG&gt;CAP_SYS_NICE&lt;/STRONG&gt; capability for audio primary Hal. Thanks in advance for the response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 16:06:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Require-Thread-permissions-in-audio-primary-hal/m-p/1186802#M165307</guid>
      <dc:creator>vinothkumars</dc:creator>
      <dc:date>2020-11-20T16:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Require Thread permissions in audio primary hal</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Require-Thread-permissions-in-audio-primary-hal/m-p/1187820#M165401</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I see the code for creating SCHED_FIFO thread in audio hal:&lt;/P&gt;
&lt;P&gt;//create rx task, use real time thread.&lt;BR /&gt;pthread_attr_init(&amp;amp;attr);&lt;BR /&gt;pthread_attr_setschedpolicy(&amp;amp;attr, SCHED_FIFO);&lt;BR /&gt;schParam.sched_priority = 3;&lt;BR /&gt;pthread_attr_setschedparam(&amp;amp;attr, &amp;amp;schParam);&lt;/P&gt;
&lt;P&gt;adev-&amp;gt;b_sco_rx_running = true;&lt;BR /&gt;ret = pthread_create(&amp;amp;tid_sco_rx, &amp;amp;attr, sco_rx_task, (void *)adev);&lt;BR /&gt;It should be fine to imitate this code&lt;/P&gt;
&lt;P&gt;In our android audio hal, 2 threads with SCHED_FIFO type will be also created.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;[note]&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;SCHED_FIFO implements a simple, first-in-first-out scheduling algorithm, it does not use time slices. &lt;BR /&gt;The SCHED_FIFO level process is scheduled before any SCHED_NORMAL level process. Once a SCHED_FIFO level process is in an executable state, it will continue to execute until it blocks itself or explicitly releases the processor; it is not based on time slices and can be executed forever. Only the higher priority SCHED_FIFO or SCHED_RR task can preempt the SCHED_FIFO task. If there are two or more SCHED_FIFO-level processes, they will execute in turn, but will give up again when they are willing to give up the processor. &lt;BR /&gt;As long as a SCHED_FIFO-level process is executing, other lower-level processes can only have a chance to execute after it ends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this information is helpful to you.&lt;/P&gt;
&lt;P&gt;Have a nice day!&lt;/P&gt;
&lt;P&gt;B.R,&lt;/P&gt;
&lt;P&gt;Weidong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="zh-CN" data-phrase-index="16"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 03:24:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Require-Thread-permissions-in-audio-primary-hal/m-p/1187820#M165401</guid>
      <dc:creator>weidong_sun</dc:creator>
      <dc:date>2020-11-24T03:24:23Z</dc:date>
    </item>
  </channel>
</rss>

