Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partially fix "Dummy" actually using ALSA #2376

Merged
merged 1 commit into from
Nov 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/Mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ class EXPORT Mixer : public QObject
{
return m_audioDevName;
}
inline bool audioDevStartFailed() const
{
return m_audioDevStartFailed;
}

void setAudioDevice( AudioDevice * _dev );
void setAudioDevice( AudioDevice * _dev,
Expand Down Expand Up @@ -421,6 +425,7 @@ class EXPORT Mixer : public QObject
AudioDevice * m_audioDev;
AudioDevice * m_oldAudioDev;
QString m_audioDevName;
bool m_audioDevStartFailed;

// MIDI device stuff
MidiClient * m_midiClient;
Expand Down
17 changes: 10 additions & 7 deletions src/core/Mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Mixer::Mixer( bool renderOnly ) :
m_masterGain( 1.0f ),
m_audioDev( NULL ),
m_oldAudioDev( NULL ),
m_audioDevStartFailed( false ),
m_globalMutex( QMutex::Recursive ),
m_profiler(),
m_metronomeActive(false)
Expand Down Expand Up @@ -717,10 +718,7 @@ AudioDevice * Mixer::tryAudioDevices()
AudioDevice * dev = NULL;
QString dev_name = ConfigManager::inst()->value( "mixer", "audiodev" );

if( dev_name == AudioDummy::name() )
{
dev_name = "";
}
m_audioDevStartFailed = false;

#ifdef LMMS_HAVE_SDL
if( dev_name == AudioSdl::name() || dev_name == "" )
Expand Down Expand Up @@ -828,9 +826,14 @@ AudioDevice * Mixer::tryAudioDevices()
//}
//delete dev

printf( "No audio-driver working - falling back to dummy-audio-"
"driver\nYou can render your songs and listen to the output "
"files...\n" );
if( dev_name != AudioDummy::name() )
{
printf( "No audio-driver working - falling back to dummy-audio-"
"driver\nYou can render your songs and listen to the output "
"files...\n" );

m_audioDevStartFailed = true;
}

m_audioDevName = AudioDummy::name();

Expand Down
7 changes: 4 additions & 3 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,11 @@ void MainWindow::finalize()
SetupDialog sd;
sd.exec();
}
// look whether mixer could use a audio-interface beside AudioDummy
else if( Engine::mixer()->audioDevName() == AudioDummy::name() )
// look whether mixer failed to start the audio device selected by the
// user and is using AudioDummy as a fallback
else if( Engine::mixer()->audioDevStartFailed() )
{
// no, so we offer setup-dialog with audio-settings...
// if so, offer the audio settings section of the setup dialog
SetupDialog sd( SetupDialog::AudioSettings );
sd.exec();
}
Expand Down