Onboard bluetooth working for X96 Air

I got the onboard bluetooth working on my X96 Air Q1000 today. It works with my BT keyboard and trackpad under both KDE and GNOME. You can download the dts and dtb from here:

This dts doesn’t enable the onboard audio for me but HDMI audio works as does wifi and gigabit ethernet.

I have been speaking to amlogic kernel dev Neil Armstrong and it sounds like we should be able to get the onboard audio working for boxes like the X96 Air because the Banana PI BPI-M5 has working onboard audio and it uses the same audio codec:

https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git/commit/?h=v5.14/dt64&id=976e920183e406726637db925efdf8b407a2d03a

Neil A:

For audio, no need to port anything everything is upstream already.

But you’ll need some missing patches:
https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git/commit/?h=v5.14/dt64&id=ddbdaa4d596396e3aa0d60a0ab023d19822a3682
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=172dd9216d2b8a3fa162039d89c4361ef35c85ae
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=7487238c5f530b418745ce134d1b0a7fba3a0d8d

and the corresponding DT part is mush more complex to add when you decompiled the DTB to DTS, please restart
from the upstream DTS instead from the linux tree.
The missing bits to enable analog audio from the internal analog DAC are:

+               audio-widgets = "Line", "Lineout";
+               audio-aux-devs = <&tdmout_b>, <&tdmout_c>

+               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+                               "TDM_B Playback", "TDMOUT_B OUT",
+                               "TDMOUT_C IN 0", "FRDDR_A OUT 2",
+                               "TDMOUT_C IN 1", "FRDDR_B OUT 2",
+                               "TDMOUT_C IN 2", "FRDDR_C OUT 2",
+                               "TDM_C Playback", "TDMOUT_C OUT",

+                               "Lineout", "ACODEC LOLP",
+                               "Lineout", "ACODEC LORP";


+               /* 8ch hdmi interface */
+               dai-link-6 {
+                       sound-dai = <&tdmif_b>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec-0 {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+                       };
+
+                       codec-1 {
+                               sound-dai = <&toacodec TOACODEC_IN_B>;
+                       };
+               };
+
+               /* i2s jack output interface */
+               dai-link-7 {
+                       sound-dai = <&tdmif_c>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec-0 {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
+                       };
+
+                       codec-1 {
+                               sound-dai = <&toacodec TOACODEC_IN_C>;
+                       };
+               };


+               /* acodec glue */
+               dai-link-9 {
+                       sound-dai = <&toacodec TOACODEC_OUT>;
+
+                       codec {
+                               sound-dai = <&acodec>;
+                       };
+               };

then

+&acodec {
+       AVDD-supply = <&vddao_1v8>;
+       status = "okay";
+};

+&tdmif_b {
+       status = "okay";
+};
+
+&tdmif_c {
+       status = "okay";
+};

+&toacodec {
+       status = "okay";
+};

This board has analog audio working for example:
https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git/commit/?h=v5.14/dt64&id=976e920183e406726637db925efdf8b407a2d03a

Has anyone tried this on a X96 Air P3 box? If it works then can they provide a link to all the necessary files to have everything working.on this box. Thanks in advance.

This dts won’t work to enable BT for the X96 Air p3. The Q1000 uses the Cdtech 4761743 wifi chip whereas the p3 uses the RTL8822CS.

You have to install an extra kernel module to get the RTL8822CS wifi and BT working. Someone has posted an Arch package for this on the forum but it wasn’t uploaded to the AUR last time I checked.

Thank-you Danboid

1 Like