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
This commit is contained in:
Extremesecrecy
2025-07-23 20:04:09 -07:00
parent ad22489be7
commit dbeefe341f
+6 -2
View File
@@ -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)