[alsa-devel] New to this list. Proposed patch to soc-utils.c
Hello,
I'm new to this list so please excuse my ignorance. I'm an anesthesiologist by profession so I might be a bit out of my depth here...
I was doing some experimentation with custom i2s codecs (FPGAs) using the snd-soc-dummy codec (defined in soc-utils.c). I found this codec to be needlessly restrictive with sample rates allowed (SNDRV_PCM_RATE_8000_192000). I needed to use more "exotic" sample rates so I came up with a patch.
I purpose using SNDRV_PCM_RATE_KNOT and setting some limits: .rate_min = 8000, .rate_max = 384000,
It's my understanding that SNDRV_PCM_RATE_CONTINIOUS is used for "known" rates and SNDRV_PCM_RATE_KNOT for more or less arbitrary rates?
I'm willing to submit my patch but might need some mentoring in the process. I don't think this simple patch could break anything..?
--Albin
To answer my own question; I realize now that SNDRV_PCM_RATE_CONTINUOUS is for anything between .rate_min & .rate_max. And _KNOT is for other specific rates perhaps outside this range. I feel this is not made very clear in documentation / comments.
I think SNDRV_PCM_RATE_CONTINUOUS would be more appropriate for snd-soc-dummy than SNDRV_PCM_RATE_8000_192000?
Or am I missing something..? Would this break anything?
--Albin
On Tue, Oct 24, 2017 at 12:42 PM, Albin Stigö albin.stigo@gmail.com wrote:
Hello,
I'm new to this list so please excuse my ignorance. I'm an anesthesiologist by profession so I might be a bit out of my depth here...
I was doing some experimentation with custom i2s codecs (FPGAs) using the snd-soc-dummy codec (defined in soc-utils.c). I found this codec to be needlessly restrictive with sample rates allowed (SNDRV_PCM_RATE_8000_192000). I needed to use more "exotic" sample rates so I came up with a patch.
I purpose using SNDRV_PCM_RATE_KNOT and setting some limits: .rate_min = 8000, .rate_max = 384000,
It's my understanding that SNDRV_PCM_RATE_CONTINIOUS is used for "known" rates and SNDRV_PCM_RATE_KNOT for more or less arbitrary rates?
I'm willing to submit my patch but might need some mentoring in the process. I don't think this simple patch could break anything..?
--Albin
participants (1)
-
Albin Stigö