(Temporarily?) resolved issue with no transmit output. It looks like

switching dacVolumes around from transmit to receive wasn't working as
expected.  Transmit audio through the DAC stayed muted.  If I need to
use that for smooth audio transitions, I'll need to do some more
research.
This commit is contained in:
Rob French 2020-05-03 01:27:54 -05:00
parent 36c2e72846
commit 211d9ff9b4
5 changed files with 17 additions and 17 deletions

10
audio.h
View File

@ -9,24 +9,24 @@
enum RxInput { enum RxInput {
RX_RIG_IN = 0, RX_RIG_IN = 0,
RX_USB_IN, RX_USB_IN = 1,
}; };
enum RxOutput { enum RxOutput {
RX_SPEAKER_OUT = 0, RX_SPEAKER_OUT = 0,
RX_LINE_OUT, RX_LINE_OUT = 1,
RX_USB_OUT, RX_USB_OUT = 2,
}; };
enum TxInput { enum TxInput {
TX_MIC_IN = -1, TX_MIC_IN = -1,
TX_LINE_IN = 0, TX_LINE_IN = 0,
TX_USB_IN, TX_USB_IN = 1,
}; };
enum TxOutput { enum TxOutput {
TX_RIG_OUT = 0, TX_RIG_OUT = 0,
TX_USB_OUT, TX_USB_OUT = 1,
}; };
void audioInit(); void audioInit();

View File

@ -72,10 +72,10 @@ void audioInit()
audioCtrl.lineInLevel(iopConfig.rxRigInLevel, iopConfig.txLineInLevel); // NOTE: need to see if this persists through input changes (see mic gain...) audioCtrl.lineInLevel(iopConfig.rxRigInLevel, iopConfig.txLineInLevel); // NOTE: need to see if this persists through input changes (see mic gain...)
audioCtrl.lineOutLevel(iopConfig.rxLineOutLevel, iopConfig.txRigOutLevel); // NOTE: need to see if this persists through input changes (see mic gain...) audioCtrl.lineOutLevel(iopConfig.rxLineOutLevel, iopConfig.txRigOutLevel); // NOTE: need to see if this persists through input changes (see mic gain...)
audioCtrl.micGain(iopConfig.txMicInGain); // superfluous, as I have to do this anytime I switch to mic for some reason audioCtrl.micGain(iopConfig.txMicInGain); // superfluous, as I have to do this anytime I switch to mic for some reason
audioCtrl.dacVolumeRamp(); // if this seems too slow, might try dacVolumeRampLinear(). //audioCtrl.dacVolumeRamp(); // if this seems too slow, might try dacVolumeRampLinear().
audioCtrl.dacVolume(1.0, 0.0); // we're going to mute TX audio via the DAC unless we're transmitting //audioCtrl.dacVolume(1.0, 0.0); // we're going to mute TX audio via the DAC unless we're transmitting
// selectTxInput(TX_LINE_IN); audioSelectTxInput(TX_MIC_IN); // superfluous I think
} }
inline void updateRxRigIn() inline void updateRxRigIn()
@ -216,7 +216,7 @@ void audioTransmit()
// zero while we change other mixer settings, to try to use the // zero while we change other mixer settings, to try to use the
// DAC's volume ramping to minimize pops. // DAC's volume ramping to minimize pops.
// NOTE: Might need to add a brief delay? // NOTE: Might need to add a brief delay?
audioCtrl.dacVolume(0.0, 0.0); //audioCtrl.dacVolume(0.0, 0.0);
// Next mute the incoming RX audio. Can't think of a good reason // Next mute the incoming RX audio. Can't think of a good reason
// to let RX audio in while we're transmitting. // to let RX audio in while we're transmitting.
@ -249,7 +249,7 @@ void audioTransmit()
// Allow both transmit and receive audio output channels. This is safe // Allow both transmit and receive audio output channels. This is safe
// because the RX input is muted, and we might want to inject something else. // because the RX input is muted, and we might want to inject something else.
audioCtrl.dacVolume(1.0, 1.0); //audioCtrl.dacVolume(1.0, 1.0);
} }
} }
@ -264,7 +264,7 @@ void audioReceive()
// First we're going to set the RX and TX audio DAC volumes to // First we're going to set the RX and TX audio DAC volumes to
// zero while we switch inputs, because the DAC volumes can be // zero while we switch inputs, because the DAC volumes can be
// smoothly ramped by the SGTL5000 to avoid pops. // smoothly ramped by the SGTL5000 to avoid pops.
audioCtrl.dacVolume(0.0, 0.0); //audioCtrl.dacVolume(0.0, 0.0);
// Mute the mic, since we're going to be switching back to line // Mute the mic, since we're going to be switching back to line
// input for RX and TX. // input for RX and TX.
@ -280,7 +280,7 @@ void audioReceive()
// Now bring back up the DAC volumes. Hopefully this reduced pops... // Now bring back up the DAC volumes. Hopefully this reduced pops...
// When going back to receive, we leave transmit DAC at zero. // When going back to receive, we leave transmit DAC at zero.
audioCtrl.dacVolume(1.0, 0.0); //audioCtrl.dacVolume(1.0, 0.0);
} }
} }

View File

@ -75,8 +75,8 @@ struct IOPConfig {
float txUSBInVol = 0.7; float txUSBInVol = 0.7;
float txUSBInCal = 1.0; float txUSBInCal = 1.0;
// rig-out parameters (TX) - default settings are based on hitting 70% of 25mVrms w/ mic // rig-out parameters (TX) - default settings are based on hitting 70% of 25mVrms w/ mic
uint8_t txRigOutLevel = 29; //31; uint8_t txRigOutLevel = 31;
float txRigOutCal = 1.0; //0.043; float txRigOutCal = 0.043;
// USB-out parameters (TX)- debug/monitor use only // USB-out parameters (TX)- debug/monitor use only
bool txUSBOutEnable = true; bool txUSBOutEnable = true;
float txUSBOutCal = 1.0; float txUSBOutCal = 1.0;

View File

@ -15,8 +15,8 @@
enum RigMode { enum RigMode {
MODE_SSB = 0, MODE_SSB = 0,
MODE_DIGI, MODE_DIGI = 1,
MODE_CW, MODE_CW = 2,
}; };
extern RigMode rigMode; extern RigMode rigMode;

View File

@ -7,7 +7,7 @@
#include <Bounce2.h> #include <Bounce2.h>
#define BOUNCE_WITH_PROMPT_DETECTION #define BOUNCE_WITH_PROMPT_DETECTION
RigMode rigMode; RigMode rigMode = MODE_SSB;
IOPConfig iopConfig; IOPConfig iopConfig;
#define MIC_PTT_PIN 21 #define MIC_PTT_PIN 21