Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enabling (HDMI) audio on rk3328/rk3399 (Rock64/RockPro64)

222 views
Skip to first unread message

Diederik de Haas

unread,
May 2, 2021, 12:20:03 PM5/2/21
to
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 /i2s@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
signature.asc

Punit Agrawal

unread,
May 10, 2021, 7:40:03 AM5/10/21
to

Not sure if it's still helpful but ...

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

[...]

> 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 /i2s@ff000000 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.

> 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

unread,
May 10, 2021, 9:30:03 AM5/10/21
to
On maandag 10 mei 2021 13:12:12 CEST Punit Agrawal wrote:
> Not sure if it's still helpful but ...

Yes it is, thanks :)

> 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).

> Diederik de Haas <didi....@cknow.org> writes:
> > 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.

> 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
signature.asc

Diederik de Haas

unread,
May 10, 2021, 9:30:03 AM5/10/21
to
On maandag 10 mei 2021 15:17:24 CEST Diederik de Haas wrote:
> 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/
signature.asc
0 new messages