diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2021-09-18 11:43:01 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2021-10-24 06:25:10 +0200 |
commit | 6fa74a12969f942b059693721aec2505772b2dcf (patch) | |
tree | df66a46dc0177d066fcf0202769dae14bf468e26 /src/libsound | |
parent | de685b3cb6f9397818c7f774eddbd802db5dde7a (diff) |
Refactor global variables for signal processing
These are:
device, sample rate, buffer, latency
Called now:
dsp_device, dsp_samplerate, dsp_buffer, dsp_latency
Call audio device:
call_device, call_samplerate, call_buffer
Diffstat (limited to 'src/libsound')
-rw-r--r-- | src/libsound/sound.h | 4 | ||||
-rw-r--r-- | src/libsound/sound_alsa.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libsound/sound.h b/src/libsound/sound.h index 6440a3c..173dfd3 100644 --- a/src/libsound/sound.h +++ b/src/libsound/sound.h @@ -1,10 +1,10 @@ enum paging_signal; -void *sound_open(const char *audiodev, double *tx_frequency, double *rx_frequency, int *am, int channels, double paging_frequency, int samplerate, int latspl, double max_deviation, double max_modulation, double modulation_index); +void *sound_open(const char *audiodev, double *tx_frequency, double *rx_frequency, int *am, int channels, double paging_frequency, int samplerate, int buffer_size, double interval, double max_deviation, double max_modulation, double modulation_index); int sound_start(void *inst); void sound_close(void *inst); int sound_write(void *inst, sample_t **samples, uint8_t **power, int num, enum paging_signal *paging_signal, int *on, int channels); int sound_read(void *inst, sample_t **samples, int num, int channels, double *rf_level_db); -int sound_get_tosend(void *inst, int latspl); +int sound_get_tosend(void *inst, int buffer_size); diff --git a/src/libsound/sound_alsa.c b/src/libsound/sound_alsa.c index 6216b73..20a4a31 100644 --- a/src/libsound/sound_alsa.c +++ b/src/libsound/sound_alsa.c @@ -187,7 +187,7 @@ static void dev_close(sound_t *sound) snd_pcm_close(sound->chandle); } -void *sound_open(const char *audiodev, double __attribute__((unused)) *tx_frequency, double __attribute__((unused)) *rx_frequency, int __attribute__((unused)) *am, int channels, double __attribute__((unused)) paging_frequency, int samplerate, int __attribute((unused)) latspl, double max_deviation, double __attribute__((unused)) max_modulation, double __attribute__((unused)) modulation_index) +void *sound_open(const char *audiodev, double __attribute__((unused)) *tx_frequency, double __attribute__((unused)) *rx_frequency, int __attribute__((unused)) *am, int channels, double __attribute__((unused)) paging_frequency, int samplerate, int __attribute((unused)) buffer_size, double __attribute__((unused)) interval, double max_deviation, double __attribute__((unused)) max_modulation, double __attribute__((unused)) modulation_index) { sound_t *sound; int rc; @@ -487,7 +487,7 @@ int sound_read(void *inst, sample_t **samples, int num, int channels, double __a * get playback buffer space * * return number of samples to be sent */ -int sound_get_tosend(void *inst, int latspl) +int sound_get_tosend(void *inst, int buffer_size) { sound_t *sound = (sound_t *)inst; int rc; @@ -497,7 +497,7 @@ int sound_get_tosend(void *inst, int latspl) rc = snd_pcm_delay(sound->phandle, &delay); if (rc < 0) { if (rc == -32) - PDEBUG(DSOUND, DEBUG_ERROR, "Buffer underrun: Please use higher latency and enable real time scheduling\n"); + PDEBUG(DSOUND, DEBUG_ERROR, "Buffer underrun: Please use higher buffer and enable real time scheduling\n"); else PDEBUG(DSOUND, DEBUG_ERROR, "failed to get delay from interface (%s)\n", snd_strerror(rc)); if (rc == -EPIPE) { @@ -511,7 +511,7 @@ int sound_get_tosend(void *inst, int latspl) return rc; } - tosend = latspl - delay; + tosend = buffer_size - delay; return tosend; } |