mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 23:31:53 -05:00
Print the number of PulseAudio input channels when in verbose mode
This is useful information to have for troubleshooting, and it's
said to sidestep a possible race condition issue that breaks
microphone recording on Linux.
(cherry picked from commit de912a8bd9)
This commit is contained in:
committed by
Rémi Verschelde
parent
d1df89a695
commit
9853108a4f
@@ -191,7 +191,7 @@ Error AudioDriverPulseAudio::init_device() {
|
|||||||
Error err = detect_channels();
|
Error err = detect_channels();
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
// This most likely means there are no sinks.
|
// This most likely means there are no sinks.
|
||||||
ERR_PRINT("PulseAudio: init device failed to detect number of channels");
|
ERR_PRINT("PulseAudio: init device failed to detect number of output channels");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ Error AudioDriverPulseAudio::init_device() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
WARN_PRINT("PulseAudio: Unsupported number of channels: " + itos(pa_map.channels));
|
WARN_PRINT("PulseAudio: Unsupported number of output channels: " + itos(pa_map.channels));
|
||||||
pa_channel_map_init_stereo(&pa_map);
|
pa_channel_map_init_stereo(&pa_map);
|
||||||
channels = 2;
|
channels = 2;
|
||||||
break;
|
break;
|
||||||
@@ -221,8 +221,8 @@ Error AudioDriverPulseAudio::init_device() {
|
|||||||
buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
|
buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
|
||||||
pa_buffer_size = buffer_frames * pa_map.channels;
|
pa_buffer_size = buffer_frames * pa_map.channels;
|
||||||
|
|
||||||
print_verbose("PulseAudio: detected " + itos(pa_map.channels) + " channels");
|
print_verbose("PulseAudio: detected " + itos(pa_map.channels) + " output channels");
|
||||||
print_verbose("PulseAudio: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
|
print_verbose("PulseAudio: audio buffer frames: " + itos(buffer_frames) + " calculated output latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
|
||||||
|
|
||||||
pa_sample_spec spec;
|
pa_sample_spec spec;
|
||||||
spec.format = PA_SAMPLE_S16LE;
|
spec.format = PA_SAMPLE_S16LE;
|
||||||
@@ -691,6 +691,8 @@ Error AudioDriverPulseAudio::capture_init_device() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_verbose("PulseAudio: detected " + itos(pa_rec_map.channels) + " input channels");
|
||||||
|
|
||||||
pa_sample_spec spec;
|
pa_sample_spec spec;
|
||||||
|
|
||||||
spec.format = PA_SAMPLE_S16LE;
|
spec.format = PA_SAMPLE_S16LE;
|
||||||
|
|||||||
Reference in New Issue
Block a user