From dbeefe341f1d7b951d119cd1d58c63970d58cd2c Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Wed, 23 Jul 2025 20:04:09 -0700 Subject: [PATCH] Update AlsaDriver.cpp Set alsa_device_name according to the capture and playback device when configuring streams so error messages reference the correct device Ensure the device name is assigned before opening each stream to accurately report any ALSA errors --- src/AlsaDriver.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index f285ac2..82d491a 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -618,6 +618,7 @@ namespace pipedal if (this->captureHandle) { + this->alsa_device_name = this->jackServerSettings.GetAlsaInputDevice(); AlsaConfigureStream( this->alsa_device_name, "capture", @@ -629,6 +630,7 @@ namespace pipedal } if (this->playbackHandle) { + this->alsa_device_name = this->jackServerSettings.GetAlsaOutputDevice(); AlsaConfigureStream( this->alsa_device_name, "playback", @@ -1234,7 +1236,8 @@ namespace pipedal try { - err = snd_pcm_open(&playbackHandle, outputName.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); + this->alsa_device_name = outputName; + err = snd_pcm_open(&playbackHandle, outputName.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); if (err < 0) { switch (errno) @@ -1268,7 +1271,8 @@ namespace pipedal { snd_pcm_nonblock(playbackHandle, 0); } - + + this->alsa_device_name = inputName; err = snd_pcm_open(&captureHandle, inputName.c_str(), SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK); if (err < 0)