mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
alsa-ucm: correct the channel default logic (stereo)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
ef8a302d6b
commit
cabd387e26
1 changed files with 10 additions and 3 deletions
|
|
@ -377,6 +377,13 @@ static int ucm_get_device_property(
|
||||||
pa_log("UCM playback device %s fetch pcm failed", device_name);
|
pa_log("UCM playback device %s fetch pcm failed", device_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SINK) &&
|
||||||
|
device->playback_channels == 0) {
|
||||||
|
pa_log("UCM file does not specify 'PlaybackChannels' "
|
||||||
|
"for device %s, assuming stereo duplex.", device_name);
|
||||||
|
device->playback_channels = 2;
|
||||||
|
}
|
||||||
|
|
||||||
value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_CAPTURE_CHANNELS);
|
value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_CAPTURE_CHANNELS);
|
||||||
if (value) { /* input */
|
if (value) { /* input */
|
||||||
/* get channels */
|
/* get channels */
|
||||||
|
|
@ -391,10 +398,10 @@ static int ucm_get_device_property(
|
||||||
pa_log("UCM capture device %s fetch pcm failed", device_name);
|
pa_log("UCM capture device %s fetch pcm failed", device_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device->playback_channels == 0 && device->capture_channels == 0) {
|
if (pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SOURCE) &&
|
||||||
pa_log_warn("UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'"
|
device->capture_channels == 0) {
|
||||||
|
pa_log("UCM file does not specify 'CaptureChannels' "
|
||||||
"for device %s, assuming stereo duplex.", device_name);
|
"for device %s, assuming stereo duplex.", device_name);
|
||||||
device->playback_channels = 2;
|
|
||||||
device->capture_channels = 2;
|
device->capture_channels = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue