Odroid H2 HDMI sound

New Odroid-H2 running Debian Stretch but no sound via the HDMI connection even though the device is listed:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

It gives the following message at boot:

$ dmesg | grep hdmi

snd_hda_codec_hdmi hdaudioC0D2: No i915 binding for Intel HDMI/DP codec

This is running the stock stretch kernel of 4.9.0 and it needs a more up to date kernel. So add

deb http://ftp.debian.org/debian stretch-backports main

to

/etc/apt/sources.list

Then do

$ sudo apt-get update
$ sudo apt-get -t stretch-backports upgrade

to upgrade any dependencies

Look for a suitable kernel:

$ aptitude search linux-image

and choose the one with the highest version number to install, eg

$ sudo apt-get -t stretch-backports install linux-image-4.18.0-0.bpo.3-amd64

Then reboot. This seems to change the card name from INTEL to PCH and the following now produces noise from the speakers via the HDMI cable

$ speaker-test -D hdmi:CARD=PCH,DEV=1 -c 2

The warnings about missing firmware seem related to power management and harmless here.