I thought some stupidity on my side for a while: At some point the PROJECT=Allwinner ARCH=arm DEVICE=H3 UBOOT_SYSTEM="orangepi-pc" make image doesn't generate bootable sd card images any more. I was just using some previously written card with an older image and just exchanged the KERNEL and SYSTEM with the newly compiled one (on the first partition). Which works without any problems. Only problem: It is quite tedious (slow) to clone a card to get a fresh booting version that way. Diffing the scripts/(mk)image files there are some changes ... but they do not look very dramatic to me. Any ideas? Thank you!
Posts by ds000
-
-
-
I just took the patch from an earlier kernel (which fixed the aforementioned problem):
Diff
Display MoreFrom 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec <[email protected]> Date: Mon, 11 Oct 2021 20:13:41 +0200 Subject: [PATCH] HACK: SW CEC implementation for H3 Many H3 boards lack 32768 Hz external oscillator, so internal RC is used instead. However, it's too unstable for CEC. Use SW implementation instead. That makes it usable, albeit sensitive to cpufreq changes. Signed-off-by: Jernej Skrabec <[email protected]> --- drivers/gpu/drm/sun4i/Kconfig | 2 + drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 13 ++++ drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c | 83 +++++++++++++++++++++++++- 3 files changed, 96 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/Kconfig b/drivers/gpu/drm/sun4i/Kconfig index 5755f0432e77..b93eb2fb52ce 100644 --- a/drivers/gpu/drm/sun4i/Kconfig +++ b/drivers/gpu/drm/sun4i/Kconfig @@ -56,6 +56,8 @@ config DRM_SUN8I_DW_HDMI tristate "Support for Allwinner version of DesignWare HDMI" depends on DRM_SUN4I select DRM_DW_HDMI + select CEC_CORE + select CEC_PIN help Choose this option if you have an Allwinner SoC with the DesignWare HDMI controller with custom HDMI PHY. If M is diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h index bffe1b9cd3dc..61c97619cba1 100644 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h @@ -13,6 +13,8 @@
maybe, this was not the brightest idea
-
I was distracted with other stuff and boards for a while: Came back to the Orange Pi PC. The new images work really great. Unfortunately the patch for software CEC does not work any more, running the build linux throws a message that it assumes the patch was already applied. Same state with the Sony (non-working) and Samsung TVs like before, but without the mitigation option.
-
I was looking into a bit similar problem. As stated above, the magic is the device tree (overlay). It is required to get the pin routing right, here the newer kernels and dts need to work together properly. For getting e.g. SPDIF output to work, I had to modify the device tree file to actually enable it (creating packages/linux/patches/default/linux-080-odroid-c2.patch):
Diff
Display More--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2-unpatched.dts 2023-11-05 01:19:49.197991036 +0100 +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts 2023-11-05 01:29:18.041481346 +0100 @@ -174,6 +174,13 @@ }; }; + spdif_dit: audio-codec-0 { + #sound-dai-cells = <0>; + compatible = "linux,spdif-dit"; + status = "okay"; + sound-name-prefix = "DIT"; + }; + sound { compatible = "amlogic,gx-sound-card"; model = "ODROID-C2"; @@ -184,33 +191,46 @@ assigned-clock-rates = <294912000>, <270950400>, <393216000>; - dai-link-0 { - sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; - }; + sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; + }; - dai-link-1 { - sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; - dai-format = "i2s"; - mclk-fs = <256>; - - codec-0 { - sound-dai = <&aiu AIU_HDMI CTRL_I2S>; - }; - }; - - dai-link-2 { - sound-dai = <&aiu AIU_HDMI CTRL_OUT>; - - codec-0 { - sound-dai = <&hdmi_tx>; - }; - }; + dai-link-1 { + sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; + }; + + dai-link-2 { + sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; + dai-format = "i2s"; + mclk-fs = <256>; + + codec-0 { + sound-dai = <&aiu AIU_HDMI CTRL_I2S>; + }; + }; + + dai-link-3 { + sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; + + codec-0 { + sound-dai = <&spdif_dit>; + }; + }; + + dai-link-4 { + sound-dai = <&aiu AIU_HDMI CTRL_OUT>; + + codec-0 { + sound-dai = <&hdmi_tx>; + }; + }; }; }; &aiu { status = "okay"; + pinctrl-0 = <&spdif_out_ao_6_pins &i2s_am_clk_pins &i2s_out_ao_clk_pins &i2s_out_lr_clk_pins &i2s_out_ch01_ao_pins>; + pinctrl-names = "default"; }; &cec_AO { @@ -278,8 +299,8 @@ &gpio_ao { gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En", "USB HUB nRESET", "USB OTG Power En", - "J7 Header Pin2", "IR In", "J7 Header Pin4", - "J7 Header Pin6", "J7 Header Pin5", "J7 Header Pin7", + "SPDIF_OUTPUT", "IR In", "I2S_MCLK", + "I2S_SCLK", "I2S_LRCLK", "I2S_DATA_OUTPUT", "HDMI CEC", "SYS LED", /* GPIO_TEST_N */ "";
That worked for me a couple of month ago, unfortunately I fried my C2 board and thus being unable to test it again. Hope this find someone helpful though ...
-
For getting SPDIF output to work on recent LibreELEC (11.0), I had to modify the device tree file to actually enable it and make it visible to KODI (creating packages/linux/patches/default/linux-080-odroid-c2.patch):
Diff
Display More--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2-unpatched.dts 2023-11-05 01:19:49.197991036 +0100 +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts 2023-11-05 01:29:18.041481346 +0100 @@ -174,6 +174,13 @@ }; }; + spdif_dit: audio-codec-0 { + #sound-dai-cells = <0>; + compatible = "linux,spdif-dit"; + status = "okay"; + sound-name-prefix = "DIT"; + }; + sound { compatible = "amlogic,gx-sound-card"; model = "ODROID-C2"; @@ -184,33 +191,46 @@ assigned-clock-rates = <294912000>, <270950400>, <393216000>; - dai-link-0 { - sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; - }; + sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; + }; - dai-link-1 { - sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; - dai-format = "i2s"; - mclk-fs = <256>; - - codec-0 { - sound-dai = <&aiu AIU_HDMI CTRL_I2S>; - }; - }; - - dai-link-2 { - sound-dai = <&aiu AIU_HDMI CTRL_OUT>; - - codec-0 { - sound-dai = <&hdmi_tx>; - }; - }; + dai-link-1 { + sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; + }; + + dai-link-2 { + sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; + dai-format = "i2s"; + mclk-fs = <256>; + + codec-0 { + sound-dai = <&aiu AIU_HDMI CTRL_I2S>; + }; + }; + + dai-link-3 { + sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; + + codec-0 { + sound-dai = <&spdif_dit>; + }; + }; + + dai-link-4 { + sound-dai = <&aiu AIU_HDMI CTRL_OUT>; + + codec-0 { + sound-dai = <&hdmi_tx>; + }; + }; }; }; &aiu { status = "okay"; + pinctrl-0 = <&spdif_out_ao_6_pins &i2s_am_clk_pins &i2s_out_ao_clk_pins &i2s_out_lr_clk_pins &i2s_out_ch01_ao_pins>; + pinctrl-names = "default"; }; &cec_AO { @@ -278,8 +299,8 @@ &gpio_ao { gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En", "USB HUB nRESET", "USB OTG Power En", - "J7 Header Pin2", "IR In", "J7 Header Pin4", - "J7 Header Pin6", "J7 Header Pin5", "J7 Header Pin7", + "SPDIF_OUTPUT", "IR In", "I2S_MCLK", + "I2S_SCLK", "I2S_LRCLK", "I2S_DATA_OUTPUT", "HDMI CEC", "SYS LED", /* GPIO_TEST_N */ "";
That worked for me a couple of month ago with SPDIF, unfortunately fried the board, thus unable to test it again.
-
-
-
-
The Allwinner H3 support on the Orange Pi PC matured a lot over the years, appreciate that! Unfortunately the once perfectly working CEC control somehow degraded in newer versions. I checked the older 10.X standard image available for direct download - working like a charm. In 11.0 and the development branch it is really sluggish for SONY KDL50W805B (works perfect for some older SAMSUNG model):
- In many cases it switches the TV (SONY FullHD, 5y) on and switches to the proper HDMI
- The message that the CEC adapter got recognized takes longer to appear compared to 10.X version (in kodi main screen)
- Sometimes the Orange Pi reacts to key presses on the TV remote, often not. Usually, double presses do not get recognized. If running for a while, nothing happens any more
- When switching off kodi and getting down to the commandline (cec-ctl) it won't react as well
- I checked CPU frequencies and scaling governors if they could have an impact on that - no changes in behavior
Other devices like a Pine Rock64 work with the newest version without problems.
From cec-ctl I get (kodi stopped to avoid blocking of the device):
Code
Display MoreLibreELEC:~ # cec-ctl -d/dev/cec0 --to 0 --standby Driver Info: Driver Name : sun8i-dw-hdmi Adapter Name : dw_hdmi Capabilities : 0x0000010e Logical Addresses Transmit Passthrough Connector Info Driver version : 6.1.19 Available Logical Addresses: 4 DRM Connector Info : card 0, connector 51 Physical Address : 4.0.0.0 Logical Address Mask : 0x0100 CEC Version : 2.0 Vendor ID : 0x000c03 (HDMI) OSD Name : 'Playback' Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 8 (Playback Device 2) Primary Device Type : Playback Logical Address Type : Playback All Device Types : Playback RC TV Profile : None Device Features : None Transmit from Playback Device 2 to TV (8 to 0): STANDBY (0x36) Sequence: 150 Tx Timestamp: 860.150555s Tx, Not Acknowledged (4), Max Retries
I can provide the kodi debug messages for CEC, but they pretty much say the same as for the command line tool.
I checked for differences in the kernel code for CEC, didn't see much changes here from the kernel used in 10.X and the latest ones (I'm not an expert though). I've no idea what might influence the CEC implementation showing such effects Any ideas where to look for a solution/fix?
I'd like to do some minor modifications to the image and thus compile the package by my self. Works perfectly for 11.0 and the latest stuff, but not for 10.X any more.
Thank you!