"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "alsaloop/pcmjob.c" between
alsa-utils-1.2.1.tar.bz2 and alsa-utils-1.2.2.tar.bz2

About: ALSA (Advanced Linux Sound Architecture) - Utilities.

pcmjob.c  (alsa-utils-1.2.1.tar.bz2):pcmjob.c  (alsa-utils-1.2.2.tar.bz2)
skipping to change at line 123 skipping to change at line 123
int err; int err;
unsigned int rrate; unsigned int rrate;
err = snd_pcm_hw_params_any(handle, params); err = snd_pcm_hw_params_any(handle, params);
if (err < 0) { if (err < 0) {
logit(LOG_CRIT, "Broken configuration for %s PCM: no configuratio ns available: %s\n", lhandle->id, snd_strerror(err)); logit(LOG_CRIT, "Broken configuration for %s PCM: no configuratio ns available: %s\n", lhandle->id, snd_strerror(err));
return err; return err;
} }
err = snd_pcm_hw_params_set_rate_resample(handle, params, lhandle->resamp le); err = snd_pcm_hw_params_set_rate_resample(handle, params, lhandle->resamp le);
if (err < 0) { if (err < 0) {
logit(LOG_CRIT, "Resample setup failed for %s (val %i): %s\n", lh andle->id, lhandle->resample, snd_strerror(err)); logit(LOG_CRIT, "Resample setup failed for %s (val %u): %s\n", lh andle->id, lhandle->resample, snd_strerror(err));
return err; return err;
} }
err = snd_pcm_hw_params_set_access(handle, params, lhandle->access); err = snd_pcm_hw_params_set_access(handle, params, lhandle->access);
if (err < 0) { if (err < 0) {
logit(LOG_CRIT, "Access type not available for %s: %s\n", lhandle ->id, snd_strerror(err)); logit(LOG_CRIT, "Access type not available for %s: %s\n", lhandle ->id, snd_strerror(err));
return err; return err;
} }
err = snd_pcm_hw_params_set_format(handle, params, lhandle->format); err = snd_pcm_hw_params_set_format(handle, params, lhandle->format);
if (err < 0) { if (err < 0) {
logit(LOG_CRIT, "Sample format not available for %s: %s\n", lhand le->id, snd_strerror(err)); logit(LOG_CRIT, "Sample format not available for %s: %s\n", lhand le->id, snd_strerror(err));
return err; return err;
} }
err = snd_pcm_hw_params_set_channels(handle, params, lhandle->channels); err = snd_pcm_hw_params_set_channels(handle, params, lhandle->channels);
if (err < 0) { if (err < 0) {
logit(LOG_CRIT, "Channels count (%i) not available for %s: %s\n", lhandle->channels, lhandle->id, snd_strerror(err)); logit(LOG_CRIT, "Channels count (%u) not available for %s: %s\n", lhandle->channels, lhandle->id, snd_strerror(err));
return err; return err;
} }
rrate = lhandle->rate_req; rrate = lhandle->rate_req;
err = snd_pcm_hw_params_set_rate_near(handle, params, &rrate, 0); err = snd_pcm_hw_params_set_rate_near(handle, params, &rrate, 0);
if (err < 0) { if (err < 0) {
logit(LOG_CRIT, "Rate %iHz not available for %s: %s\n", lhandle-> rate_req, lhandle->id, snd_strerror(err)); logit(LOG_CRIT, "Rate %uHz not available for %s: %s\n", lhandle-> rate_req, lhandle->id, snd_strerror(err));
return err; return err;
} }
rrate = 0; rrate = 0;
snd_pcm_hw_params_get_rate(params, &rrate, 0); snd_pcm_hw_params_get_rate(params, &rrate, 0);
lhandle->rate = rrate; lhandle->rate = rrate;
if ( if (
#ifdef USE_SAMPLERATE #ifdef USE_SAMPLERATE
!lhandle->loopback->src_enable && !lhandle->loopback->src_enable &&
#endif #endif
(int)rrate != lhandle->rate) { (int)rrate != lhandle->rate) {
logit(LOG_CRIT, "Rate does not match (requested %iHz, got %iHz, r esample %i)\n", lhandle->rate, rrate, lhandle->resample); logit(LOG_CRIT, "Rate does not match (requested %uHz, got %uHz, r esample %u)\n", lhandle->rate, rrate, lhandle->resample);
return -EINVAL; return -EINVAL;
} }
lhandle->pitch = (double)lhandle->rate_req / (double)lhandle->rate; lhandle->pitch = (double)lhandle->rate_req / (double)lhandle->rate;
return 0; return 0;
} }
static int setparams_bufsize(struct loopback_handle *lhandle, static int setparams_bufsize(struct loopback_handle *lhandle,
snd_pcm_hw_params_t *params, snd_pcm_hw_params_t *params,
snd_pcm_hw_params_t *tparams, snd_pcm_hw_params_t *tparams,
snd_pcm_uframes_t bufsize) snd_pcm_uframes_t bufsize)
skipping to change at line 1616 skipping to change at line 1616
count = get_whole_latency(loop) / loop->play->pitch; count = get_whole_latency(loop) / loop->play->pitch;
loop->play->buf_count = count; loop->play->buf_count = count;
if (loop->play->buf == loop->capt->buf) if (loop->play->buf == loop->capt->buf)
loop->capt->buf_pos = count; loop->capt->buf_pos = count;
err = writeit(loop->play); err = writeit(loop->play);
if (verbose > 4) if (verbose > 4)
snd_output_printf(loop->output, "%s: silence queued %i samples\n" , loop->id, err); snd_output_printf(loop->output, "%s: silence queued %i samples\n" , loop->id, err);
if (count > loop->play->buffer_size) if (count > loop->play->buffer_size)
count = loop->play->buffer_size; count = loop->play->buffer_size;
if (err != count) { if (err != count) {
logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%i)\n", l oop->id, err, (int)count, loop->play->buffer_size); logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%u)\n", l oop->id, err, (int)count, loop->play->buffer_size);
err = -EIO; err = -EIO;
goto __error; goto __error;
} }
loop->running = 1; loop->running = 1;
loop->stop_pending = 0; loop->stop_pending = 0;
if (loop->xrun) { if (loop->xrun) {
getcurtimestamp(&loop->xrun_last_update); getcurtimestamp(&loop->xrun_last_update);
loop->xrun_last_pdelay = XRUN_PROFILE_UNKNOWN; loop->xrun_last_pdelay = XRUN_PROFILE_UNKNOWN;
loop->xrun_last_cdelay = XRUN_PROFILE_UNKNOWN; loop->xrun_last_cdelay = XRUN_PROFILE_UNKNOWN;
loop->xrun_max_proctime = 0; loop->xrun_max_proctime = 0;
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)