alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* SoftVol in user space
@ 2018-09-20 15:24 Riccardo Casagrande
  0 siblings, 0 replies; only message in thread
From: Riccardo Casagrande @ 2018-09-20 15:24 UTC (permalink / raw)
  To: alsa-devel


Hello devs,


I have to add a volume control to my custom card (It has an i.MX6 chip and 3 FDA2100 from TI as audio chip) because the FDAs have no volume controller.


This below is the .asoundrc file I made. It works great if I manually made a speaker-test of one of devicefdaX sound card. Then I can see on alsamixer the volume control, but my need is to access and control softvol from user space. 



pcm.softvolfda0 {
         type softvol     
          slave {         
                  pcm "hw:0,0"     
         }                
         control {        
                  name "volume0"   
                  card 0           
                  device 0         
         }                
}                
                 
pcm.softvolfda1 {
         type softvol     
         slave {          
                  pcm "hw:0,1"     
         }                
         control {        
                  name "volume1"   
                  card 0           
                  device 1         
         }                
}                
                 
pcm.softvolfda2 {
         type softvol           
         slave {                
                  pcm "hw:0,2"           
         }                      
         control {              
                  name "volume2"         
                  card 0                 
                  device 2               
         }                      
}                      
                       
pcm.devicefda0 {       
         type plug              
         slave.pcm "softvolfda0"
}      



pcm.devicefda1 {       
         type plug              
         slave.pcm "softvolfda1"
}                      
                       
pcm.devicefda2 {       
         type plug              
         slave.pcm "softvolfda2"
}    





I saw that on alsalib there is this command 



int snd_pcm_softvol_open (snd_pcm_t **      pcmp,
        const char *      name,
        snd_pcm_format_t      sformat,
        int      ctl_card,
        snd_ctl_elem_id_t *      ctl_id,
        int      cchannels,
        double      min_dB,
        double      max_dB,
        int      resolution,
        snd_pcm_t *      slave,
        int      close_slave 
    ) 



but I can't find any example of usage.This is the log of the error:


mp && slave' failed.
Aborted


Any suggestion is welcome


Riccardo Casagrande




_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-20 15:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20 15:24 SoftVol in user space Riccardo Casagrande

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).