f4exb / sdrangel

SDR Rx/Tx software for Airspy, Airspy HF+, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay and FunCube
GNU General Public License v3.0
2.77k stars 424 forks source link

Audio output by demodulator #145

Closed f4exb closed 6 years ago

f4exb commented 6 years ago

This issue is opened to handle the setting of audio output by demodulator individually. The UDP and RTP output should also be handled this way as a particular case of audio output.

texasyojimbo commented 6 years ago

Hypothetically, would it be possible to "stack" two demodulators on the same frequency with different modes? For example an NFM demodulator and a DSD demodulator on the same freq of a Yaesu System Fusion repeater output?

Also can the same output be assigned to different demodulators, or would each one have to be unique? For example, in the case of a SystemFusion repeater, can both analog (from NFM demod) and digital (from DSD demod) audio go to the same soundcard/speaker/UDP port?

P.S. Not sure DSD supports Yaesu System Fusion because of Yaesu weirdness, I am just throwing this out as a possible use-case of stacked demodulators.

f4exb commented 6 years ago

Your first question is unrelated to the subject: yes you can stack two demodulators on the same frequency and that's independent of any audio consideration. Each demod being independent with its own frequency shift you can put them anywhere including stacking them on the same frequency.

At present the audio output of all demodulators are mixed on the same audio sink (the only one that you select in the audio options) so the scenario you are planning works. The purpose of this ticket is to give the ability to route the audio of a demodulator to a particular audio sink where it will be possibly mixed with the output of demodulators using the same sink.

For DSD and YSF it works except for the wide mode that indeed introduces some weirdness that even defeats the genuine AMBE hardware decoder.

f4exb commented 6 years ago

Note that with pulseaudio it is possible to create a null sink and associate it to a RTP sink also provided by pulseaudio. This makes a nice alternative to the present RTP sink that works only marginally (no FM stereo, no DSD). This would also allow to RTP send an audio mix of channels not just a single channel.

Example:

pactl load-module module-null-sink sink_name=rtp1 format=s16le channels=2 rate=48000 sink_properties=device.description="rtp1"
pactl load-module module-rtp-send source=rtp1.monitor loop=0 destination=127.0.0.1 port=9998

Then select rtp1 as audio output device.

If the output device could be selected individually by channel then this could be made for a single channel or a specific group of channels only which would be more practical.

Note: not sure this works actually but you get the idea...

f4exb commented 6 years ago

Preliminary works:

Implemented in v3.13.1

f4exb commented 6 years ago

Will also include sample rate selection and copy to UDP/RTP will be moved there.

f4exb commented 6 years ago

implemented in v3.14.0