alsa-ucm: Fallback to stereo duplex

If 'PlaybackChannels' and 'CaptureChannels' are absent in the UCM
file for a device, assume the device is stereo duplex.

Reported-by: Luke Yelavich <luke.yelavich@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2013-02-05 09:22:17 +01:00 committed by Tanu Kaskinen
parent 4ffb6fd617
commit 83d44139d3

View file

@ -247,7 +247,12 @@ static int ucm_get_device_property(
}
}
pa_assert(device->playback_channels || device->capture_channels);
if (device->playback_channels == 0 && device->capture_channels == 0) {
pa_log_warn("UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'"
"for device %s, assuming stereo duplex.", device_name);
device->playback_channels = 2;
device->capture_channels = 2;
}
/* get priority of device */
if (device->playback_channels) { /* sink device */