diff --git a/src/Network/fgcom.cxx b/src/Network/fgcom.cxx index 6ee912d..e82e8fa 100644 --- a/src/Network/fgcom.cxx +++ b/src/Network/fgcom.cxx @@ -326,6 +326,9 @@ void FGCom::postinit() iaxc_input_level_set( 0.0 ); iaxc_output_level_set(getCurrentCommVolume()); + SG_LOG(SG_IO, SG_INFO, "FGCom: Mute the mic and set speaker at start " << getCurrentCommVolume()); + + iaxc_millisleep(50); // Do the first call at start @@ -343,8 +346,8 @@ double FGCom::getCurrentCommVolume() const { rv = rv * _commVolumeNode->getFloatValue(); //zhongjin -// return rv; - return 1.0; + rv = 0.9; + return rv; } double FGCom::getCurrentFrequencyKhz() const { return 10 * static_cast(_currentCommFrequency * 100 + 0.25); @@ -402,6 +405,9 @@ void FGCom::setupCommFrequency(int channel) { } void FGCom::connectToCommFrequency() { + + SG_LOG(SG_IO, SG_INFO, "FGCom: connectToCommFrequency" ); + // ensure that the current comm is still in range if ((_currentCallFrequency > 0.0) && !isInRange(_currentCallFrequency)) { SG_LOG(SG_IO, SG_WARN, "FGCom: call out of range of: " << _currentCallFrequency); @@ -484,13 +490,15 @@ void FGCom::shutdown() _initialized = false; _enabled = false; + SG_LOG(SG_IO, SG_INFO, "FGCom: shutdown" ); + iaxc_set_event_callback(NULL); iaxc_unregister(_regId); iaxc_stop_processing_thread(); iaxc_shutdown(); - // added to help debugging lingering IAX thread after fgOSCloseWindow - flightgear::addSentryBreadcrumb("Did shutdown FGCom", "info"); + // added to help debugging lingering IAX thread after fgOSCloseWindow + flightgear::addSentryBreadcrumb("Did shutdown FGCom", "info"); assert( static_instance == this ); static_instance = NULL; @@ -520,6 +528,9 @@ void FGCom::valueChanged(SGPropertyNode *prop) } if (prop == _commVolumeNode && _enabled) { + + SG_LOG(SG_IO, SG_INFO, "FGCom: prop = _commVolumeNode" ); + if (_ptt_node->getIntValue()) { SG_LOG(SG_IO, SG_INFO, "FGCom: ignoring change comm volume as PTT pressed"); } @@ -542,6 +553,9 @@ void FGCom::valueChanged(SGPropertyNode *prop) } if (prop == _ptt_node && _enabled) { + + SG_LOG(SG_IO, SG_INFO, "FGCom: prop = _ptt_node" ); + if (_ptt_node->getIntValue()) { // ensure that we are on the right channel by calling setupCommFrequency setupCommFrequency(); @@ -552,7 +566,8 @@ void FGCom::valueChanged(SGPropertyNode *prop) SG_LOG(SG_IO, SG_INFO, "FGCom: PTT active: " << _currentCallFrequency); } else { - iaxc_output_level_set(getCurrentCommVolume()); + //iaxc_output_level_set(getCurrentCommVolume()); + iaxc_output_level_set(0.9); iaxc_input_level_set(0.0); SG_LOG(SG_IO, SG_INFO, "FGCom: PTT release: " << _currentCallFrequency << " vol=" << getCurrentCommVolume()); _mpTransmitFrequencyNode->setValue(0);