diff --git a/server/scsynth/SC_PortAudio.cpp b/server/scsynth/SC_PortAudio.cpp index f338ce412c6..f42b24d563a 100644 --- a/server/scsynth/SC_PortAudio.cpp +++ b/server/scsynth/SC_PortAudio.cpp @@ -278,18 +278,28 @@ bool SC_PortAudioDriver::DriverSetup(int* outNumSamples, double* outSampleRate) pdi->maxInputChannels, pdi->maxOutputChannels); } - mDeviceInOut[0] = GetPaDeviceFromName(mWorld->hw->mInDeviceName, true); - mDeviceInOut[1] = GetPaDeviceFromName(mWorld->hw->mOutDeviceName, false); + auto* inDeviceName = mWorld->hw->mInDeviceName; + auto* outDeviceName = mWorld->hw->mOutDeviceName; + mDeviceInOut[0] = GetPaDeviceFromName(inDeviceName, true); + mDeviceInOut[1] = GetPaDeviceFromName(outDeviceName, false); // report requested devices fprintf(stdout, "\nRequested devices:\n"); if (mWorld->mNumInputs) { - fprintf(stdout, " In (matching device %sfound):\n - %s\n", (mDeviceInOut[0] == paNoDevice ? "NOT " : ""), - mWorld->hw->mInDeviceName); + auto nameIsEmpty = (inDeviceName && !inDeviceName[0]) || (inDeviceName == nullptr); + fprintf(stdout, " In%s:\n - %s\n", + nameIsEmpty + ? "" + : (mDeviceInOut[0] == paNoDevice ? " (matching device NOT found)" : " (matching device found)"), + (nameIsEmpty ? "(default)" : inDeviceName)); } if (mWorld->mNumOutputs) { - fprintf(stdout, " Out (matching device %sfound):\n - %s\n", (mDeviceInOut[1] == paNoDevice ? "NOT " : ""), - mWorld->hw->mOutDeviceName); + auto nameIsEmpty = (outDeviceName && !outDeviceName[0]) || (outDeviceName == nullptr); + fprintf(stdout, " Out%s:\n - %s\n", + nameIsEmpty + ? "" + : (mDeviceInOut[1] == paNoDevice ? " (matching device NOT found)" : " (matching device found)"), + (nameIsEmpty ? "(default)" : outDeviceName)); } fprintf(stdout, "\n"); diff --git a/server/supernova/server/main.cpp b/server/supernova/server/main.cpp index 0bf380202f9..5fdadba6323 100644 --- a/server/supernova/server/main.cpp +++ b/server/supernova/server/main.cpp @@ -172,9 +172,11 @@ void start_audio_backend(server_arguments const& args) { if (output_channels == 0) output_device.clear(); - std::cout << "Requested audio devices:\n"; - std::cout << " In: " << input_device << "\n"; - std::cout << " Out: " << output_device << std::endl; + std::cout << "Requested audio devices:" << std::endl; + if (input_channels) + std::cout << " In: " << (input_device.empty() ? "(default)" : input_device) << std::endl; + if (output_channels) + std::cout << " Out: " << (output_device.empty() ? "(default)" : output_device) << std::endl; bool success = instance->open_stream(input_device, input_channels, output_device, output_channels, args.samplerate, args.blocksize, args.hardware_buffer_size);