<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Optimizing pd performances to fit an RPI 3]]></title><description><![CDATA[<p>Hello everyone, I'm currently working on somekind of &quot;fork&quot; of a patch I found(it's a groovebox patch coded by Martin Birkmann). It consume quite a lot of CPU, on my current Laptop equiped with an Intel® Core™ i3-6006U CPU, it ran up 50% on the first core. Since i want to be able to run it on a Raspberry Pi 3, running the patch at about 1 ghz on a single core is just not possible. Then I looked up how I could optimizes the use of the cpu, I tried to use some puredata command flag, tried to simplify and hide most of the GUI and even tried to split up the patch with subprocesses with pd~.</p>
<p>First flags, changes of priority, realtime ect... doesn't do anything for the use of CPU. Secondly hiding some GUI maybe help to grab 1% or 2% of CPU. Finaly, I had great hope that pd~ would allow to spread the CPU all across the proccessor allowing me to run it on the RPI 3, but no it's strange the mother patch of the subprocesses is running at 18-20% of CPU use(about 60% on a single core) consuming more than the initial patch that runs at 10-12% of CPU use. And when I'm running the pd subprocesses they also grasp a load of cpu use, They consume about as much as the mother patch, which is quite the opposite of what I wanted...</p>
<p>So is it normal that the use of pd~ just increases the need of CPU time for pd ? Is there another way to split the audio processing in different pd instances s the calculation is shared by different cores ? Is there some things I could improve in the audio processing section that could help lowering the use of CPU ?</p>
<p>Then I have another problem whenever I wanted to activate the dsp when I was on my RPI pure data craches. Is there someone here that knows why ? What command should I use to use the dsp without crash on a rpi ?</p>
<p>If you don't see any solution to my problem then you maybe can help me in an another way? Since my problem is mainly optimisation, if you have some recommandation to gave about some pure data open source groovebox patch that run well on low spec system  it would be great.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 08:09:02 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/12835.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 21 May 2020 16:16:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Thu, 21 May 2020 16:19:14 GMT]]></title><description><![CDATA[<p>Hello everyone, I'm currently working on somekind of &quot;fork&quot; of a patch I found(it's a groovebox patch coded by Martin Birkmann). It consume quite a lot of CPU, on my current Laptop equiped with an Intel® Core™ i3-6006U CPU, it ran up 50% on the first core. Since i want to be able to run it on a Raspberry Pi 3, running the patch at about 1 ghz on a single core is just not possible. Then I looked up how I could optimizes the use of the cpu, I tried to use some puredata command flag, tried to simplify and hide most of the GUI and even tried to split up the patch with subprocesses with pd~.</p>
<p>First flags, changes of priority, realtime ect... doesn't do anything for the use of CPU. Secondly hiding some GUI maybe help to grab 1% or 2% of CPU. Finaly, I had great hope that pd~ would allow to spread the CPU all across the proccessor allowing me to run it on the RPI 3, but no it's strange the mother patch of the subprocesses is running at 18-20% of CPU use(about 60% on a single core) consuming more than the initial patch that runs at 10-12% of CPU use. And when I'm running the pd subprocesses they also grasp a load of cpu use, They consume about as much as the mother patch, which is quite the opposite of what I wanted...</p>
<p>So is it normal that the use of pd~ just increases the need of CPU time for pd ? Is there another way to split the audio processing in different pd instances s the calculation is shared by different cores ? Is there some things I could improve in the audio processing section that could help lowering the use of CPU ?</p>
<p>Then I have another problem whenever I wanted to activate the dsp when I was on my RPI pure data craches. Is there someone here that knows why ? What command should I use to use the dsp without crash on a rpi ?</p>
<p>If you don't see any solution to my problem then you maybe can help me in an another way? Since my problem is mainly optimisation, if you have some recommandation to gave about some pure data open source groovebox patch that run well on low spec system  it would be great.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Thu, 21 May 2020 16:19:14 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Fri, 22 May 2020 18:12:47 GMT]]></title><description><![CDATA[<p>First off, remove any GUI objects (number atoms, sliders, bangs etc.). Replace all GUI bangs with the message &quot;bang&quot; or the object [bang]. If there are parts of the patch that don't operate all the time, it's a good idea to put a [switch~] in subpatches and turn their DSP on and off whenever possible.<br />
Replace all graphical arrays with the [array] object.<br />
About the crash when you turn on the DSP I have no idea. You could launch Pd via gdb to debug it, or launch it like this from the terminal:<br />
<code>pd -open /path/to/your/patch -stderr 2&gt;name_of_your_log_file.log</code><br />
And then read the .log file which will be in the same directory as your patch or the directory you launched Pd from, not sure which of the two.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/2</guid><dc:creator><![CDATA[alexandros]]></dc:creator><pubDate>Fri, 22 May 2020 18:12:47 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Fri, 22 May 2020 22:35:56 GMT]]></title><description><![CDATA[<p>Thank you, I've read that removing GUI object helps for good performance, so if you recomend it I will remove all GUI. Since it's a lot of change to apply to my patch, I just want to know how effective this methode is in terms of CPU usage optimization. Giving the patch performance(audio processed with 35% of CPU) could I get the patch running at 20% of CPU or even less ?</p>
<p>Then for the use of switch~ I don't know how I could implement that. The easier way would to place it to my FX section, but I don't know if spliting my FX subpatch in 8 or 9 would helps in term of efficiency. I noticed than I got better performance in my mother patch when I hosted only two subpatch instead of nine(like a gain of 5% of CPU).</p>
<p>For the DSP crash on the RPI it seems that I'm not the only one to have some issues with it. The problem is coming from Alsa, I've tried running the dsp on jack and it works, for this one problem solved.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/3</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Fri, 22 May 2020 22:35:56 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Sat, 23 May 2020 13:25:13 GMT]]></title><description><![CDATA[<p>Before to go into optimizations you should profile. You can use Xcode Instruments on macOS or perf tools for instance on GNU/Linux. Of course it implies to decipher Pure Data C calls, and it can be hard at first to grab what's going one, but IMHO it is the best way to do it (i.e. find bottlenecks and what worths the cost).</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/4</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 23 May 2020 13:25:13 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Sat, 23 May 2020 14:19:06 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/lysergik">@lysergik</a> said:</p>
<blockquote>
<p>Then for the use of switch~ I don't know how I could implement that.</p>
</blockquote>
<p><img src="/uploads/files/1590243545034-image.png" alt="image.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/5</guid><dc:creator><![CDATA[EEight]]></dc:creator><pubDate>Sat, 23 May 2020 14:19:06 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Sun, 24 May 2020 13:46:43 GMT]]></title><description><![CDATA[<p>@Nicolas Danet Thanks for the tip, I didn't knew about Perf on linux it's very handy. I ran a test on each patch/subpatch and got the following:<br />
<img src="/uploads/files/1590322234814-benchmark.jpg" alt="benchmark.jpg" class="img-responsive img-markdown" /></p>
<p>So  I will serach about -GI__printf_fp_l _IO-vfscanf vfprintf plus_pcrf8 and delay_tsc to see to what they match in PD. But if GI_printf and vfprintf are calls used by PD for the GUI object then <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/alexandros">@alexandros</a> was right and I will replace all GUI object by text ones.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/eeight">@EEight</a> My problem with switch~ is not that I don't know how to use its syntax but more because splitting each sound processing patch in my patch would divide it into at least 16 different subpatch(probably more). And as far as I experimented the pd~ object I have noticed that running 9 subpatches took more ressources than just running 3. Considering this I'm not sure that implementing switch~ to my patch will introduce a significant gain of processing power.  And it is the case it would be effecient if I only used few tracks out of the 8 track grroovebox that I'm working on, disable Fx ect.. and as soon I want to use the full capabilities of the patch it would crash because all the audio processing patch would run with the DSP and the CPU performances would rise again to what I got now.</p>
<p>Maybe I didn't explain it very clearly, so I will rapidly explain it again. My main problem here is that my intitial patch(we'll called it v1) uses 10-12% of CPU, and my motherpatch for different processes(let's call it v2) uses 18-20% + subpatch 1 running at 12-15% and subpatch 2 8-10%. So I got a v1 is runniingn 50% on one core and V2 and its subpatches is running at 30-40 with peak at 60% on four cores. Which is kind of the worst optimization of the history of computing ^^.  Though ginving the Perf result I have something to investigate to see where the problem come from. I'll give you update as soon as I found out what to do.</p>
<p>EDIT: I did a bit of search it seems that IO-getc, GI-printf, IO-vfscanf and vfprintf are all functions used to manages stram of data. I'm not sure but I'm sending the value from my GUI/input patch to my auddi processing patch via netsend, maybe the way I'm doing it is not optimal, maybe I should switch to osc~ because it's more effective to stream large numbers of value. Maybe I messed up  the way to through values into the subpatches(because if my netsending method is messy it does not explain why I see the same problematic function calls in the subpatches). It coould also be link to the GUI elements since data streaming could be used in in those. But it does not explain why there's the function call in my mother patch that isn't using any GUI elements. To get better result I will find directly in PD source code.</p>
<p>EDIT 2: I found vfprintf  in this PD source file &quot;pa_debugprint.c&quot; so it don't validate the few hypothesis I made before, but in my pd window I got repeated messages like &quot;output snd_pcm_delay failed: Unknown error 476 astate 3&quot; they could be the reason of this. Then I also found plus.perf8 here &quot;d_arithmetic.c&quot; it seems relied to operators (/ * = -) I use them to set value to my synth ect... so getting rid of them would be very difficult if not impossible.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/6</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Sun, 24 May 2020 13:46:43 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Mon, 25 May 2020 13:49:44 GMT]]></title><description><![CDATA[<p>It is a bit tricky to make the difference between what is called normally by Pd itself and what is called by objects in your patches. That's why a CPU counter at global level is not very useful. You need to get statistics locally specially in clocks execution and DSP tick. I could help you on macOS (Xcode Instruments are handy for that), but sadly on GNU/Linux i don't have a lot of experiences with the perf tools.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/7</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 25 May 2020 13:49:44 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Sun, 24 May 2020 17:13:12 GMT]]></title><description><![CDATA[<p>Well the result I've showed isn't from a global CPU counter(like htop), but it's the result I got by record event comming from the pure data process with perf(with a command like this perf record -p pid), even if there's recurent functions that are called by pd noramlly, they usally don&quot;t run with as much CPU use. I could run a test with a very simple patch to see if the same function calls appear first or not, then we would know if the function calls perf reported  are the one linking to the bottlneck.</p>
<p>Edit: I've just run a perf test with a patch looking like this [osc~ 440]-[dac~]. This what perf sends me:<br />
&quot;62,44%  pd       [kernel.kallsyms]   [k] delay_tsc                           ▒<br />
19,19%  pd       [kernel.kallsyms]   [k] pci_azx_readl    &quot;</p>
<p>We see now that only delay_tsc is noramlly called by pd but all the other function called I quoted before are link to my patch.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/8</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Sun, 24 May 2020 17:13:12 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Sun, 24 May 2020 16:15:02 GMT]]></title><description><![CDATA[<p>What i mean is that in Xcode you can track only the calls nested in an other call (e.g. dsp_tick) if you want. Thus you avoid the noise of function like select and other blocking stuff. I used perf once and i don't remember if it is possible with it. Take care to make several profiles to smooth the measures (sometimes it is purely random when CPU is well distributed).</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/9</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 24 May 2020 16:15:02 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Sun, 24 May 2020 18:21:50 GMT]]></title><description><![CDATA[<p>Sorry for my misunderstanding, I've look up to see If there were a way to see calls which are nested to other ones, and I found this (<a href="https://fr.slideshare.net/emBO_Conference/profiling-your-applications-using-the-linux-perf-tools" rel="nofollow">https://fr.slideshare.net/emBO_Conference/profiling-your-applications-using-the-linux-perf-tools</a>) on a slide there's a command to show what they call children calls. When I  launch it I can see all the calls linked to a call by pressing enter. All I need now is to find the interesting calls such as DSP ticking ect...</p>
<p>EDIT:<br />
Here's the childrencalls of the calls I've reported before:</p>
<pre><code>-   25,22%     6,90%  pd       libc-2.23.so        [.] vfprintf                                                                                                        
   - 18,32% vfprintf                                                                                                                                                   
      - 16,16% __GI___printf_fp_l                                                                                                                                      
           1,47% hack_digit                                                                                                                                            
           1,04% __mpn_mul_1                                                                                                                                           
           0,70% strlen                                                                                                                                                
        0,76% __strchrnul                                                                                                                                              
        0,65% _IO_file_xsputn@@GLIBC_2.2.5                                                                                                                             
   - 6,84% 0xffffffffffffffff                                                                                                                                          
      - 6,81% _start                                                                                                                                                   
           __libc_start_main                                                                                                                                           
           sys_run_scheduler                                                                                                                                           
           pd_extern_sched                                                                                                                                             
           __printf_chk                                                                                                                                                
           vfprintf                                                                                                                                                    
-   16,60%    12,52%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                              
   - 12,44% 0xffffffffffffffff                                                                                                                                         
        _start                                                                                                                                                         
        __libc_start_main                                                                                                                                              
        sys_run_scheduler                                                                                                                                              
        pd_extern_sched                                                                                                                                                
      - __printf_chk                                                                                                                                                   
         - 12,42% vfprintf                                                                                                                                             
              __GI___printf_fp_l                                                                                                                                       
   - 4,09% __GI___printf_fp_l                                                                                                                                          
        1,47% hack_digit                                                                                                                                               
        1,07% __mpn_mul_1                                                                                                                                              
        0,72% strlen     
-   25,22%     6,90%  pd       libc-2.23.so        [.] vfprintf                                                                                                        
   - 18,32% vfprintf                                                                                                                                                   
      - 16,16% __GI___printf_fp_l                                                                                                                                      
           1,47% hack_digit                                                                                                                                            
           1,04% __mpn_mul_1                                                                                                                                           
           0,70% strlen                                                                                                                                                
        0,76% __strchrnul                                                                                                                                              
        0,65% _IO_file_xsputn@@GLIBC_2.2.5                                                                                                                             
   - 6,84% 0xffffffffffffffff                                                                                                                                          
      - 6,81% _start                                                                                                                                                   
           __libc_start_main                                                                                                                                           
           sys_run_scheduler                                                                                                                                           
           pd_extern_sched                                                                                                                                             
           __printf_chk                                                                                                                                                
           vfprintf                                                                                                                                                    
-   16,60%    12,52%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                              
   - 12,44% 0xffffffffffffffff                                                                                                                                         
        _start                                                                                                                                                         
        __libc_start_main                                                                                                                                              
        sys_run_scheduler                                                                                                                                              
        pd_extern_sched                                                                                                                                                
      - __printf_chk                                                                                                                                                   
         - 12,42% vfprintf                                                                                                                                             
              __GI___printf_fp_l                                                                                                                                       
   - 4,09% __GI___printf_fp_l                                                                                                                                          
        1,47% hack_digit                                                                                                                                               
        1,07% __mpn_mul_1                                                                                                                                              
        0,72% strlen         
...

-   25,22%     6,90%  pd       libc-2.23.so        [.] vfprintf                                                                                                        
   - 18,32% vfprintf                                                                                                                                                   
      - 16,16% __GI___printf_fp_l                                                                                                                                      
           1,47% hack_digit                                                                                                                                            
           1,04% __mpn_mul_1                                                                                                                                           
           0,70% strlen                                                                                                                                                
        0,76% __strchrnul                                                                                                                                              
        0,65% _IO_file_xsputn@@GLIBC_2.2.5                                                                                                                             
   - 6,84% 0xffffffffffffffff                                                                                                                                          
      - 6,81% _start                                                                                                                                                   
           __libc_start_main                                                                                                                                           
           sys_run_scheduler                                                                                                                                           
           pd_extern_sched                                                                                                                                             
           __printf_chk                                                                                                                                                
           vfprintf                                                                                                                                                    
-   16,60%    12,52%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                              
   - 12,44% 0xffffffffffffffff                                                                                                                                         
        _start                                                                                                                                                         
        __libc_start_main                                                                                                                                              
        sys_run_scheduler                                                                                                                                              
        pd_extern_sched                                                                                                                                                
      + __printf_chk                                                                                                                                                   
   - 4,09% __GI___printf_fp_l                                                                                                                                          
        1,47% hack_digit                                                                                                                                               
        1,07% __mpn_mul_1                                                                                                                                              
        0,72% strlen   

</code></pre>
<p>Then I took a look to DSP-tick and sched-tick to see whats going there:</p>
<pre><code>-   66,16%     0,57%  pd       pd                  [.] dsp_tick                                                                                                        
   - 65,59% dsp_tick                                                                                                                                                   
      - 2,72% expr_perform                                                                                                                                             
         - 2,56% ex_eval                                                                                                                                               
              2,27% eval_func                                                                                                                                          
        2,47% scalartimes_perf8                                                                                                                                        
        2,25% plus_perf8                                                                                                                                               
        2,19% times_perf8                                                                                                                                              
        1,30% 0x8754e                                                                                                                                                  
        1,23% 0x87487                                                                                                                                                  
        1,10% 0x8753f                                                                                                                                                  
        1,08% 0x87491                                                                                                                                                  
        1,05% voutlet_perform                                                                                                                                          
        0,63% 0x87478                                                                                                                                                  
        0,63% 0x87531                                                                                                                                                  
        0,63% minus_perf8                                                                                                                                              
        0,61% 0x7e4ff                                                                                                                                                  
        0,61% 0x7aebd                                                                                                                                                  
        0,60% 0x7e5a5                                                                                                                                                  
        0,60% 0x7e4b0                                                                                                                                                  
        0,60% 0x8755d                                                                                                                                                  
        0,57% 0x7e54b                                                                                                                                                  
      + 0,55% 0x830d7                                                                                                                                                  
      + 0,55% 0x83018                                                                                                                                                  
      + 0,54% 0x8311d                                                                                                                                                  
      + 0,53% 0x8308d                                                                                                                                                  
        0,51% 0x8746a    

-   65,86%     0,03%  pd       pd                  [.] sched_tick                                                                                                      
     65,83% sched_tick                                                                                                                                                 
      - dsp_tick                                                                                                                                                       
         - 2,72% expr_perform                                                                                                                                          
            - 2,56% ex_eval                                                                                                                                            
                 2,27% eval_func                                                                                                                                       
           2,47% scalartimes_perf8                                                                                                                                     
           2,25% plus_perf8                                                                                                                                            
           2,19% times_perf8                                                                                                                                           
           1,30% 0x8754e                                                                                                                                               
           1,23% 0x87487                                                                                                                                               
           1,10% 0x8753f                                                                                                                                               
           1,08% 0x87491                                                                                                                                               
           1,05% voutlet_perform                                                                                                                                       
           0,63% 0x87478                                                                                                                                               
           0,63% 0x87531                                                                                                                                               
           0,63% minus_perf8                                                                                                                                           
           0,61% 0x7e4ff                                                                                                                                               
           0,61% 0x7aebd                                                                                                                                               
           0,60% 0x7e5a5                                                                                                                                               
           0,60% 0x7e4b0                                                                                                                                               
           0,60% 0x8755d                                                                                                                                               
           0,57% 0x7e54b                                                                                                                                               
         + 0,55% 0x830d7                                                                                                                                               
         + 0,55% 0x83018                                                                                                                                               
         + 0,54% 0x8311d                                                                                                                                               
         + 0,53% 0x8308d                                                                                                                                               
           0,51% 0x8746a 

</code></pre>
<p>I've displayed the result for the 3 process for what seems problematic and then for DSP et Sched tick only write the output of one process since it's similar on every process. So the problems seems to come from the process __GI___printf_fp_l   and vfprintf and not on other calls(which all seems to run fine. I tried to find vfprintf and  __GL___Printf_fp_l because I couldn't find them when running perf on the osc~ 440 patch, so it seems those calls depends of my pd object.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/10</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Sun, 24 May 2020 18:21:50 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Mon, 25 May 2020 13:47:29 GMT]]></title><description><![CDATA[<p>In Xcode Instruments there's a way to reverse the tree ; to find who (the parents) are calling the function you are checking. For instance in which functions the vprintf call is used so much.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/11</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/11</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 25 May 2020 13:47:29 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Mon, 25 May 2020 13:48:44 GMT]]></title><description><![CDATA[<p>After few investigations on my GNU/Linux computer it appears that to get the perf tools working fully the application need to be compiled with the <code>-fno-omit-frame-pointer</code> flag.</p>
<p>Then i profile with:</p>
<pre><code>perf record -g -F 99 -p $(PID)

perf report
perf report --dsos=pd
perf report --no-children
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/12</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/12</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 25 May 2020 13:48:44 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 00:00:41 GMT]]></title><description><![CDATA[<p>Hi I manage to get the perf tools source but don't know where I should put the -fno-omit-frame-pointer flag. All the tutrial I found show how to compile it with the makefile, so how do I put this gcc flag in the makefile ?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/13</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/13</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Tue, 26 May 2020 00:00:41 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 16:03:10 GMT]]></title><description><![CDATA[<p>This is Pure Data that needs to be compiled with <code>-fno-omit-frame-pointer</code> flag.</p>
<p>&lt; <a href="http://www.brendangregg.com/blog/2014-06-22/perf-cpu-sample.html" rel="nofollow">http://www.brendangregg.com/blog/2014-06-22/perf-cpu-sample.html</a> &gt;</p>
<blockquote>
<p>Incomplete stacks usually mean -fomit-frame-pointer was used – a compiler optimization that makes little positive difference in the real world, but breaks stack profilers. Always compile with -fno-omit-frame-pointer. More recent perf has a -g dwarf option, to use the alternate libunwind/dwarf method for retrieving stacks.</p>
</blockquote>
<p>And AFAIK Pure Data is compiled without &lt; <a href="https://github.com/pure-data/pure-data/blob/f22d621e5c595572179cdd2aa51eab032b964240/configure.ac#L36" rel="nofollow">https://github.com/pure-data/pure-data/blob/f22d621e5c595572179cdd2aa51eab032b964240/configure.ac#L36</a> &gt;.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/14</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/14</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 26 May 2020 16:03:10 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Sun, 07 Jun 2020 07:07:44 GMT]]></title><description><![CDATA[<p>Profiling is definitely not the simplest approach for optimization!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/15</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/15</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 07 Jun 2020 07:07:44 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 11:01:00 GMT]]></title><description><![CDATA[<p>i suppose you are using the 1st groovebox (groovebox1r4)? it uses filters based on fexpr~ which are very demanding, you could try to replace these wirh other filters (pole/zero based, or even vcf~). another problem is the large gui with many elements. you can try to avoid gui redraws as much as possible. or you could try to build something friendlier (cpu-wise) using my modular groovebox2.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/16</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/16</guid><dc:creator><![CDATA[mnb]]></dc:creator><pubDate>Tue, 26 May 2020 11:01:00 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 13:04:43 GMT]]></title><description><![CDATA[<p>What I did on my RPI 1 is using pd without gui (-nogui) and using mobmuplat to control my patch. Also I tried to remove all unused modules to give the best possible chance to pd (using nice could help too). Finally I use strictly alsa (not with jack). If latency is not important you can use an higher blocksize.</p>
<p>Cheers</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/17</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/17</guid><dc:creator><![CDATA[EEight]]></dc:creator><pubDate>Tue, 26 May 2020 13:04:43 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 18:08:57 GMT]]></title><description><![CDATA[<p>Hello everyone !  @Nicolas Danet First I've succesfully compiled pd with the flag, then I profiled my 3 patch/subpatches using the command you showed. So here what I got from this profiling (the report dsos=pd command doesn't gave me intersting result, so it's output is not showed here.)</p>
<p>Mother patch:</p>
<pre><code>report -&gt;

-   33,34%     8,01%  pd       libc-2.23.so        [.] vfprintf                                                                                                        
   - 25,33% vfprintf                                                                                                                                                   
        16,57% __GI___printf_fp_l                                                                                                                                      
        2,95% hack_digit                                                                                                                                               
      - 2,45% __GI___ioctl                                                                                                                                             
           entry_SYSCALL_64_fastpath                                                                                                                                   
           sys_ioctl                                                                                                                                                   
         + do_vfs_ioctl                                                                                                                                                
        1,29% __mpn_mul_1                                                                                                                                              
        0,70% strlen                                                                                                                                                   
   + 8,01% __fprintf_chk                                                                                                                                               
-   16,57%    16,18%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                              
     16,18% __fprintf_chk                                                                                                                                              
        vfprintf                                                                                                                                                       
        __GI___printf_fp_l                                                                                                                                             
-   13,69%    13,69%  pd       libc-2.23.so        [.] __GI_____strtof_l_internal                                                                                      
   - 12,53% 0x2f73250064702f6e                                                                                                                                         
        __isoc99_vsscanf                                                                                                                                               
        __GI_____strtof_l_internal                                                                                                                                     
   - 1,16% 0x7ffc9a2c60                                                                                                                                                
        __GI_____strtof_l_internal                                                                                                                                     
-   12,71%    12,51%  pd       libc-2.23.so        [.] _IO_vfscanf                                                                                                     
     12,51% 0x2f73250064702f6e                                                                                                                                         
        __isoc99_vsscanf                                                                                                                                               
        _IO_vfscanf               
-    5,49%     5,49%  pd       [kernel.kallsyms]   [k] delay_tsc                                                                                                       ◆
   - 1,94% 0x3a7e647000732520                                                                                                                                          
        vfprintf                                                                                                                                                       
        __GI___ioctl                                                                                                                                                   
        entry_SYSCALL_64_fastpath                                                                                                                                      
        sys_ioctl                                                                                                                                                      
        do_vfs_ioctl                                                                                                                                                   
        snd_pcm_capture_ioctl                                                                                                                                          
      + snd_pcm_capture_ioctl1                                                                                                                                         
   - 1,49% __GI___ioctl                                                                                                                                                
        entry_SYSCALL_64_fastpath                                                                                                                                      
        sys_ioctl                                                                                                                                                      
        do_vfs_ioctl                                                                                                                                                   
        snd_pcm_capture_ioctl                                                                                                                                          
      + snd_pcm_capture_ioctl1                                                                                                                                         
   - 1,34% 0x64c99                                                                                                                                                     
        __GI___ioctl                                                                                                                                                   
        entry_SYSCALL_64_fastpath                                                                                                                                      
        sys_ioctl                                                                                                                                                      
        do_vfs_ioctl                                                                                                                                                   
        snd_pcm_capture_ioctl                                                                                                                                          
      - snd_pcm_capture_ioctl1                                                                                                                                         
         - 0,80% snd_pcm_common_ioctl1                                                                                                                                 
              snd_pcm_status_user                                                                                                                                      
              snd_pcm_status                                                                                                                                           
              snd_pcm_update_hw_ptr                                                                                                                                    
              snd_pcm_update_hw_ptr0                                                                                                                                   
              azx_pcm_pointer                                                                                                                                          
              azx_get_position                                                                                                                                         
              azx_get_pos_skl                                                                                                                                          
              __const_udelay                                                                                                                                           
              delay_tsc                                                                                                                                                
         + 0,54% __snd_pcm_lib_xfer 

report no children -&gt;
                        
-   16,18%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                                        
     __GI___printf_fp_l                                                                                                                                                
     vfprintf                                                                                                                                                          
     __fprintf_chk                                                                                                                                                     
-   13,69%  pd       libc-2.23.so        [.] __GI_____strtof_l_internal                                                                                                
   - __GI_____strtof_l_internal                                                                                                                                        
      - 12,53% __isoc99_vsscanf                                                                                                                                        
           0x2f73250064702f6e                                                                                                                                          
        1,16% 0x7ffc9a2c60                                                                                                                                             
-   12,51%  pd       libc-2.23.so        [.] _IO_vfscanf                                                                                                               
     _IO_vfscanf                                                                                                                                                       
     __isoc99_vsscanf                                                                                                                                                  
     0x2f73250064702f6e                                                                                                                                                
-    8,01%  pd       libc-2.23.so        [.] vfprintf                                                                                                                  ◆
     vfprintf                                                                                                                                                          
     __fprintf_chk                                                                                                                                                     
-    5,49%  pd       [kernel.kallsyms]   [k] delay_tsc                                                                                                                 
     delay_tsc                                                                                                                                                         
     __const_udelay                                                                                                                                                   
     azx_get_pos_skl                                                                                                                                                   
     azx_get_position                                                                                                                                                  
     azx_pcm_pointer                                                                                                                                                   
   - snd_pcm_update_hw_ptr0                                                                                                                                            
      - 2,88% snd_pcm_update_hw_ptr                                                                                                                                    
         - 2,69% snd_pcm_status                                                                                                                                        
              snd_pcm_status_user                                                                                                                                      
              snd_pcm_common_ioctl1                                                                                                                                    
              snd_pcm_capture_ioctl1                                                                                                                                   
              snd_pcm_capture_ioctl                                                                                                                                    
              do_vfs_ioctl                                                                                                                                             
              sys_ioctl                                                                                                                                                
              entry_SYSCALL_64_fastpath                                                                                                                                
            + __GI___ioctl                                                                                                                                             
      + 2,60% __snd_pcm_lib_xfer 
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/18</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/18</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Tue, 26 May 2020 18:08:57 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 18:11:07 GMT]]></title><description><![CDATA[<p>First subpatch:</p>
<pre><code>report -&gt;

-   41,17%     9,23%  pd       [unknown]           [.] 0000000000000000                                                                                                
   - 37,73% 0                                                                                                                                                          
      - 17,87% __printf_chk                                                                                                                                            
         + 14,75% vfprintf                                                                                                                                             
           0,96% __printf_fp                                                                                                                                           
      - 5,36% 0                                                                                                                                                        
         - 0xda0580                                                                                                                                                    
         - 0                                                                                                                                                           
              0,73% garray_getarray                                                                                                                                    
              0,67% pd_findbyclass                                                                                                                                     
        3,81% __GI_____strtod_l_internal                                                                                                                               
        2,21% strlen                                                                                                                                                   
        1,77% binbuf_text                                                                                                                                              
        0,82% pd_extern_sched                                                                                                                                          
        0,82% atom_getfloat@plt                                                                                                                                        
        0,61% 0xba25daeb2f749a00                                                                                                                                       
        0,53% atom_getfloat                                                                                                                                            
   - 1,89% 0x300a300a300a300a                                                                                                                                          
        0                                                                                                                                                              
   - 0,73% 0x1bfca50                                                                                                                                                   
        0                                                                                                                                                              
        __printf_chk                                                                                                                                                   
-   18,60%     0,00%  pd       [unknown]           [.] 0x0000000001bfca50                                                                                              
     0x1bfca50                                                                                                                                                         
     0                                                                                                                                                                 
   - __printf_chk                                                                                                                                                      
      - 15,19% vfprintf                                                                                                                                                
           8,65% __GI___printf_fp_l                                                                                                                                    
           0,63% __mpn_mul_1                                                                                                                                           
        0,96% __printf_fp                   
-   15,19%     4,18%  pd       libc-2.23.so        [.] vfprintf                                                                                                        
   - 11,01% vfprintf                                                                                                                                                   
        8,65% __GI___printf_fp_l                                                                                                                                       
        0,63% __mpn_mul_1                                                                                                                                              
   - 4,18% 0x1bfca50                                                                                                                                                   
        0                                                                                                                                                              
        __printf_chk                                                                                                                                                   
        vfprintf                                                                                                                                                       
-   11,33%     0,00%  pd       [unknown]           [.] 0x300a300a300a300a                                                                                              
   - 0x300a300a300a300a                                                                                                                                                ◆
        6,71% _IO_getc                                                                                                                                                 
        1,89% 0                                                                                                                                                        
        1,44% pd_extern_sched                                                                                                                                          
      - 0,54% __GI___libc_read                                                                                                                                         
           entry_SYSCALL_64_fastpath                                                                                                                                   
           sys_read                                                                                                                                                    
           vfs_read                                                                                                                                                    
           __vfs_read                                                                                                                                                  
           new_sync_read                                                                                                                                               
-   10,54%    10,54%  pd       libc-2.23.so        [.] malloc_consolidate                                                                                              
     0xf1                                                                                                                                                              
     malloc_consolidate                                                                                                                                                
-   10,54%     0,00%  pd       [unknown]           [.] 0x00000000000000f1                                                                                              
     0xf1                                                                                                                                                              
     malloc_consolidate                                                                                                                                                
-    8,65%     8,65%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                              
     0x1bfca50                                                                                                                                                         
     0                                                                                                                                                                 
     __printf_chk                                                                                                                                                      
     vfprintf                                                                                                                                                          
     __GI___printf_fp_l                                                                                                                                                
-    6,71%     6,71%  pd       libc-2.23.so        [.] _IO_getc                                                                                                        
     0x300a300a300a300a                                                                                                                                                
     _IO_getc                                                                                                                                                          
-    5,24%     5,23%  pd       pd                  [.] plus_perf8                                                                                                      
     plus_perf8                                             

report no children -&gt;

-   41,17%     9,23%  pd       [.] 0000000000000000                                                                                                                    
   - 37,73% 0                                                                                                                                                          
      - 17,87% __printf_chk                                                                                                                                            
         - 14,75% vfprintf                                                                                                                                             
              8,65% __GI___printf_fp_l                                                                                                                                 
              0,63% __mpn_mul_1                                                                                                                                        
           0,96% __printf_fp                                                                                                                                           
      - 5,36% 0                                                                                                                                                        
         - 0xda0580                                                                                                                                                    
         + 0                                                                                                                                                           
        3,81% __GI_____strtod_l_internal                                                                                                                               
        2,21% strlen                                                                                                                                                   
        1,77% binbuf_text                                                                                                                                              
        0,82% pd_extern_sched                                                                                                                                          
        0,82% atom_getfloat@plt                                                                                                                                        
        0,61% 0xba25daeb2f749a00                                                                                                                                       
        0,53% atom_getfloat                                                                                                                                            
   - 1,89% 0x300a300a300a300a                                                                                                                                          
        0                                                                                                                                                              
   - 0,73% 0x1bfca50                                                                                                                                                   
        0                                                                                                                                                              
        __printf_chk                                                                                                                                                   
-   11,33%     0,00%  pd       [.] 0x300a300a300a300a                                                                                                                  
   - 0x300a300a300a300a                                                                                                                                                
        6,71% _IO_getc                                                                                                                                                 
        1,89% 0                                                                                                                                                        
        1,44% pd_extern_sched                                                                                                                                          
      - 0,54% __GI___libc_read                                                                                                                                         
           entry_SYSCALL_64_fastpath                                                                                                                                   
           sys_read                                                                                                                                                    
           vfs_read                                                                                                                                                    
           __vfs_read                                                                                                                                                  ◆
           new_sync_read  
-   10,54%  pd       libc-2.23.so        [.] malloc_consolidate                                                                                                        
     malloc_consolidate                                                                                                                                                
     0xf1                                                                                                                                                              
-    9,23%  pd       [unknown]           [.] 0000000000000000                                                                                                          
   - 0                                                                                                                                                                 
        3,70% 0                                                                                                                                                        
        1,89% 0x300a300a300a300a                                                                                                                                       ◆
-    8,65%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                                        
     __GI___printf_fp_l                                                                                                                                                
     vfprintf                                                                                                                                                          
     __printf_chk                                                                                                                                                      
     0                                                                                                                                                                 
     0x1bfca50                                                                                                                                                         
-    6,71%  pd       libc-2.23.so        [.] _IO_getc                                                                                                                  
     _IO_getc                                                                                                                                                          
     0x300a300a300a300a                                                                                                                                                
-    5,23%  pd       pd                  [.] plus_perf8                                                                                                                
     plus_perf8                                                                                                                                                        
-    4,18%  pd       libc-2.23.so        [.] vfprintf                                                                                                                  
     vfprintf                                                                                                                                                          
     __printf_chk                                                                                                                                                      
     0                                                                                                                                                                 
     0x1bfca50                               
</code></pre>
<p>Second subpatch:</p>
<pre><code>report -&gt;

-   10,54%  pd       libc-2.23.so        [.] malloc_consolidate                                                                                                        
     malloc_consolidate                                                                                                                                                
     0xf1                                                                                                                                                              
-    9,23%  pd       [unknown]           [.] 0000000000000000                                                                                                          
   - 0                                                                                                                                                                 
        3,70% 0                                                                                                                                                        
        1,89% 0x300a300a300a300a                                                                                                                                       
-    8,65%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                                        
     __GI___printf_fp_l                                                                                                                                                
     vfprintf                                                                                                                                                          
     __printf_chk                                                                                                                                                      
     0                                                                                                                                                                 
     0x1bfca50                                                                                                                                                         
-    6,71%  pd       libc-2.23.so        [.] _IO_getc                                                                                                                  
     _IO_getc                                                                                                                                                          
     0x300a300a300a300a                                                                                                                                                
-    5,23%  pd       pd                  [.] plus_perf8                                                                                                                
     plus_perf8                                                                                                                                                        
-    4,18%  pd       libc-2.23.so        [.] vfprintf                                                                                                                  
     vfprintf                                                                                                                                                          
     __printf_chk                                                                                                                                                      
     0                                                                                                                                                                 
     0x1bfca50                               

-    9,92%  pd       [unknown]           [.] 0000000000000000                                                                                                          
   - 0                                                                                                                                                                 ◆
      - 0,73% vfprintf                                                                                                                                                 
           __printf_chk                                                                                                                                                
           0                                                                                                                                                           
           0x1257040                                                                                                                                                   
-    9,69%  pd       libc-2.23.so        [.] __GI___printf_fp_l                                                                                                        
     __GI___printf_fp_l                                                                                                                                                
     vfprintf                                                                                                                                                          
     __printf_chk                                                                                                                                                      
     0                                                                                                                                                                 
     0x1257040                                                                                                                                                         
-    7,65%  pd       libc-2.23.so        [.] vfprintf                                                                                                                  
   - vfprintf                                                                                                                                                          
      - 7,55% __printf_chk                                                                                                                                             
           0                                                                                                                                                           
           0x1257040                                                                                                                                                   
-    5,29%  pd       pd                  [.] 0x000000000008748c                                                                                                        
     0x8748c                                                     
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/19</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/19</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Tue, 26 May 2020 18:11:07 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 18:17:42 GMT]]></title><description><![CDATA[<p>Well I do not see what is the main difference with the result I've shown before, maybe now we know that vfprintf function call is linked to printf_chk, that I didn't seen before while profiling. Also we got a malloc call and some dac call, so if you got any clue of what it could meant it would be great. Then I have to agree profiling isn't easy(it's my first time doing it ^^) but trying to fix the problem as such low level coudl be the best way to find a real fix to this bottleneck.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/mnb">@mnb</a> Hello ! First I thank you to have uploaded your patches, they're great ! Then to answer you, no I'm using the groovebox 2, the one you recommend. So the problem isn't from the filter object. But since you coded this patch you maybe could run it on your config and report here how much CPU power it takes on your side. By doing this we could identify if the problem is coming from the code or my hardware(I remember reading somewhere that embed intel GPU could have crappy result with pd, so with a bit of luck i could find somekind of driver fix to this issue).</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/eeight">@EEight</a> Well, when I'll get something running fine on my laptop I'll port it to the RPI and of course I'll use -nogui, even switch~ if it's possible. But on the two version of my ptach I got either 50% of my first core(whith a 2Ghz CPU) or on the v2 of the patch 4 cores running at peak over 50%. Considering that my Pi is using a Broadcom BCM2837, with  1,2 Ghz on four cores and that the frequency is lock by the system around 900 MGhz if I'm right, it's just impossible to run my patch now on the rpi. I thinked that in theory splitting the audio processing to spread the calculation over the processor I would get 1ghz of calculation devided in four and then I could reach 250-300 MHz on each cores, that could run very smoothly on a rpi. But because there is something bugging somewehre I've just multiply the audio processing ressources by FOUR ! And -no-gui(that I already use on my laptop) or other tip for optimization such as latency doesn't help the CPU on my laptop, so I don't even think of its efficency on a RPI. I also noticed that when I increased the latency of my pure data instances, CPU use goes up ! So it's not something I could use for optimization. And didn't find ways to run pd on alsa on my Pi the only way I could get it to run without crahsing when dsp is on is with jack.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/20</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/20</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Tue, 26 May 2020 18:17:42 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 20:39:00 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/lysergik">@lysergik</a> As I understand c++ &quot;everything&quot; goes through a *<em>print</em> call....... <a href="https://en.cppreference.com/w/c/io/vfprintf" rel="nofollow">https://en.cppreference.com/w/c/io/vfprintf</a><br />
They are the basic i/o for a running program.  If you text search Pd there is no executable that is not swimming in them for very obvious reasons.<br />
You should definitely look at the &quot;output snd_pcm_delay failed&quot; error.<br />
There have been posts (Google finds them) in the past suggesting that it is a RPI kernel problem with alsa and was fixed with a kernel update.<br />
It will be causing dropouts and very possibly your dsp crash.<br />
Any audio problem will cause Pd to struggle with control threads as well, as messages are held up, and will likely make greater demand on the cpu.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/21</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/21</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 26 May 2020 20:39:00 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Tue, 26 May 2020 21:20:00 GMT]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> thanks to give your outlook on this. My performance on groovebox 2 is similar to yours, a bit more CPU use but my CPU is a bit slower so nothing strange. My &quot;fork&quot; of this patch runs with similar specs. Then the error message I got is happening both to my rpi and laptop, so it would explain why I got messed up performances with pd~. I'll try to see if upgradung to new kernel in both OS helps or to find other way to get rid of this. If this solve my issue with pd~ it would be nice, I'll give you guys an update as soon as I have looked into that.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/22</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/22</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Tue, 26 May 2020 21:20:00 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Wed, 27 May 2020 05:25:55 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/lysergik">@lysergik</a> I ran a few tests, although they are a bit meaningless for your PI as I have an I7 2.3GHz.<br />
And so I deleted a bit of my last post.<br />
I suppose the GUI using 5% of an 8 core processor would translate to 60% or more on your Broadcom chip.<br />
The Pd process at around 3% ..... about 40% maybe.<br />
Simply minimising the GUI window removes nearly all of the GUI cpu usage as <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/eeight">@Eeight</a> suggests.<br />
If you can effectively split the audio equally over 2 cores with [pd~] you might be able to get down to 20-25% per core on the RPI.<br />
Is it possible in Linux to force the GUI...... the tcl/tk app..... to run on a set core..... core 1 GUI / core3 Pd / core4 [pd~] for example.<br />
The wish app and Pd communicate through ports anyway, so that will be possible if there is a way to permanently assign the executables to the cores.<br />
David</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/23</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/23</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Wed, 27 May 2020 05:25:55 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Wed, 27 May 2020 07:38:26 GMT]]></title><description><![CDATA[<p>Running groovebox2 on my T430 Core i5 i get roughly 35 % of CPU consumed.</p>
<p>I profiled and i get following results (at first look normals):</p>
<p><a href="/uploads/files/1590564627951-standard.txt">standard.txt</a><br />
<a href="/uploads/files/1590564643955-nochildren.txt">nochildren.txt</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/24</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/24</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 27 May 2020 07:38:26 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Wed, 27 May 2020 14:49:10 GMT]]></title><description><![CDATA[<p>Hi guys, so I manage to get rid of the &quot;output snd_pcm_delay failed&quot; error by running pd with Jack. It doesn't do anything for the CPU, still got my four cores running at 50%. I did some profiling on groovebox 2 and my first my frist version of the &quot;fork&quot; I was working on and I notcied that I didn't get any vfprintf calls, so the problem doesn't come from neither martin Birkmann patch or my first tweaks on it, but only from the implementation of pd~. Since the vfprintf isn't due to the alsa error message, it must be something else. It's not the synth of the patch or the mixer and fx that works well somewhere else. Then the only thing that are remains in this audio processing patch is the following : an object that permits me to get all the value that come from my GUI patch via netsend/netreceive and another object which take the value received via netsend to then them with a message to the pd~ object.</p>
<p>My netsend/netreceive object seems to have worked fine until now I didn't notice any CPU issues when using it. The other object maybe the source of the problem, thoough it's strange because the value that I send from the GUI are sent properly to the audio processing patch. So I'don't know what to do. Should I pack an archive of my code and put it here so you could have a better idea of whats going on ?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/25</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/25</guid><dc:creator><![CDATA[lysergik]]></dc:creator><pubDate>Wed, 27 May 2020 14:49:10 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Wed, 27 May 2020 20:18:39 GMT]]></title><description><![CDATA[<p>groovebox2 (the groovebox2b example) has a load of about 23 percent on my 3.2 ghz haswell i5 using integrated gfx. depending on the fx selected. i can load 6 instances of this patch before i get audio-dropouts (at about 95 percent cpu-load)</p>
<p>while there is probably not much that can be done regarding the gui (it is updated at 1/16 step rate), it should be possible to save cpu by replacing the bandlimited oscillators with simpler ones, and using less, or different fx.<br />
(the xy-one uses quite a lot cpu) and maybe using a simpler reverb. and of course using multithreading/pd~<br />
which would require a bit of work though...</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/26</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/26</guid><dc:creator><![CDATA[mnb]]></dc:creator><pubDate>Wed, 27 May 2020 20:18:39 GMT</pubDate></item><item><title><![CDATA[Reply to Optimizing pd performances to fit an RPI 3 on Fri, 29 May 2020 02:28:36 GMT]]></title><description><![CDATA[<p>@Nicolas-Danet hello, im a mostly non-programmer but I'm trying to teach myself pd and pd optimization currently. Could you please explain what this means and maybe whether this method might be approprachable by a non-programmer to use to track cpu issues/prototype things? I'm very curious/interested based on your answers/this comment, thanks!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/27</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12835/optimizing-pd-performances-to-fit-an-rpi-3/27</guid><dc:creator><![CDATA[yealace]]></dc:creator><pubDate>Fri, 29 May 2020 02:28:36 GMT</pubDate></item></channel></rss>