[Hit return to continue]

изменено:      Source/bin/settings.ini
	изменено:      Source/bin/windowsSettings.ini
	изменено:      Source/cudaSDR.pro.user
	изменено:      Source/src/DataEngine/soundout.cpp
	изменено:      Source/src/DataEngine/soundout.h
This commit is contained in:
2020-07-16 14:06:19 +03:00
parent 6fa4b85d2c
commit 16cca9f8e5
5 changed files with 103 additions and 69 deletions
+9 -4
View File
@@ -84,6 +84,7 @@ CSoundOut::~CSoundOut()
Stop();
}
#if defined(Q_OS_LINUX)
void GetAlsaMasterVolume(long *volume)
{
long min, max;
@@ -130,7 +131,7 @@ void SetAlsaMasterVolume(long volume)
snd_mixer_close(handle);
}
#endif
/////////////////////////////////////////////////////////////////////
// Starts up soundcard output thread using soundcard at list OutDevIndx
/////////////////////////////////////////////////////////////////////
@@ -143,8 +144,10 @@ QAudioDeviceInfo DeviceInfo;
//Get required soundcard from list
m_OutDevices = DeviceInfo.availableDevices(QAudio::AudioOutput);
if (-1 == OutDevIndx) GetAlsaMasterVolume(&mvolume);
qDebug()<<"Soundcard volume" << mvolume;
#if defined(Q_OS_LINUX)
if (-1 == OutDevIndx) GetAlsaMasterVolume(&mvolume);
#endif
qDebug()<<"Soundcard volume" << mvolume;
if (-1 == OutDevIndx) m_OutDeviceInfo = QAudioDeviceInfo::defaultOutputDevice();
else m_OutDeviceInfo = m_OutDevices.at(OutDevIndx);
@@ -184,9 +187,11 @@ QAudioDeviceInfo DeviceInfo;
ChangeUserDataRate(UsrDataRate);
m_pOutput = m_pAudioOutput->start(); //start QT AudioOutput
#if defined(Q_OS_LINUX)
//RRK workaround for default, for some reason choosing default
//sets the master volume to max!
if (-1 == OutDevIndx) SetAlsaMasterVolume(50);
if (-1 == OutDevIndx) SetAlsaMasterVolume(50);
#endif
//determine how long to sleep between low level reads based on samplerate and period size
m_BlockTime = ( 250*m_pAudioOutput->periodSize() )/
+2 -1
View File
@@ -14,9 +14,10 @@
#include <QMutex>
#include <QAudioOutput>
#include "fractresampler.h"
#if defined(Q_OS_LINUX)
#include <alsa/asoundlib.h>
#include <alsa/mixer.h>
#endif
#define OUTQSIZE 16384 //max samples (keep power of 2 for ptr wrap around)
#define SOUND_WRITEBUFSIZE 8192