]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: extend doc for snd_pcm_hw_params_get_sbits()
authorJaroslav Kysela <perex@perex.cz>
Mon, 26 Feb 2024 13:52:02 +0000 (14:52 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 26 Feb 2024 13:54:02 +0000 (14:54 +0100)
Try to explain more the output value and its relation between
format and sample bits defined by the format.

Link: https://github.com/larsimmisch/pyalsaaudio/pull/146
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm.c

index bd1fecbf1643ce35b422231b110ac4c45e28c687..62e76e7e04c313f83d548ddbcc8c49d219f7fe6e 100644 (file)
@@ -3904,11 +3904,16 @@ int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
 /**
  * \brief Get sample resolution info from a configuration space
  * \param params Configuration space
- * \return signification bits in sample otherwise a negative error code if the info is not available
+ * \return sample resolution (in bits) otherwise a negative error code if the info is not available
  *
- * Significant bits are related to usable sample bits (width) not the
- * physical sample bits (width). For non-linear formats, this value may have
- * a special meaning which may be defined in future.
+ * For linear formats, this function returns sample resolution -
+ * used bits starting from the first usable significant bit defined by
+ * the format (e.g. bit 31 for S32_LE format or bit 23 for S24_LE format -
+ * starting from bit zero). Application may use full sample bit range defined
+ * by the format, but additional bits (outside this sample resolution) are
+ * stripped (not processed).
+ *
+ * For non-linear formats, this value may have a special meaning which may be defined in future.
  *
  * This function should only be called when the configuration space
  * contains a single configuration. Call #snd_pcm_hw_params to choose