diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2024-03-15 16:30:04 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2024-03-30 23:28:13 +0100 |
commit | b613123291dc0eb667956bce5fc3f1d826ce2c1e (patch) | |
tree | 8007ae047b38b991cc875c51b27ebacff4c2f119 /src/radio/radio.c | |
parent | ce58b765f5403f95fe23c23894102b6c7bdfa67d (diff) |
Open sound device for capture or playback only, if full duplex is not required
Diffstat (limited to 'src/radio/radio.c')
-rw-r--r-- | src/radio/radio.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/radio/radio.c b/src/radio/radio.c index 5e59432..dcc0b4d 100644 --- a/src/radio/radio.c +++ b/src/radio/radio.c @@ -100,7 +100,7 @@ int radio_init(radio_t *radio, int buffer_size, int samplerate, double frequency /* open audio device */ radio->tx_audio_samplerate = 48000; radio->tx_audio_channels = (stereo) ? 2 : 1; - radio->tx_sound = sound_open(tx_audiodev, NULL, NULL, NULL, radio->tx_audio_channels, 0.0, radio->tx_audio_samplerate, radio->buffer_size, 1.0, 1.0, 0.0, 2.0); + radio->tx_sound = sound_open(SOUND_DIR_PLAY, tx_audiodev, NULL, NULL, NULL, radio->tx_audio_channels, 0.0, radio->tx_audio_samplerate, radio->buffer_size, 1.0, 1.0, 0.0, 2.0); if (!radio->tx_sound) { rc = -EIO; LOGP(DRADIO, LOGL_ERROR, "Failed to open sound device!\n"); @@ -164,10 +164,7 @@ int radio_init(radio_t *radio, int buffer_size, int samplerate, double frequency radio->rx_audio_samplerate = 48000; radio->rx_audio_channels = (stereo) ? 2 : 1; /* check if we use same device */ - if (radio->tx_sound && !strcmp(tx_audiodev, rx_audiodev)) - radio->rx_sound = radio->tx_sound; - else - radio->rx_sound = sound_open(rx_audiodev, NULL, NULL, NULL, radio->rx_audio_channels, 0.0, radio->rx_audio_samplerate, radio->buffer_size, 1.0, 1.0, 0.0, 2.0); + radio->rx_sound = sound_open(SOUND_DIR_REC, rx_audiodev, NULL, NULL, NULL, radio->rx_audio_channels, 0.0, radio->rx_audio_samplerate, radio->buffer_size, 1.0, 1.0, 0.0, 2.0); if (!radio->rx_sound) { rc = -EIO; LOGP(DRADIO, LOGL_ERROR, "Failed to open sound device!\n"); |