double res;
signed short *samples[channels];
int steps[channels];
- int chn, ires;
+ unsigned int chn;
+ int ires;
/* verify and prepare the contents of areas */
for (chn = 0; chn < channels; chn++) {
ufds = malloc(sizeof(struct pollfd) * count);
if (ufds == NULL) {
printf("No enough memory\n");
- return err;;
+ return -ENOMEM;
}
if ((err = snd_pcm_poll_descriptors(handle, ufds, count)) < 0) {
printf("Unable to obtain poll descriptors for playback: %s\n", snd_strerror(err));
}
generate_sine(my_areas, offset, frames, &data->phase);
commitres = snd_pcm_mmap_commit(handle, offset, frames);
- if (commitres < 0 || commitres != frames) {
+ if (commitres < 0 || (snd_pcm_uframes_t)commitres != frames) {
if ((err = xrun_recovery(handle, commitres >= 0 ? -EPIPE : commitres)) < 0) {
printf("MMAP commit error: %s\n", snd_strerror(err));
exit(EXIT_FAILURE);
}
generate_sine(my_areas, offset, frames, &data.phase);
commitres = snd_pcm_mmap_commit(handle, offset, frames);
- if (commitres < 0 || commitres != frames) {
+ if (commitres < 0 || (snd_pcm_uframes_t)commitres != frames) {
if ((err = xrun_recovery(handle, commitres >= 0 ? -EPIPE : commitres)) < 0) {
printf("MMAP commit error: %s\n", snd_strerror(err));
exit(EXIT_FAILURE);
}
generate_sine(my_areas, offset, frames, &phase);
commitres = snd_pcm_mmap_commit(handle, offset, frames);
- if (commitres < 0 || commitres != frames) {
+ if (commitres < 0 || (snd_pcm_uframes_t)commitres != frames) {
if ((err = xrun_recovery(handle, commitres >= 0 ? -EPIPE : commitres)) < 0) {
printf("MMAP commit error: %s\n", snd_strerror(err));
exit(EXIT_FAILURE);
snd_pcm_sw_params_t *swparams;
int method = 0;
signed short *samples;
- int chn;
+ unsigned int chn;
snd_pcm_channel_area_t *areas;
snd_pcm_hw_params_alloca(&hwparams);