alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
364 stars 177 forks source link

conf: add support for Amlogic AIU and AXG cards #308

Open chewitt opened 1 year ago

chewitt commented 1 year ago

This submission adds generic card confs for the Amlogic AIU and AXG audio cards. AIU is used with GXBB/GXL/GXM boards and supports HDMI and hinted S/PDIF output. The AXG conf is used with G12A/G12B/SM1 boards and supports HDMI only output. Hinting S/PDIF support does not work with AXG due to the card always presenting three outputs (with internal routing controlling what they are) so the hint always returns true.

This is an AIU device with HDMI and S/PDIF hardware:

WP2:~ # aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=WETEKPLAY2
    WETEK-PLAY2, 
    Default Audio Device
sysdefault:CARD=WETEKPLAY2
    WETEK-PLAY2, 
    Default Audio Device
iec958:CARD=WETEKPLAY2,DEV=0
    WETEK-PLAY2, 
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=WETEKPLAY2,DEV=0
    WETEK-PLAY2, 
    HDMI Audio Output
WP2:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: WETEKPLAY2 [WETEK-PLAY2], device 0: fe.dai-link-0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: WETEKPLAY2 [WETEK-PLAY2], device 1: fe.dai-link-1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

This is an AXG device with HDMI only hardware:

N2PLUS:~ # aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=ODROIDN2
    ODROID-N2, 
    Default Audio Device
sysdefault:CARD=ODROIDN2
    ODROID-N2, 
    Default Audio Device
hdmi:CARD=ODROIDN2,DEV=0
    ODROID-N2, 
    HDMI Audio Output
N2PLUS:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDN2 [ODROID-N2], device 0: fe.dai-link-0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ODROIDN2 [ODROID-N2], device 1: fe.dai-link-1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ODROIDN2 [ODROID-N2], device 2: fe.dai-link-2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The confs have been in use with the Kodi distro LibreELEC for around two years and other distros supporting Amlogic boards on upstream kernels (Armbian, Manjaro, etc.) have borrowed them from our repo too. The prime reason for submitting them is to allow everyone to drop some patches. Although the confs are known-working it would be great if someone with better alsa knowlege than myself could vet them for correctness.

ping @jeromebrunet for awareness