Lines Matching +full:up +full:- +full:samples

2  *  PCM Interface - misc routines
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #define SND_PCM_FORMAT_UNKNOWN (-1)
37 signed char le; /* 0 = big-endian, 1 = little-endian, -1 = others */
38 signed char signd; /* 0 = unsigned, 1 = signed, -1 = others */
42 /* we do lots of calculations on snd_pcm_format_t; shut up sparse */
52 .width = 8, .phys = 8, .le = -1, .signd = 1,
56 .width = 8, .phys = 8, .le = -1, .signd = 0,
108 .width = 32, .phys = 32, .le = 1, .signd = -1,
112 .width = 32, .phys = 32, .le = 0, .signd = -1,
116 .width = 64, .phys = 64, .le = 1, .signd = -1,
120 .width = 64, .phys = 64, .le = 0, .signd = -1,
124 .width = 32, .phys = 32, .le = 1, .signd = -1,
128 .width = 32, .phys = 32, .le = 0, .signd = -1,
132 .width = 8, .phys = 8, .le = -1, .signd = -1,
136 .width = 8, .phys = 8, .le = -1, .signd = -1,
140 .width = 4, .phys = 4, .le = -1, .signd = -1,
144 .width = 3, .phys = 3, .le = -1, .signd = -1,
148 .width = 5, .phys = 5, .le = -1, .signd = -1,
173 .le = -1, .signd = -1,
176 .le = -1, .signd = -1,
196 .le = -1, .signd = -1,
247 .width = 3, .phys = 8, .le = -1, .signd = -1,
251 .width = 5, .phys = 8, .le = -1, .signd = -1,
258 * snd_pcm_format_signed - Check the PCM format is signed linear
262 * linear, and a negative error code for non-linear formats.
268 return -EINVAL; in snd_pcm_format_signed()
270 return -EINVAL; in snd_pcm_format_signed()
276 * snd_pcm_format_unsigned - Check the PCM format is unsigned linear
280 * linear, and a negative error code for non-linear formats.
294 * snd_pcm_format_linear - Check the PCM format is linear
306 * snd_pcm_format_little_endian - Check the PCM format is little-endian
309 * Return: 1 if the given PCM format is little-endian, 0 if
310 * big-endian, or a negative error code if endian not specified.
316 return -EINVAL; in snd_pcm_format_little_endian()
318 return -EINVAL; in snd_pcm_format_little_endian()
324 * snd_pcm_format_big_endian - Check the PCM format is big-endian
327 * Return: 1 if the given PCM format is big-endian, 0 if
328 * little-endian, or a negative error code if endian not specified.
342 * snd_pcm_format_width - return the bit-width of the format
345 * Return: The bit-width of the format, or a negative error code
352 return -EINVAL; in snd_pcm_format_width()
354 return -EINVAL; in snd_pcm_format_width()
360 * snd_pcm_format_physical_width - return the physical bit-width of the format
363 * Return: The physical bit-width of the format, or a negative error code
370 return -EINVAL; in snd_pcm_format_physical_width()
372 return -EINVAL; in snd_pcm_format_physical_width()
378 * snd_pcm_format_size - return the byte size of samples on the given format
380 * @samples: sampling rate
382 * Return: The byte size of the given samples for the format, or a
385 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples) in snd_pcm_format_size() argument
389 return -EINVAL; in snd_pcm_format_size()
390 return samples * phys_width / 8; in snd_pcm_format_size()
395 * snd_pcm_format_silence_64 - return the silent data in 8 bytes array
411 * snd_pcm_format_set_silence - set the silence data on the buffer
414 * @samples: the number of samples to set silence
416 * Sets the silence data on the buffer for the given samples.
420 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int samples) in snd_pcm_format_set_silence() argument
427 return -EINVAL; in snd_pcm_format_set_silence()
428 if (samples == 0) in snd_pcm_format_set_silence()
433 return -EINVAL; in snd_pcm_format_set_silence()
436 unsigned int bytes = samples * width / 8; in snd_pcm_format_set_silence()
440 /* non-zero samples, fill using a loop */ in snd_pcm_format_set_silence()
444 while (samples--) { in snd_pcm_format_set_silence()
452 while (samples--) { in snd_pcm_format_set_silence()
458 while (samples--) { in snd_pcm_format_set_silence()
464 while (samples--) { in snd_pcm_format_set_silence()
470 while (samples--) { in snd_pcm_format_set_silence()
482 * snd_pcm_hw_limit_rates - determine rate_min/rate_max fields
494 if (hw->rates & (1 << i)) { in snd_pcm_hw_limit_rates()
495 hw->rate_min = snd_pcm_known_rates.list[i]; in snd_pcm_hw_limit_rates()
499 for (i = (int)snd_pcm_known_rates.count - 1; i >= 0; i--) { in snd_pcm_hw_limit_rates()
500 if (hw->rates & (1 << i)) { in snd_pcm_hw_limit_rates()
501 hw->rate_max = snd_pcm_known_rates.list[i]; in snd_pcm_hw_limit_rates()
510 * snd_pcm_rate_to_rate_bit - converts sample rate to SNDRV_PCM_RATE_xxx bit
528 * snd_pcm_rate_bit_to_rate - converts SNDRV_PCM_RATE_xxx bit to sample rate
555 * snd_pcm_rate_mask_intersect - computes the intersection between two rate masks
585 * snd_pcm_rate_range_to_bits - converts rate range to SNDRV_PCM_RATE_xxx bit
590 * only the pre-defined rates like 44100 or 16000.