Browse Source

Merge a021d3a168 into 9ba44b14b8

pull/4/merge
Tele42 GitHub 6 years ago
parent
commit
bc3f6190f3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions
  1. +5
    -5
      alsa_in.c
  2. +6
    -6
      alsa_out.c

+ 5
- 5
alsa_in.c View File

@@ -176,7 +176,7 @@ static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, snd_pcm_
return err;
}
if (rchannels != channels) {
printf("WARNING: chennel count does not match (requested %d got %d)\n", channels, rchannels);
printf("WARNING: channels count does not match (requested %d got %d)\n", channels, rchannels);
num_channels = rchannels;
}
/* set the stream rate */
@@ -247,7 +247,7 @@ static int set_swparams(snd_pcm_t *handle, snd_pcm_sw_params_t *swparams, int pe
}
err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, -1 );
if (err < 0) {
printf("Unable to set start threshold mode for capture: %s\n", snd_strerror(err));
printf("Unable to set stop threshold mode for capture: %s\n", snd_strerror(err));
return err;
}
/* allow the transfer when at least period_size samples can be processed */
@@ -391,7 +391,7 @@ int process (jack_nframes_t nframes, void *arg) {
offset_array[(offset_differential_index++)% smooth_size ] = offset;

// Build the mean of the windowed offset array
// basically fir lowpassing.
// basically for lowpassing.
double smooth_offset = 0.0;
for( i=0; i<smooth_size; i++ )
smooth_offset +=
@@ -416,7 +416,7 @@ int process (jack_nframes_t nframes, void *arg) {
// now quantize this value around resample_mean, so that the noise which is in the integral component doesnt hurt.
current_resample_factor = floor( (current_resample_factor - resample_mean) * controlquant + 0.5 ) / controlquant + resample_mean;

// Output "instrumentatio" gonna change that to real instrumentation in a few.
// Output "instrumentation" gonna change that to real instrumentation in a few.
output_resampling_factor = (float) current_resample_factor;
output_diff = (float) smooth_offset;
output_integral = (float) offset_integral;
@@ -426,7 +426,7 @@ int process (jack_nframes_t nframes, void *arg) {
if( current_resample_factor < resample_lower_limit ) current_resample_factor = resample_lower_limit;
if( current_resample_factor > resample_upper_limit ) current_resample_factor = resample_upper_limit;

// Now Calculate how many samples we need.
// Now calculate how many samples we need.
rlen = ceil( ((double)nframes) / current_resample_factor )+2;
assert( rlen > 2 );



+ 6
- 6
alsa_out.c View File

@@ -175,7 +175,7 @@ static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, snd_pcm_
return err;
}
if (rchannels != channels) {
printf("WARNING: chennel count does not match (requested %d got %d)\n", channels, rchannels);
printf("WARNING: channel count does not match (requested %d got %d)\n", channels, rchannels);
num_channels = rchannels;
}
/* set the stream rate */
@@ -246,7 +246,7 @@ static int set_swparams(snd_pcm_t *handle, snd_pcm_sw_params_t *swparams, int pe
}
err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, -1 );
if (err < 0) {
printf("Unable to set start threshold mode for capture: %s\n", snd_strerror(err));
printf("Unable to set stop threshold mode for capture: %s\n", snd_strerror(err));
return err;
}
/* allow the transfer when at least period_size samples can be processed */
@@ -371,7 +371,7 @@ int process (jack_nframes_t nframes, void *arg) {
offset_array[(offset_differential_index++)% smooth_size ] = offset;

// Build the mean of the windowed offset array
// basically fir lowpassing.
// basically for lowpassing.
double smooth_offset = 0.0;
for( i=0; i<smooth_size; i++ )
smooth_offset +=
@@ -383,7 +383,7 @@ int process (jack_nframes_t nframes, void *arg) {

// Clamp offset.
// the smooth offset still contains unwanted noise
// which would go straigth onto the resample coeff.
// which would go straight onto the resample coeff.
// it only used in the P component and the I component is used for the fine tuning anyways.
if( fabs( smooth_offset ) < pclamp )
smooth_offset = 0.0;
@@ -396,7 +396,7 @@ int process (jack_nframes_t nframes, void *arg) {
// now quantize this value around resample_mean, so that the noise which is in the integral component doesnt hurt.
current_resample_factor = floor( (current_resample_factor - resample_mean) * controlquant + 0.5 ) / controlquant + resample_mean;

// Output "instrumentatio" gonna change that to real instrumentation in a few.
// Output "instrumentation" gonna change that to real instrumentation in a few.
output_resampling_factor = (float) current_resample_factor;
output_diff = (float) smooth_offset;
output_integral = (float) offset_integral;
@@ -406,7 +406,7 @@ int process (jack_nframes_t nframes, void *arg) {
if( current_resample_factor < resample_lower_limit ) current_resample_factor = resample_lower_limit;
if( current_resample_factor > resample_upper_limit ) current_resample_factor = resample_upper_limit;

// Now Calculate how many samples we need.
// Now calculate how many samples we need.
rlen = ceil( ((double)nframes) * current_resample_factor )+2;
assert( rlen > 2 );



Loading…
Cancel
Save