• lysergik

    Hi guys, so I manage to get rid of the "output snd_pcm_delay failed" 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 "fork" 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.

    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 ?

    posted in technical issues read more
  • lysergik

    Hi @whale-av 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 "fork" 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.

    posted in technical issues read more
  • lysergik

    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.

    @mnb 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).

    @EEight 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.

    posted in technical issues read more
  • lysergik

    First subpatch:

    report ->
    
    -   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 ->
    
    -   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                               
    

    Second subpatch:

    report ->
    
    -   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                                                     
    

    posted in technical issues read more
  • lysergik

    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.)

    Mother patch:

    report ->
    
    -   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 ->
                            
    -   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 
    

    posted in technical issues read more
  • lysergik

    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 ?

    posted in technical issues read more
  • lysergik

    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 (https://fr.slideshare.net/emBO_Conference/profiling-your-applications-using-the-linux-perf-tools) 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...

    EDIT:
    Here's the childrencalls of the calls I've reported before:

    -   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   
    
    

    Then I took a look to DSP-tick and sched-tick to see whats going there:

    -   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 
    
    

    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.

    posted in technical issues read more
  • lysergik

    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"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.

    Edit: I've just run a perf test with a patch looking like this [osc~ 440]-[dac~]. This what perf sends me:
    "62,44% pd [kernel.kallsyms] [k] delay_tsc ▒
    19,19% pd [kernel.kallsyms] [k] pci_azx_readl "

    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.

    posted in technical issues read more
  • lysergik

    @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:
    benchmark.jpg

    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 @alexandros was right and I will replace all GUI object by text ones.

    @EEight 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.

    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.

    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.

    EDIT 2: I found vfprintf in this PD source file "pa_debugprint.c" so it don't validate the few hypothesis I made before, but in my pd window I got repeated messages like "output snd_pcm_delay failed: Unknown error 476 astate 3" they could be the reason of this. Then I also found plus.perf8 here "d_arithmetic.c" 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.

    posted in technical issues read more
  • lysergik

    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 ?

    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).

    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.

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!