Discussion:
Enabling (HDMI) audio on rk3328/rk3399 (Rock64/RockPro64)
(too old to reply)
Diederik de Haas
2021-05-02 16:20:02 UTC
Permalink
In order to get better multimedia support in Debian kernels, primarily for
arm64 SBCs, I filed https://bugs.debian.org/987576 requesting
CONFIG_SND_AUDIO_GRAPH_CARD to be enabled.

The idea came from seeing an upstream commit titled
"arm64: defconfig: Enable CONFIG_SND_AUDIO_GRAPH_CARD"
and the secondary commit msg is
"CONFIG_SND_AUDIO_GRAPH_CARD is needed to use HDMI sound with video"

What was meant as a general improvement with only 'sideways' my Rock64 device
in mind, turned into something specific for Rock64.
https://salsa.debian.org/kernel-team/linux/-/merge_requests/351 is where the
'action' is taking place.
In it, Salvatore Bonaccorso made a (very) reasonable request to ask for
validation on real devices before enabling it in the Debian kernel(s).

A crucial element looks to be to enable 2 settings in the device tree
(https://salsa.debian.org/kernel-team/linux/-/merge_requests/351#note_238470)
# fdtput -t s /boot/dtbs/rockchip/rk3328-rock64.dtb /hdmi-sound status okay
# fdtput -t s /boot/dtbs/rockchip/rk3328-rock64.dtb /***@ff000000 status okay
(Old value is "disabled")

I can/will test to see what else is needed to get it to work on my Rock64.
But those settings are actually in rk3328.dtsi. And there is a similar file
rk3399.dtsi where it seems the same (simple) change is needed.
And that would mean that HDMI audio would work on all (?) rk3328 and rk3399
devices.

But for that to happen, I need someone with a RockPro64 device who is willing
to join in and validate that the changes do indeed also work on a RockPro64.

Who can and is willing to help?

Cheers,
Diederik
Punit Agrawal
2021-05-10 11:40:01 UTC
Permalink
Not sure if it's still helpful but ...

Diederik de Haas <***@cknow.org> writes:

[...]
Post by Diederik de Haas
A crucial element looks to be to enable 2 settings in the device tree
(https://salsa.debian.org/kernel-team/linux/-/merge_requests/351#note_238470)
# fdtput -t s /boot/dtbs/rockchip/rk3328-rock64.dtb /hdmi-sound status okay
(Old value is "disabled")
The board is already using device tree from upstream kernels so I didn't
have to mess with them to enable the devices. I checked the nodes with
fdtget and they showed status "okay" for both the nodes.
Post by Diederik de Haas
I can/will test to see what else is needed to get it to work on my Rock64.
But those settings are actually in rk3328.dtsi. And there is a similar file
rk3399.dtsi where it seems the same (simple) change is needed.
And that would mean that HDMI audio would work on all (?) rk3328 and rk3399
devices.
But for that to happen, I need someone with a RockPro64 device who is willing
to join in and validate that the changes do indeed also work on a RockPro64.
Who can and is willing to help?
On my RockPro64 and see the following output -

rockpro64:~$ uname -a
Linux rockpro64 5.10.0-6-arm64 #1 SMP Debian 5.10.28-1 (2021-04-09) aarch64 GNU/Linux

rockpro64:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: hdmisound [hdmi-sound], device 0: ff8a0000.i2s-i2s-hifi i2s-hifi-0 [ff8a0000.i2s-i2s-hifi i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

rockpro64:~$ grep SND_AUDIO /boot/config-5.10.0-6-arm64
# CONFIG_SND_AUDIO_GRAPH_CARD is not set

It seems the config doesn't need enabling for sound on this
device at least.

Hope this helps.

Punit
Diederik de Haas
2021-05-10 13:30:01 UTC
Permalink
Post by Punit Agrawal
Not sure if it's still helpful but ...
Yes it is, thanks :)
Post by Punit Agrawal
The board is already using device tree from upstream kernels so I didn't
have to mess with them to enable the devices. I checked the nodes with
fdtget and they showed status "okay" for both the nodes.
Excellent.
I made the request without doing ('proper') research into rk3399/RockPro64,
but I just took a look based on your msg and it appears that the dts[i] files
for rk3399/RockPro64 are far more 'evolved' (more detailed/enabled nodes).
Post by Punit Agrawal
Post by Diederik de Haas
But those settings are actually in rk3328.dtsi. And there is a similar
file rk3399.dtsi where it seems the same (simple) change is needed.
Since my initial email I've become slightly less noob-ish, so for the other
noobs trying to learn about DTs, here's a correction. (Hopefully correct ;))

You (normally) wouldn't change those general files, but 'override' them
in board specific files like rk3328-rock64.dts where you reference the
nodes defined in those general files.
Programmers analogy: you don't change the class definition, but change
the (board) implementation.
Post by Punit Agrawal
On my RockPro64 and see the following output -
rockpro64:~$ uname -a
Linux rockpro64 5.10.0-6-arm64 #1 SMP Debian 5.10.28-1 (2021-04-09) aarch64 GNU/Linux
rockpro64:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: hdmisound [hdmi-sound], device 0: ff8a0000.i2s-i2s-hifi
i2s-hifi-0 [ff8a0000.i2s-i2s-hifi i2s-hifi-0] Subdevices: 1/1
Subdevice #0: subdevice #0
rockpro64:~$ grep SND_AUDIO /boot/config-5.10.0-6-arm64
# CONFIG_SND_AUDIO_GRAPH_CARD is not set
It seems the config doesn't need enabling for sound on this
device at least.
Awesome.
Apparently some use audio-graph-card while others use simple-audio-card and
in kernel 5.12 the Rock64 switches from one to the other:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=25572fb5aa986bdbb35d06c0fb52a9b9d9b3b2c9

"For newly adding nodes, ASoC guys recommend to use audio-graph-card.
But all other sound nodes for rk3328 have already been defined by
simple-audio-card. In this time, I chose for consistent sound nodes."

I may be wrong here, but it appears that for the Rock64, 'audio-graph-card' is
used for 'sound' while 'simple-audio-card' is used for 'hdmi-sound'.

So, to get "better multimedia support in Debian kernels" it very much appears
that having both 'simple-audio-card' and 'audio-graph-card' seems desirable.

Cheers,
Diederik
Diederik de Haas
2021-05-10 13:30:02 UTC
Permalink
Post by Diederik de Haas
I may be wrong here, but it appears that for the Rock64, 'audio-graph-card'
is used for 'sound' while 'simple-audio-card' is used for 'hdmi-sound'.
s/Rock64/RockPro64/

Loading...