-
Notifications
You must be signed in to change notification settings - Fork 13
Description
In function static int snd_madifx_playback_open(struct snd_pcm_substream *substream) you set min max constraints for the period size, but for the buffer size you do set only the single constraint:
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
32, 4096);
snd_pcm_hw_constraint_single(runtime,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
8192);This makes the user mode calls snd_pcm_hw_params_get_period_size_max report 4096, snd_pcm_hw_params_get_period_size_min report 32, snd_pcm_hw_params_get_buffer_size_max report 8192, which is all correct, but it makes snd_pcm_hw_params_get_buffer_size_min also report 8192 which is not correct.
I guess that this would be the better solution:
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
64, 8192);This is not a show stopper, because even if the min buffer size is reported to be 8192, one can still set a smaller one and all works. It's more for coherency sake.
I tried this with the driver, but my observation (using our own software) is that something with the buffer management gets completely screwed up and so I had to revert to the original code. The reporting of the min and max values for the ring buffer size was correct though.