Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Investigate allowing a period smaller than 64 for I2S cards #21

@gillspice

Description

@gillspice
  • It would be nice to be able to lower the period to at least 32 if not lower, so that we can try lower sample rates with lower periods to get equivalent latency to 96k p64 without as much data, this seems to be set in the ALSA driver.
    Here is the driver for the audio injector: https://github.com/raspberrypi/linux/blob/rpi-4.9.y/sound/soc/bcm/audioinjector-pi-soundcard.c
    Working backwards from that file, it seems like the min buffer size might be set in: snd_pcm_hw_params ?
    Starting from the beginning it looks like the min buffer size starts here:
    https://github.com/raspberrypi/linux/blob/rpi-4.9.y/include/sound/pcm.h
    line 54.
    I don't know how to connect the dots between the two, if that makes sense. If we can find a high level way to change that, ideally without rebuilding the kernel, it would be great.
    It seems like the min buffer size is not explicitly set in the specific soundcard driver for either Fe-pi or Audio Injector, that setting seems to be inherited from a lower level file, that gives me some hope that it is just a default and that they may be able to run with smaller periods if we can figure out how to lower the limit.

https://github.com/raspberrypi/linux/blob/rpi-4.19.y/include/uapi/sound/asound.h line 359 SNDRV_PCM_HW_PARAM_PERIOD_SIZE

Maybe this helps?: https://github.com/raspberrypi/linux/blob/e2d2941326922b63d722ebc46520c3a2287b675f/Documentation/sound/designs/tracepoints.rst

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