Skip to content

Reporting of min and max values of ring buffer size #10

@aholzinger

Description

@aholzinger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions