mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-22 15:20:15 +02:00
Detect whether ALSA is the portaudio host (possible only on Linux)
This commit is contained in:
parent
428f543677
commit
a971dd5bb4
@ -1678,6 +1678,12 @@ int AudioIO::StartStream(const ConstWaveTrackArray &playbackTracks,
|
|||||||
wxMilliSleep( 50 );
|
wxMilliSleep( 50 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
// Detect whether ALSA is the chosen host, and do the various involved MIDI
|
||||||
|
// timing compensations only then.
|
||||||
|
mUsingAlsa = (gPrefs->Read(wxT("/AudioIO/Host"), wxT("")) == "ALSA");
|
||||||
|
#endif
|
||||||
|
|
||||||
gPrefs->Read(wxT("/AudioIO/SWPlaythrough"), &mSoftwarePlaythrough, false);
|
gPrefs->Read(wxT("/AudioIO/SWPlaythrough"), &mSoftwarePlaythrough, false);
|
||||||
gPrefs->Read(wxT("/AudioIO/SoundActivatedRecord"), &mPauseRec, false);
|
gPrefs->Read(wxT("/AudioIO/SoundActivatedRecord"), &mPauseRec, false);
|
||||||
int silenceLevelDB;
|
int silenceLevelDB;
|
||||||
@ -2033,8 +2039,7 @@ int AudioIO::StartStream(const ConstWaveTrackArray &playbackTracks,
|
|||||||
// (Which we should be able to determine from fields of
|
// (Which we should be able to determine from fields of
|
||||||
// PaStreamCallbackTimeInfo, but that seems not to work as documented with
|
// PaStreamCallbackTimeInfo, but that seems not to work as documented with
|
||||||
// ALSA.)
|
// ALSA.)
|
||||||
wxString hostName = gPrefs->Read(wxT("/AudioIO/Host"), wxT(""));
|
if (mUsingAlsa)
|
||||||
if (hostName == "ALSA")
|
|
||||||
// Perhaps we should do this only if also playing MIDI ?
|
// Perhaps we should do this only if also playing MIDI ?
|
||||||
PaAlsa_EnableRealtimeScheduling( mPortStreamV19, 1 );
|
PaAlsa_EnableRealtimeScheduling( mPortStreamV19, 1 );
|
||||||
#endif
|
#endif
|
||||||
|
@ -727,6 +727,8 @@ private:
|
|||||||
|
|
||||||
const TimeTrack *mTimeTrack;
|
const TimeTrack *mTimeTrack;
|
||||||
|
|
||||||
|
bool mUsingAlsa { false };
|
||||||
|
|
||||||
// For cacheing supported sample rates
|
// For cacheing supported sample rates
|
||||||
static int mCachedPlaybackIndex;
|
static int mCachedPlaybackIndex;
|
||||||
static wxArrayLong mCachedPlaybackRates;
|
static wxArrayLong mCachedPlaybackRates;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user