Re: Question about snd_pcm_sw_params_get_boundary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clemens Ladisch <cladisch <at> googlemail.com> writes:

> 
> Dolevo wrote:
> > Can you also tell me if it is normal to see the same number in the
> > threshold?
> 
> If you have set the threshold to this number, then it is normal to see
> this number.
> 
> > snd_pcm_sw_params_set_silence_threshold(handlePlayback, params, boundary);
> >
> > returns -22 (invalid argument) error with the boundary and threshold values
> > that I mentioned before.
> 
> The silence threshold must be less than the buffer size; other values
> would not make sense.
> 
> Why are you trying to set the silence threshold to the boundary value?
> 
> Regards,
> Clemens
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
> 

I have been assigned to a work which has already been developed for quite
some time. So, I really don't have much idea why it is being tried to set to
the boundary value.

Here is the simplified version of the whole code (for only setting the
software parameters). I am also trying to understand what it really does.

bool softwareParameters(void)
{
    snd_pcm_sw_params_malloc(&params);
    snd_pcm_sw_params_current(pHandle, params);
    snd_pcm_sw_params_set_avail_min(pHandle, params,period); 
    snd_pcm_sw_params_get_boundary(params, &boundary);    
    snd_pcm_sw_params_set_start_threshold(pHandle, params, 0.50 * buffSize);
    snd_pcm_sw_params_get_start_threshold(params, &th);    
    snd_pcm_sw_params_set_stop_threshold(pHandle, params, boundary);    
    snd_pcm_sw_params_get_stop_threshold(params, &th);    
    snd_pcm_sw_params_set_silence_size(pHandle, params, 0);    
    snd_pcm_sw_params_get_silence_size(params, &th);    
    snd_pcm_sw_params_set_silence_threshold(pHandle, params, boundary);
    snd_pcm_sw_params_get_silence_threshold(params, &th);    
    snd_pcm_sw_params (pHandle, params);    
    snd_pcm_sw_params_free(params);

    return (true);
}


I removed all the loggings and error controls to make it easier to read. 



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user




[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux