Don't segfault: make sure that the audio device is open before we write to it. --- a/src/AudioController.cpp +++ b/src/AudioController.cpp @@ -134,6 +134,9 @@ this, SLOT ( onTimerTimeout() ), Qt::DirectConnection ); + // loadPlugins() gets m_output, the above connects its signal, NOW we can call setDevice() + m_output->setBufferCapacity( kOutputBufferMinSize ); + m_output->setDevice( The::settings().soundCard() ); // What is this interval exactly? // It's how often we send out timeChanged signals (500 ms) @@ -179,9 +182,6 @@ if ( m_output == 0 ) return false; - m_output->setBufferCapacity( kOutputBufferMinSize ); - m_output->setDevice( The::settings().soundCard() ); - m_proxyOutput = new ProxyOutput(); return true; --- a/src/Radio.cpp +++ b/src/Radio.cpp @@ -654,7 +654,7 @@ } else { - if ( err == Radio_PluginLoadFailed ) + if ( err == Radio_PluginLoadFailed || err == Radio_NoSoundcard ) { m_broken = true; } --- a/src/container.cpp +++ b/src/container.cpp @@ -79,6 +79,7 @@ Container::Container() : QMainWindow(), m_userCheck( false ), + m_soundcardError( false ), m_sidebarEnabled( false ), m_sidebarWidth( 190 ) #ifndef Q_WS_MAC @@ -798,6 +799,7 @@ case Handshake_SessionFailed: case Radio_PluginLoadFailed: case Radio_NoSoundcard: + m_soundcardError = true; case Radio_PlaybackError: case Radio_UnknownError: { @@ -1987,8 +1989,11 @@ default: { - ui.actionPlay->setEnabled( true ); - ui.actionStop->setEnabled( true ); + if ( !m_soundcardError ) + { + ui.actionPlay->setEnabled( true ); + ui.actionStop->setEnabled( true ); + } } break; } --- a/src/container.h +++ b/src/container.h @@ -108,6 +108,7 @@ class DiagnosticsDialog *m_diagnosticsDialog; bool m_userCheck; + bool m_soundcardError; bool m_sidebarEnabled; int m_lastVolume; int m_sidebarWidth;