From 0c072f4665f37c72d1c8cc2c4e421a60a8ab82db Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Wed, 3 May 2023 08:04:17 +0200 Subject: [PATCH 1/5] added libudev-dev as prereq to build on debian based systems --- INSTALL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/INSTALL.md b/INSTALL.md index da0849a..ee90cbd 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -18,6 +18,7 @@ sudo apt-get install libeigen3-dev sudo apt-get install portaudio19-dev sudo apt-get install librtaudio-dev sudo apt-get install libhidapi-dev libqt5gamepad5-dev +sudo apt-get install libudev-dev ~~~ Now you need to install qcustomplot. There are two versions that are commonly found in linux distros: 1.3 and 2.0. Either will work fine. If you are not sure which version your linux install comes with, simply run both commands. One will work and the other will fail, and that's fine! From 54b00b902279dc3c9b4c2ef01c2c0baa7608fe0a Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Mon, 29 May 2023 11:42:16 +0200 Subject: [PATCH 2/5] added list of known CI-V addresses, interfaces, rates --- CI-V.md | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 CI-V.md diff --git a/CI-V.md b/CI-V.md new file mode 100644 index 0000000..c7224c1 --- /dev/null +++ b/CI-V.md @@ -0,0 +1,109 @@ + + + + +## this is a merged list of CI-V addresses, type of interface(s), rates and all. + +It has been merged from many sources but the most important ones are these: + +1) https://www.docksideradio.com/Icom%20Radio%20Hex%20Addresses.htm +2) http://www.plicht.de/ci-v/civ-bus-adressing/ +3) https://www.icomjapan.com/support/manual/ + + + +first of all a list that appears not to be a known CI-V address in use: + +| model | addr | +| ----- | ---- | +|? | 0x06 | +|? | 0x36 | +|? | 0x54 | +|? | 0x7E | +|? | 0x82 | +|? | 0x84 | +|? | 0x8A | +|? | 0x90 | +|? | 0x92 | +|? | 0x9E | +|? | 0xA0 | +|? | 0xA8 | +|? | 0xAA | + + + +and here the list of known CI-V addresses + + + +| model | addr | year | interface | rate | +| ------------ | ---- | ---- | -------------------------------------- | ---- | +| IC-1271 | 0x24 | 1987 | TTL | auto | +| IC-1275 | 0x18 | 1989 | TTL | auto | +| IC-271 | 0x20 | 1983 | TTL | auto | +| IC-275 | 0x10 | 1987 | TTL | auto | +| IC-375 | 0x12 | 198? | TTL | auto | +| IC-471 | 0x22 | 1984 | TTL | auto | +| IC-475 | 0x14 | 1987 | TTL | auto | +| IC-575 | 0x16 | 1988 | TTL | auto | +| IC-7000 | 0x70 | 2005 | TTL | auto | +| IC-703 | 0x68 | 2003 | TTL | auto | +| IC-705 | 0xA4 | 2020 | USB, Bluetooth, Wifi | auto | +| IC-706 | 0x48 | 1995 | TTL | auto | +| IC-706MkII | 0x4E | 1997 | TTL | auto | +| IC-706MkII-G | 0x58 | 1998 | TTL | auto | +| IC-707 | 0x3E | 1993 | TTL | auto | +| IC-7100 | 0x88 | 2012 | TTL | auto | +| IC-718 | 0x5E | 2001 | TTL | auto | +| IC-7200 | 0x76 | 2007 | TTL | auto | +| IC-725 | 0x28 | 1988 | TTL | 1200 | +| IC-726 | 0x30 | 1989 | TTL | auto | +| IC-728 | 0x38 | 1992 | TTL | 1200 | +| IC-729 | 0x3A | 1992 | TTL | 9600 | +| IC-7300 | 0x94 | 2016 | TTL, USB | auto | +| IC-735 | 0x04 | 1985 | TTL | 1200 | +| IC-736 | 0x40 | 1994 | TTL | 9600 | +| IC-737 | 0x3C | 1993 | TTL | 9600 | +| IC-738 | 0x44 | 1994 | TTL | 9600 | +| IC-7410 | 0x80 | 2011 | TTL, USB | auto | +| IC-746 | 0x56 | 1998 | TTL | auto | +| IC-746Pro | 0x66 | 2001 | TTL | auto | +| IC-751A | 0x1C | 1985 | TTL | 1200 | +| IC-756 | 0x50 | 1997 | TTL | auto | +| IC-756Pro | 0x5C | 2000 | TTL | auto | +| IC-756ProII | 0x64 | 2001 | TTL | auto | +| IC-756ProIII | 0x6E | 2004 | TTL | auto | +| IC-7600 | 0x7A | 2009 | TTL, USB | auto | +| IC-7610 | 0x98 | 2017 | TTL, USB, Ethernet | auto | +| IC-761 | 0x1E | 1987 | TTL | 1200 | +| IC-765 | 0x2C | 1989 | TTL | 1200 | +| IC-7700 | 0x74 | 2007 | TTL, RS-232C 9 pin, Ethernet | auto | +| IC-775 | 0x46 | 1995 | TTL | auto | +| IC-7800 | 0x6A | 2004 | TTL, RS-232C 9 pin, Ethernet | auto | +| IC-78 | 0x62 | 2000 | TTL | auto | +| IC-781 | 0x26 | 1987 | TTL | 1200 | +| IC-785x | 0x8E | 2015 | TTL, USB, Ethernet | auto | +| IC-820 | 0x42 | 1994 | TTL | auto | +| IC-821 | 0x4C | 1996 | TTL | auto | +| IC-905 | 0xAC | 2023 | USB, Ethernet | auto | +| IC-9100 | 0x7C | 2010 | TTL, USB | auto | +| IC-910 | 0x60 | 2001 | TTL | auto | +| IC-9700 | 0xA2 | 2019 | TTL, USB, Ethernet | auto | +| IC-970 | 0x2E | 1990 | TTL | auto | +| IC-R10 | 0x52 | 1996 | TTL | auto | +| IC-R20 | 0x6C | 2004 | TTL | auto | +| IC-R30 | 0x9C | 2018 | TTL, Bluetooth | auto | +| IC-R7000 | 0x08 | 1986 | TTL | auto | +| IC-R7100 | 0x34 | 1991 | TTL | auto | +| IC-R71 | 0x1A | 1984 | TTL | auto | +| IC-R72 | 0x32 | 1992 | TTL | auto | +| IC-R75 | 0x5A | 1999 | TTL, RS-232C 9 pin | auto | +| IC-R8500 | 0x4A | 1996 | TTL, RS-232C 25 pin | auto | +| IC-R8600 | 0x96 | 2017 | TTL, USB, Ethernet | auto | +| IC-R9000 | 0x2A | 1989 | TTL | auto | +| IC-R9500 | 0x72 | 2007 | TTL, RS-232C 9 pin, Ethernet | auto | +| IC-RX7 | 0x78 | 2007 | TTL | auto | +| ID-4100 | 0x9A | 2017 | TTL, Bluetooth | auto | +| ID-5100 | 0x8C | 2014 | TTL, Bluetooth | auto | +| ID-51 | 0x86 | 2012 | TTL | auto | +| ID-52 | 0xA6 | 2021 | TTL, Bluetooth | auto | From 7df55bc41fc915267fdcd2188cb14c011106e315 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 16 Jul 2023 10:26:28 +0100 Subject: [PATCH 3/5] Fix errors identified by clang scan-build --- audioconverter.cpp | 8 +----- meter.cpp | 2 +- repeatersetup.cpp | 5 ++++ resampler/resample.c | 2 +- rigcommander.cpp | 2 ++ udpserver.cpp | 60 +++++++++++++++++++++++--------------------- wfmain.cpp | 2 +- 7 files changed, 43 insertions(+), 38 deletions(-) diff --git a/audioconverter.cpp b/audioconverter.cpp index 4766962..6d72532 100644 --- a/audioconverter.cpp +++ b/audioconverter.cpp @@ -113,13 +113,7 @@ bool audioConverter::convert(audioPacket audio) QByteArray outPacket(nSamples * sizeof(float) * inFormat.channelCount(), (char)0xff); // Preset the output buffer size. float* out = (float*)outPacket.data(); - //if (audio.seq > lastAudioSequence + 1) { - // nSamples = opus_decode_float(opusDecoder, Q_NULLPTR, 0, out, nSamples, 1); - //} - //else { - nSamples = opus_decode_float(opusDecoder, in, audio.data.size(), out, nSamples, 0); - //} - //lastAudioSequence = audio.seq; + opus_decode_float(opusDecoder, in, audio.data.size(), out, nSamples, 0); audio.data.clear(); audio.data = outPacket; // Replace incoming data with converted. } diff --git a/meter.cpp b/meter.cpp index 25990e0..e7c22e6 100644 --- a/meter.cpp +++ b/meter.cpp @@ -493,7 +493,7 @@ void meter::drawScalePo(QPainter *qp) // Here, P is now 60 watts: // Higher scale: - i = i - (int)(10*dnPerWatt); // back one tick first. Otherwise i starts at 178. + //i = i - (int)(10*dnPerWatt); // back one tick first. Otherwise i starts at 178. **Not used?** //qDebug() << "meter i: " << i; dnPerWatt = (213-143.0f) / 50.0f; // 1.4 dn per watt // P=5 here. diff --git a/repeatersetup.cpp b/repeatersetup.cpp index f19d804..0f85963 100644 --- a/repeatersetup.cpp +++ b/repeatersetup.cpp @@ -688,6 +688,7 @@ void repeaterSetup::on_splitPlusButton_clicked() txfreqhz = currentMainFrequency.Hz + hzOffset; f.Hz = txfreqhz; f.VFO = inactiveVFO; + f.MHzDouble = f.Hz/1E6; txString = QString::number(f.Hz / double(1E6), 'f', 6); ui->splitTransmitFreqEdit->setText(txString); usedPlusSplit = true; @@ -707,6 +708,7 @@ void repeaterSetup::on_splitMinusBtn_clicked() txfreqhz = currentMainFrequency.Hz - hzOffset; f.Hz = txfreqhz; f.VFO = inactiveVFO; + f.MHzDouble = f.Hz/1E6; txString = QString::number(f.Hz / double(1E6), 'f', 6); ui->splitTransmitFreqEdit->setText(txString); usedPlusSplit = false; @@ -723,6 +725,7 @@ void repeaterSetup::on_splitTxFreqSetBtn_clicked() { f.Hz = fHz; f.VFO = inactiveVFO; + f.MHzDouble = f.Hz/1E6; emit setTransmitFrequency(f); emit setTransmitMode(modeTransmitVFO); } @@ -812,6 +815,8 @@ void repeaterSetup::on_rptrOffsetSetBtn_clicked() { freqt f; f.Hz = getFreqHzFromMHzString(ui->rptrOffsetEdit->text()); + f.MHzDouble = f.Hz/1E6; + f.VFO=activeVFO; if(f.Hz != 0) { emit setRptDuplexOffset(f); diff --git a/resampler/resample.c b/resampler/resample.c index aa96cd4..4c42095 100644 --- a/resampler/resample.c +++ b/resampler/resample.c @@ -710,7 +710,7 @@ static int update_filter(SpeexResamplerState* st) /* Adding buffer_size to filt_len won't overflow here because filt_len could be multiplied by sizeof(spx_word16_t) above. */ min_alloc_size = st->filt_len - 1 + st->buffer_size; - if (min_alloc_size > st->mem_alloc_size) + if (min_alloc_size > st->mem_alloc_size && st->nb_channels>0) { spx_word16_t* mem; if (INT_MAX / sizeof(spx_word16_t) / st->nb_channels < min_alloc_size) diff --git a/rigcommander.cpp b/rigcommander.cpp index 8600b76..b20b341 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -4773,6 +4773,8 @@ freqt rigCommander::parseFrequencyRptOffset(QByteArray data) f.Hz += (data[1] & 0x0f) * 100; // 100 Hz f.Hz += ((data[1] & 0xf0) >> 4) * 1000; // 1 KHz + f.MHzDouble=f.Hz/1E6; + f.VFO = activeVFO; return f; } diff --git a/udpserver.cpp b/udpserver.cpp index 9a3ed13..de83e0d 100644 --- a/udpserver.cpp +++ b/udpserver.cpp @@ -382,31 +382,32 @@ void udpServer::controlReceived() qCritical(logAudio()) << "Unsupported Transmit Audio Handler selected!"; } - //radio->txaudio = new audioHandler(); - radio->txAudioThread = new QThread(this); - radio->txAudioThread->setObjectName("txAudio()"); + + if (radio->txaudio != Q_NULLPTR) { + radio->txAudioThread = new QThread(this); + radio->txAudioThread->setObjectName("txAudio()"); - radio->txaudio->moveToThread(radio->txAudioThread); + radio->txaudio->moveToThread(radio->txAudioThread); - radio->txAudioThread->start(QThread::TimeCriticalPriority); + radio->txAudioThread->start(QThread::TimeCriticalPriority); - connect(this, SIGNAL(setupTxAudio(audioSetup)), radio->txaudio, SLOT(init(audioSetup))); - connect(radio->txAudioThread, SIGNAL(finished()), radio->txaudio, SLOT(deleteLater())); + connect(this, SIGNAL(setupTxAudio(audioSetup)), radio->txaudio, SLOT(init(audioSetup))); + connect(radio->txAudioThread, SIGNAL(finished()), radio->txaudio, SLOT(deleteLater())); - // Not sure how we make this work in QT5.9? + // Not sure how we make this work in QT5.9? #if (QT_VERSION >= QT_VERSION_CHECK(5,10,0)) - QMetaObject::invokeMethod(radio->txaudio, [=]() { - radio->txaudio->init(radio->txAudioSetup); - }, Qt::QueuedConnection); + QMetaObject::invokeMethod(radio->txaudio, [=]() { + radio->txaudio->init(radio->txAudioSetup); + }, Qt::QueuedConnection); #else - emit setupTxAudio(radio->txAudioSetup); - #warning "QT 5.9 is not fully supported multiple rigs will NOT work!" + emit setupTxAudio(radio->txAudioSetup); + #warning "QT 5.9 is not fully supported multiple rigs will NOT work!" #endif - hasTxAudio = datagram.senderAddress(); - - connect(this, SIGNAL(haveAudioData(audioPacket)), radio->txaudio, SLOT(incomingAudio(audioPacket))); + hasTxAudio = datagram.senderAddress(); + connect(this, SIGNAL(haveAudioData(audioPacket)), radio->txaudio, SLOT(incomingAudio(audioPacket))); + } } if ((!memcmp(radio->guid, current->guid, GUIDLEN) || config->rigs.size() == 1) && radio->rxaudio == Q_NULLPTR && !config->lan) { @@ -431,27 +432,30 @@ void udpServer::controlReceived() qCritical(logAudio()) << "Unsupported Receive Audio Handler selected!"; } + if (radio->rxaudio != Q_NULLPTR) + { - radio->rxAudioThread = new QThread(this); - radio->rxAudioThread->setObjectName("rxAudio()"); + radio->rxAudioThread = new QThread(this); + radio->rxAudioThread->setObjectName("rxAudio()"); - radio->rxaudio->moveToThread(radio->rxAudioThread); + radio->rxaudio->moveToThread(radio->rxAudioThread); - radio->rxAudioThread->start(QThread::TimeCriticalPriority); + radio->rxAudioThread->start(QThread::TimeCriticalPriority); - connect(radio->rxAudioThread, SIGNAL(finished()), radio->rxaudio, SLOT(deleteLater())); - connect(radio->rxaudio, SIGNAL(haveAudioData(audioPacket)), this, SLOT(receiveAudioData(audioPacket))); + connect(radio->rxAudioThread, SIGNAL(finished()), radio->rxaudio, SLOT(deleteLater())); + connect(radio->rxaudio, SIGNAL(haveAudioData(audioPacket)), this, SLOT(receiveAudioData(audioPacket))); #if (QT_VERSION >= QT_VERSION_CHECK(5,10,0)) - QMetaObject::invokeMethod(radio->rxaudio, [=]() { - radio->rxaudio->init(radio->rxAudioSetup); - }, Qt::QueuedConnection); + QMetaObject::invokeMethod(radio->rxaudio, [=]() { + radio->rxaudio->init(radio->rxAudioSetup); + }, Qt::QueuedConnection); #else - //#warning "QT 5.9 is not fully supported multiple rigs will NOT work!" - connect(this, SIGNAL(setupRxAudio(audioSetup)), radio->rxaudio, SLOT(init(audioSetup))); - setupRxAudio(radio->rxAudioSetup); + //#warning "QT 5.9 is not fully supported multiple rigs will NOT work!" + connect(this, SIGNAL(setupRxAudio(audioSetup)), radio->rxaudio, SLOT(init(audioSetup))); + setupRxAudio(radio->rxAudioSetup); #endif + } } } diff --git a/wfmain.cpp b/wfmain.cpp index 75289a7..da7cdbf 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -7245,7 +7245,7 @@ void wfmain::receiveModInput(rigInput input, bool dataOn) { QComboBox *box; QString inputName; - bool found; + bool found=false; bool foundCurrent = false; if(dataOn) From 80d6614ca71e706a373c4233d1a3b64caf6c2487 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 16 Jul 2023 14:00:18 +0100 Subject: [PATCH 4/5] Fix compile warnings --- audioconverter.cpp | 6 +++++- rigcommander.cpp | 2 +- wfmain.cpp | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/audioconverter.cpp b/audioconverter.cpp index 6d72532..7fee4d5 100644 --- a/audioconverter.cpp +++ b/audioconverter.cpp @@ -113,7 +113,11 @@ bool audioConverter::convert(audioPacket audio) QByteArray outPacket(nSamples * sizeof(float) * inFormat.channelCount(), (char)0xff); // Preset the output buffer size. float* out = (float*)outPacket.data(); - opus_decode_float(opusDecoder, in, audio.data.size(), out, nSamples, 0); + int ret = opus_decode_float(opusDecoder, in, audio.data.size(), out, nSamples, 0); + if (ret != nSamples) + { + qDebug(logAudio()) << "opus_decode_float: returned:" << ret << "samples, expected:" << nSamples; + } audio.data.clear(); audio.data = outPacket; // Replace incoming data with converted. } diff --git a/rigcommander.cpp b/rigcommander.cpp index b20b341..881a3ed 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -3543,7 +3543,7 @@ void rigCommander::determineRigCaps() bandType bandDef70cm = bandType(band70cm, 420000000, 450000000, modeUSB); bandType bandDef23cm = bandType(band23cm, 1240000000, 1400000000, modeUSB); bandType bandDef13cm = bandType(band13cm, 2300000000, 2450000000, modeUSB); - bandType bandDef9cm = bandType(band9cm, 3300000000, 3500000000, modeUSB); + //bandType bandDef9cm = bandType(band9cm, 3300000000, 3500000000, modeUSB); bandType bandDef6cm = bandType(band6cm, 5650000000, 5925000000, modeUSB); bandType bandDef3cm = bandType(band3cm, 10000000000, 10500000000, modeUSB); diff --git a/wfmain.cpp b/wfmain.cpp index da7cdbf..3af1e62 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -6290,6 +6290,7 @@ void wfmain::changeMode(mode_kind mode, bool dataOn) mode_info m; m.filter = (unsigned char) filter; m.reg = (unsigned char) mode; + m.mk = mode; issueCmd(cmdSetMode, m); currentMode = mode; From b4c079f7f46d0a7c2399dd1c52af13fc60bc5bdb Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 16 Jul 2023 14:05:53 +0100 Subject: [PATCH 5/5] Prepare for v1.64 release --- wfview.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfview.pro b/wfview.pro index a240603..208ed60 100644 --- a/wfview.pro +++ b/wfview.pro @@ -21,7 +21,7 @@ contains(DEFINES,USB_CONTROLLER){ TARGET = wfview TEMPLATE = app -DEFINES += WFVIEW_VERSION=\\\"1.63\\\" +DEFINES += WFVIEW_VERSION=\\\"1.64\\\" DEFINES += BUILD_WFVIEW