AESinkALSA: fix enumeration of cards without front devices #15774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
ALSA cards don't have necessarily a front device, alsa-lib creates
a default (plus sysdefault) PCM using plughw for cards without an
alsa card conf file.
So we shouldn't skip the sysdefault PCM in enumeration, otherwise
the cards aren't listed.
For cards with front/surround PCMs the sysdefault entry should
be dropped though, as the surround mangling "@" entry also handles
sysdefault and the separate entry in the device list would be
confusing to users.
Motivation and Context
ALSA cards without a front device were missing in the list of audio devices, see #15757 for details
How Has This Been Tested?
Kodi master branch on Raspbian Stretch running on a Raspberry Pi 3B+ with 3 ALSA devices: on-board bcm2835 audio, Cirrus Logic Audio Card (with an ALSA card conf to create the iec958 PCM), USB audio device with TI/Burr Brown chip (stock alsa card conf creates front and surround PCMs).
aplay -L output: http://ix.io/1DWL
kodi log: http://ix.io/1DWM
LibreELEC master branch, using Kodi 18.1 with popcornmix's RPi patches and this PR and same ALSA setup as above
aplay -L output: http://ix.io/1DWO
kodi log http://ix.io/1DWV
As a comparison LibreELEC 9.0.1 without this PR shows the RPi-Cirrus Analog device missing in the list
kodi log: http://ix.io/1DWP
Types of change
Checklist:
ping @fritsch