1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

Compare commits

...

7 Commits

Author SHA1 Message Date
dforsi
652a03b366
Merge efd98785cf into fcd43df711 2024-08-03 14:32:52 +02:00
Edouard Griffiths
fcd43df711
Merge pull request #2225 from james-pcdr/patch-2
Update scanner.py: fix print to stderr
2024-08-03 03:00:40 +02:00
Edouard Griffiths
ff7c06311b
Merge pull request #2226 from jfdelnero/master
Fix audio glitches in the DAB plugin
2024-08-02 18:56:01 +02:00
Jean-François DEL NERO
5888645957 Don't decimate the audio signal if not needed. 2024-08-02 12:23:27 +02:00
Jean-François DEL NERO
2fddaff6d2 Fix audio glitches in the DAB plugin.
The glitches were generated by an int16 integer overflow.

The issue appeared when the audio was near or at the saturation level.
When the input audio signal is saturated, the polyphase filter based interpolation/decimation functions tend to increase the samples values and then make them pass the int16 limits. The int16 sample scale() parameter defeat the min/max limitation.

This fix removes the intermediate int16 type conversion by using the Complex Real type.

fixes f4exb/sdrangel#1978
2024-08-02 12:17:00 +02:00
james-pcdr
4cf2c0b7c7
Update scanner.py: fix print to stderr 2024-07-31 13:33:28 -04:00
Daniele Forsi
efd98785cf Fix heap-use-after-free
Fixes issue #2059
AddressSanitizer: heap-use-after-free /home/sdrangel/sdrbase/audio/audiofifo.cpp:80 in AudioFifo::write(unsigned char const*, unsigned int)
AddressSanitizer: heap-use-after-free /home/sdrangel/sdrbase/audio/audiofifo.h:49 in AudioFifo::fill() const
2024-06-01 12:05:49 +02:00
4 changed files with 8 additions and 5 deletions

View File

@ -366,7 +366,7 @@ void DABDemodSink::tii(int tii)
}
}
static int16_t scale(int16_t sample, float factor)
static int16_t scale(Real sample, float factor)
{
int32_t prod = (int32_t)(((int32_t)sample) * factor);
prod = std::min(prod, 32767);
@ -403,7 +403,12 @@ void DABDemodSink::audio(int16_t *buffer, int size, int samplerate, bool stereo)
ci.real(0.0f);
ci.imag(0.0f);
}
if (m_audioInterpolatorDistance < 1.0f) // interpolate
if (m_audioInterpolatorDistance == 1.0f)
{
processOneAudioSample(ci);
}
else if (m_audioInterpolatorDistance < 1.0f) // interpolate
{
while (!m_audioInterpolator.interpolate(&m_audioInterpolatorDistanceRemain, ci, &ca))
{

View File

@ -217,7 +217,6 @@ void AudioOutput::applySettings(const AudioOutputSettings& settings, const QList
m_audioDeviceIndex = audioDeviceManager->getOutputDeviceIndex(settings.m_deviceName);
//qDebug("AMDemod::applySettings: audioDeviceName: %s audioDeviceIndex: %d", qPrintable(settings.m_audioDeviceName), audioDeviceIndex);
audioDeviceManager->removeAudioSink(&m_audioFifo);
audioDeviceManager->addAudioSink(&m_audioFifo, getInputMessageQueue(), m_audioDeviceIndex);
m_sampleRate = audioDeviceManager->getOutputSampleRate(m_audioDeviceIndex);
forwardChange = true;
}

View File

@ -250,7 +250,6 @@ void AudioInput::applySettings(const AudioInputSettings& settings, QList<QString
}
audioDeviceManager->removeAudioSource(&m_fifo);
audioDeviceManager->addAudioSource(&m_fifo, getInputMessageQueue(), m_audioDeviceIndex);
m_sampleRate = audioDeviceManager->getInputSampleRate(m_audioDeviceIndex);
qDebug("AudioInput::applySettings: audioDeviceName: %s audioDeviceIndex: %d sampleRate: %d",
qPrintable(settings.m_deviceName), m_audioDeviceIndex, m_sampleRate);

View File

@ -373,7 +373,7 @@ def main():
pass
except Exception as ex:
tb = traceback.format_exc()
print >> sys.stderr, tb
print(tb, file=sys.stderr)
if __name__ == "__main__":