From 00dbe9ec46458085cbe4b268125b12f5efbb16fc Mon Sep 17 00:00:00 2001 From: "dev@dev.com" Date: Sat, 10 Dec 2022 19:12:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8F=91=E7=8E=B0=E4=B8=80=E4=B8=AA=E6=96=B0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E3=80=82Qt=E5=A3=B0=E5=8D=A1=E9=87=87?= =?UTF-8?q?=E6=A0=B7=E7=8E=87=E5=8F=AF=E4=BB=A5=E4=BB=BB=E6=84=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E3=80=82=202.=E4=BF=AE=E5=A4=8D=E5=A3=B0=E5=8D=A1?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=92=AD=E6=94=BEBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sinks/sink_soundcard/dialogsoundcard.cpp | 11 +- .../source_soundcard/dialogsoundcard.cpp | 2 +- projects/usrp_fm_reciever.tbj | 558 +++++++++--------- 3 files changed, 299 insertions(+), 272 deletions(-) diff --git a/modules/sinks/sink_soundcard/dialogsoundcard.cpp b/modules/sinks/sink_soundcard/dialogsoundcard.cpp index 0340503..1bf84f7 100644 --- a/modules/sinks/sink_soundcard/dialogsoundcard.cpp +++ b/modules/sinks/sink_soundcard/dialogsoundcard.cpp @@ -109,11 +109,18 @@ void DialogSoundCard::InitMonitor() mFormatSound.setSampleRate(ui->spinbox_sprate->value()); mFormatSound.setChannelCount(ui->spinbox_channels->value()); - QAudioDevice infoOut(QMediaDevices::defaultAudioOutput()); + //QAudioDevice infoOut(QMediaDevices::defaultAudioOutput()); + QAudioDevice infoOut; + if (ui->comboBox_audioDevices->currentIndex()>=0 && + ui->comboBox_audioDevices->currentIndex()rowCount()) + infoOut = m_devOutputlist[ui->comboBox_audioDevices->currentIndex()]; + else + infoOut = QMediaDevices::defaultAudioOutput(); + if (!infoOut.isFormatSupported(mFormatSound)) { //Default format not supported - trying to use nearest - mFormatSound = infoOut.preferredFormat(); + //mFormatSound = infoOut.preferredFormat(); } CreateAudioOutput(); diff --git a/modules/sources/source_soundcard/dialogsoundcard.cpp b/modules/sources/source_soundcard/dialogsoundcard.cpp index 435cc03..f12d601 100644 --- a/modules/sources/source_soundcard/dialogsoundcard.cpp +++ b/modules/sources/source_soundcard/dialogsoundcard.cpp @@ -130,7 +130,7 @@ void DialogSoundCard::CreateAudioInput() if (!infoIn.isFormatSupported(mFormatSound)) { //Default format not supported - trying to use nearest - mFormatSound = infoIn.preferredFormat(); + //mFormatSound = infoIn.preferredFormat(); } QAudioDevice inputDevice(infoIn); diff --git a/projects/usrp_fm_reciever.tbj b/projects/usrp_fm_reciever.tbj index f4b7477..908cb11 100644 --- a/projects/usrp_fm_reciever.tbj +++ b/projects/usrp_fm_reciever.tbj @@ -1,229 +1,5 @@ { "mod0": { - "uhd_usrp_io": { - "input_subjects": { - "tx_time": { - "instance_value": "", - "tooltip": "tx_time", - "type": "uint64+double" - }, - "wav_tx0": { - "instance_value": "", - "tooltip": "TX0", - "type": "short[2]" - }, - "wav_tx1": { - "instance_value": "", - "tooltip": "TX1", - "type": "short[2]" - } - }, - "instance": { - "additional_args": "nice=0;", - "exec": "modules/uhd_usrp_io", - "instance_value": 1 - }, - "name": { - "name": "UHD收发" - }, - "output_subjects": { - "rx_time": { - "instance_value": 0, - "tooltip": "rx_time", - "type": "uint64+double" - }, - "wav_rx0": { - "instance_value": 3, - "tooltip": "RX0", - "type": "short[2]" - }, - "wav_rx1": { - "instance_value": "", - "tooltip": "RX1", - "type": "short[2]" - } - }, - "parameters": { - "dev_args": { - "default": "", - "instance_value": "", - "tooltip": "设备初始化参数.", - "type": "string" - }, - "rx_agc": { - "default": "0,0", - "instance_value": "0,0", - "range": "0=off,1=on", - "tooltip": "接收AGC开关", - "type": "int" - }, - "rx_atn": { - "default": "RX2,RX2", - "instance_value": "RX2", - "range": "TX/RX,RX2", - "tooltip": "接收天线名称", - "type": "string" - }, - "rx_bw": { - "default": "1.0,1.0", - "instance_value": "0.2,0.2", - "tooltip": "接收滤波器带宽(MHz)", - "type": "double" - }, - "rx_channels": { - "default": "0,1", - "instance_value": "0", - "range": "0,1", - "tooltip": "接收各个通道号", - "type": "int" - }, - "rx_gain": { - "default": "30.0,30.0", - "instance_value": "50", - "range": "0-100", - "tooltip": "接收增益(dB)", - "type": "double" - }, - "rx_on": { - "default": "0", - "instance_value": "1", - "tooltip": "接收开关", - "type": "int" - }, - "rx_rate": { - "default": 1, - "instance_value": "0.5", - "tooltip": "RX采样率(MHz)", - "type": "int" - }, - "rx_rf": { - "default": "99.0,101.1", - "instance_value": "99.0", - "range": "0-6000", - "tooltip": "接收频率(MHz)", - "type": "double" - }, - "tx_atn": { - "default": "TX/RX,TX/RX", - "instance_value": "TX/RX,TX/RX", - "tooltip": "发射天线名称", - "type": "string" - }, - "tx_bw": { - "default": "1.0,1.0", - "instance_value": "1.0,1.0", - "tooltip": "发射滤波器带宽(MHz)", - "type": "double" - }, - "tx_channels": { - "default": "0,1", - "instance_value": "0,1", - "tooltip": "发射各个通道", - "type": "int" - }, - "tx_gain": { - "default": "30.0,30.0", - "instance_value": "30.0,30.0", - "range": "0-100", - "tooltip": "发射增益(dB)", - "type": "double" - }, - "tx_on": { - "default": 0, - "instance_value": 0, - "tooltip": "发射开关", - "type": "int" - }, - "tx_rate": { - "default": 1, - "instance_value": 1, - "tooltip": "TX采样率(MHz)", - "type": "int" - }, - "tx_rf": { - "default": "200.0,203.0", - "instance_value": "200.0,203.0", - "range": "0-6000", - "tooltip": "发射频率(MHz)", - "type": "double" - } - } - } - }, - "mod1": { - "transform_fft": { - "input_subjects": { - "signal": { - "instance_value": 8, - "tooltip": "signal", - "type": "byte" - }, - "tmstamp_in": { - "instance_value": 0, - "tooltip": "tmstamp_in", - "type": "uint64" - } - }, - "instance": { - "additional_args": "nice=0;", - "exec": "modules/transform_fft", - "instance_value": 2 - }, - "name": { - "name": "libfftw" - }, - "output_subjects": { - "FFT": { - "instance_value": 4, - "tooltip": "FFT in dB", - "type": "vector" - }, - "Spec": { - "instance_value": "", - "tooltip": "Spec in Complex", - "type": "vector" - }, - "tmstamp_out": { - "instance_value": 0, - "tooltip": "tmstamp_out", - "type": "uint64" - } - }, - "parameters": { - "channels": { - "default": 1, - "instance_value": 1, - "tooltip": "Channels", - "type": "int" - }, - "fftsize": { - "default": 1024, - "instance_value": 1024, - "tooltip": "fft size", - "type": "int" - }, - "input_type": { - "default": 0, - "instance_value": "1", - "tooltip": "0=Real,1=Complex", - "type": "int" - }, - "sptype": { - "default": 0, - "instance_value": 0, - "range": { - "0": "16 bit Intel", - "1": "16 bit Moto", - "2": "int8", - "3": "uint8" - }, - "tooltip": "sample point format", - "type": "enum" - } - } - } - }, - "mod2": { "sink_plots": { "input_subjects": { "plot0": { @@ -232,7 +8,7 @@ "type": "byte" }, "plot1": { - "instance_value": 4, + "instance_value": 0, "tooltip": "input1", "type": "byte" }, @@ -253,9 +29,9 @@ } }, "instance": { - "additional_args": "nice=0;", - "exec": "modules/sink_plots", - "instance_value": 3 + "additional_args": "nice=2;", + "exec": "../modules/sink_plots.exe", + "instance_value": 1 }, "name": { "name": "plots" @@ -285,7 +61,7 @@ } } }, - "mod3": { + "mod1": { "resample_pqfraction": { "input_subjects": { "in": { @@ -294,15 +70,15 @@ "type": "byte" }, "in_time": { - "instance_value": 1, + "instance_value": 0, "tooltip": "Input timestamp", "type": "timestamp" } }, "instance": { - "additional_args": "nice=0;", - "exec": "modules/resample_pqfraction", - "instance_value": 4 + "additional_args": "nice=3;", + "exec": "../modules/resample_pqfraction.exe", + "instance_value": 2 }, "name": { "name": "resamplepq" @@ -329,7 +105,7 @@ }, "nq": { "default": "1", - "instance_value": "500", + "instance_value": "2000", "range": "N", "tooltip": "old rate", "type": "int" @@ -356,7 +132,7 @@ } } }, - "mod4": { + "mod2": { "sink_soundcard": { "input_subjects": { "timestamp_in": { @@ -371,9 +147,9 @@ } }, "instance": { - "additional_args": "nice=0;", - "exec": "modules/sink_soundcard", - "instance_value": 5 + "additional_args": "nice=3;", + "exec": "../modules/sink_soundcard.exe", + "instance_value": 3 }, "name": { "name": "soundcard" @@ -405,7 +181,7 @@ }, "sample_rate": { "default": 44100, - "instance_value": "32000", + "instance_value": "40000", "range": { "desc": "8000~192000" }, @@ -415,7 +191,7 @@ } } }, - "mod5": { + "mod3": { "mod_fm_dem": { "input_subjects": { "signal": { @@ -430,9 +206,9 @@ } }, "instance": { - "additional_args": "nice=0;", - "exec": "modules/mod_fm_dem", - "instance_value": 6 + "additional_args": "nice=3;", + "exec": "../modules/mod_fm_dem.exe", + "instance_value": 4 }, "name": { "name": "fm_dem" @@ -451,7 +227,7 @@ } } }, - "mod6": { + "mod4": { "resample_pqfraction": { "input_subjects": { "in": { @@ -466,9 +242,9 @@ } }, "instance": { - "additional_args": "nice=0;", - "exec": "modules/resample_pqfraction", - "instance_value": 7 + "additional_args": "nice=3;", + "exec": "../modules/resample_pqfraction.exe", + "instance_value": 5 }, "name": { "name": "resamplepq" @@ -488,14 +264,14 @@ "parameters": { "np": { "default": "1", - "instance_value": "32000", + "instance_value": "40", "range": "N", "tooltip": "new rate", "type": "int" }, "nq": { "default": "1", - "instance_value": "200000", + "instance_value": "200", "range": "N", "tooltip": "old rate", "type": "int" @@ -522,12 +298,12 @@ } } }, - "mod7": { + "mod5": { "control_pannel": { "instance": { - "additional_args": "nice=0;", - "exec": "modules/control_pannel", - "instance_value": 8 + "additional_args": "nice=2;", + "exec": "../modules/control_pannel.exe", + "instance_value": 6 }, "name": { "name": "CtrlPannel" @@ -537,37 +313,281 @@ } } }, + "mod6": { + "transform_fft": { + "input_subjects": { + "signal": { + "instance_value": 3, + "tooltip": "signal", + "type": "byte" + }, + "tmstamp_in": { + "instance_value": "", + "tooltip": "tmstamp_in", + "type": "uint64" + } + }, + "instance": { + "additional_args": "nice=2;", + "exec": "../modules/transform_fft.exe", + "instance_value": 7 + }, + "name": { + "name": "libfftw" + }, + "output_subjects": { + "FFT": { + "instance_value": 9, + "tooltip": "FFT in dB", + "type": "vector" + }, + "Spec": { + "instance_value": "", + "tooltip": "Spec in Complex", + "type": "vector" + }, + "tmstamp_out": { + "instance_value": "", + "tooltip": "tmstamp_out", + "type": "uint64" + } + }, + "parameters": { + "channels": { + "default": 1, + "instance_value": 1, + "tooltip": "Channels", + "type": "int" + }, + "fftsize": { + "default": 1024, + "instance_value": "4096", + "tooltip": "fft size", + "type": "int" + }, + "frame_span": { + "default": 16, + "instance_value": 16, + "range": ">=1", + "tooltip": "Frame Span (count) between each fft calc. Slower CPU need larger spans.", + "type": "int" + }, + "input_type": { + "default": 0, + "instance_value": "1", + "tooltip": "0=Real,1=Complex", + "type": "int" + }, + "mod": { + "default": 0, + "instance_value": 0, + "range": "0=Frame,1=Continous", + "tooltip": "WorkingMod", + "type": "int" + }, + "sptype": { + "default": 0, + "instance_value": 0, + "range": { + "0": "16 bit Intel", + "1": "16 bit Moto", + "2": "int8", + "3": "uint8" + }, + "tooltip": "sample point format", + "type": "enum" + } + } + } + }, + "mod7": { + "uhd_usrp_io": { + "input_subjects": { + "tx_time": { + "instance_value": "", + "tooltip": "tx_time", + "type": "uint64+double" + }, + "wav_tx0": { + "instance_value": "", + "tooltip": "TX0", + "type": "short[2]" + }, + "wav_tx1": { + "instance_value": "", + "tooltip": "TX1", + "type": "short[2]" + } + }, + "instance": { + "additional_args": "nice=2;", + "batchtime": 20, + "exec": "../modules/usrp/uhd_usrp_io.exe", + "instance_value": 8 + }, + "name": { + "name": "UHD收发" + }, + "output_subjects": { + "rx_time": { + "instance_value": "", + "tooltip": "rx_time", + "type": "uint64+double" + }, + "tx_mark": { + "instance_value": 0, + "tooltip": "TXWaterMark", + "type": "int64" + }, + "wav_rx0": { + "instance_value": 3, + "tooltip": "RX0", + "type": "short[2]" + }, + "wav_rx1": { + "instance_value": "", + "tooltip": "RX1", + "type": "short[2]" + } + }, + "parameters": { + "dev_args": { + "default": "", + "instance_value": "", + "tooltip": "设备初始化参数.", + "type": "string" + }, + "rx_agc": { + "default": "0,0", + "instance_value": "0,0", + "range": "0=off,1=on", + "tooltip": "接收AGC开关", + "type": "int" + }, + "rx_atn": { + "default": "RX2,RX2", + "instance_value": "RX2,RX2", + "range": "TX/RX,RX2", + "tooltip": "接收天线名称", + "type": "string" + }, + "rx_bw": { + "default": "1.0,1.0", + "instance_value": "2,2", + "tooltip": "接收滤波器带宽(MHz)", + "type": "double" + }, + "rx_channels": { + "default": "0,1", + "instance_value": "0", + "range": "0,1", + "tooltip": "接收各个通道号", + "type": "int" + }, + "rx_gain": { + "default": "30.0,30.0", + "instance_value": "60", + "range": "0-100", + "tooltip": "接收增益(dB)", + "type": "double" + }, + "rx_on": { + "default": "0", + "instance_value": "1", + "tooltip": "接收开关", + "type": "int" + }, + "rx_rate": { + "default": 1, + "instance_value": "2", + "tooltip": "RX采样率(MHz)", + "type": "int" + }, + "rx_rf": { + "default": "99.0,101.1", + "instance_value": "97.5", + "range": "0-6000", + "tooltip": "接收频率(MHz)", + "type": "double" + }, + "tx_atn": { + "default": "TX/RX,TX/RX", + "instance_value": "TX/RX,TX/RX", + "tooltip": "发射天线名称", + "type": "string" + }, + "tx_bw": { + "default": "1.0,1.0", + "instance_value": "1.0,1.0", + "tooltip": "发射滤波器带宽(MHz)", + "type": "double" + }, + "tx_channels": { + "default": "0,1", + "instance_value": "0,1", + "tooltip": "发射各个通道", + "type": "int" + }, + "tx_gain": { + "default": "30.0,30.0", + "instance_value": "30.0,30.0", + "range": "0-100", + "tooltip": "发射增益(dB)", + "type": "double" + }, + "tx_on": { + "default": 0, + "instance_value": 0, + "tooltip": "发射开关", + "type": "int" + }, + "tx_rate": { + "default": 1, + "instance_value": 1, + "tooltip": "TX采样率(MHz)", + "type": "int" + }, + "tx_rf": { + "default": "200.0,203.0", + "instance_value": "200.0,203.0", + "range": "0-6000", + "tooltip": "发射频率(MHz)", + "type": "double" + } + } + } + }, "pos0": { - "x": 1519, - "y": 1375 + "x": 2383, + "y": 1327 }, "pos1": { - "x": 2078, - "y": 1340 + "x": 1810, + "y": 1456 }, "pos2": { - "x": 2383, - "y": 1327 + "x": 2649, + "y": 1412 }, "pos3": { - "x": 1805, - "y": 1467 + "x": 2085, + "y": 1511 }, "pos4": { - "x": 2649, - "y": 1414 + "x": 2378, + "y": 1515 }, "pos5": { - "x": 2085, - "y": 1511 + "x": 1524, + "y": 1246 }, "pos6": { - "x": 2378, - "y": 1518 + "x": 1954, + "y": 1266 }, "pos7": { - "x": 1513, - "y": 1556 + "x": 1522, + "y": 1408 }, "total_mods": 8 } -- GitLab