From 211d9ff9b44b7da6809257ad6c81eb402a71984e Mon Sep 17 00:00:00 2001 From: Rob French Date: Sun, 3 May 2020 01:27:54 -0500 Subject: [PATCH] (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. --- audio.h | 10 +++++----- audio.ino | 14 +++++++------- config.h | 4 ++-- ubitx_iop.h | 4 ++-- ubitx_iop.ino | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/audio.h b/audio.h index f75be06..382949c 100644 --- a/audio.h +++ b/audio.h @@ -9,24 +9,24 @@ enum RxInput { RX_RIG_IN = 0, - RX_USB_IN, + RX_USB_IN = 1, }; enum RxOutput { RX_SPEAKER_OUT = 0, - RX_LINE_OUT, - RX_USB_OUT, + RX_LINE_OUT = 1, + RX_USB_OUT = 2, }; enum TxInput { TX_MIC_IN = -1, TX_LINE_IN = 0, - TX_USB_IN, + TX_USB_IN = 1, }; enum TxOutput { TX_RIG_OUT = 0, - TX_USB_OUT, + TX_USB_OUT = 1, }; void audioInit(); diff --git a/audio.ino b/audio.ino index 5c51e1d..4451a47 100644 --- a/audio.ino +++ b/audio.ino @@ -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.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.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.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 - // selectTxInput(TX_LINE_IN); + audioSelectTxInput(TX_MIC_IN); // superfluous I think } inline void updateRxRigIn() @@ -216,7 +216,7 @@ void audioTransmit() // zero while we change other mixer settings, to try to use the // DAC's volume ramping to minimize pops. // 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 // 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 // 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 // zero while we switch inputs, because the DAC volumes can be // 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 // input for RX and TX. @@ -280,7 +280,7 @@ void audioReceive() // Now bring back up the DAC volumes. Hopefully this reduced pops... // When going back to receive, we leave transmit DAC at zero. - audioCtrl.dacVolume(1.0, 0.0); + //audioCtrl.dacVolume(1.0, 0.0); } } diff --git a/config.h b/config.h index 134c551..9f14aa3 100644 --- a/config.h +++ b/config.h @@ -75,8 +75,8 @@ struct IOPConfig { float txUSBInVol = 0.7; float txUSBInCal = 1.0; // rig-out parameters (TX) - default settings are based on hitting 70% of 25mVrms w/ mic - uint8_t txRigOutLevel = 29; //31; - float txRigOutCal = 1.0; //0.043; + uint8_t txRigOutLevel = 31; + float txRigOutCal = 0.043; // USB-out parameters (TX)- debug/monitor use only bool txUSBOutEnable = true; float txUSBOutCal = 1.0; diff --git a/ubitx_iop.h b/ubitx_iop.h index fd6cef3..06207ac 100644 --- a/ubitx_iop.h +++ b/ubitx_iop.h @@ -15,8 +15,8 @@ enum RigMode { MODE_SSB = 0, - MODE_DIGI, - MODE_CW, + MODE_DIGI = 1, + MODE_CW = 2, }; extern RigMode rigMode; diff --git a/ubitx_iop.ino b/ubitx_iop.ino index 8faac1e..789a9ce 100644 --- a/ubitx_iop.ino +++ b/ubitx_iop.ino @@ -7,7 +7,7 @@ #include #define BOUNCE_WITH_PROMPT_DETECTION -RigMode rigMode; +RigMode rigMode = MODE_SSB; IOPConfig iopConfig; #define MIC_PTT_PIN 21