Skip to content
  • Martin Geier's avatar
    alsa-pcm: set threshold to final value before set_swparams is called · 5c8799a4
    Martin Geier authored and Wim Taymans's avatar Wim Taymans committed
    
    
    This patch fixes use case, when disable_tsched is set and
    api.alsa.period-size is set to value different from default quantum size.
    
    In a such configuration, threshold needs to be set to a final value
    before snd_pcm_sw_params_set_avail_min is called to get IRQs with
    right timing.
    
    Avail minimum is calculated from a threshold set in the check_position_config.
    The method returned different value for threshold right before playback
    started and after the playback started. Therefore threshold used in
    the snd_pcm_sw_params_set_avail_min was incorrect.
    
    Force the check_position_config to use configured values when called
    from spa_alsa_prepare as this method is called when starting new playback
    and the state->period_frames and the state->rate are already known.
    
    Signed-off-by: default avatarMartin Geier <martin.geier@streamunlimited.com>
    5c8799a4