ilyakurdyukov / rk3528-tvbox

Armbian config for RK3528 TV-boxes
34 stars 6 forks source link

about hdmi sound! #6

Open sputnik2019 opened 3 months ago

sputnik2019 commented 3 months ago

try it!

hdmi_sound: hdmi-sound {
    status = "okay";
    compatible = "simple-audio-card";
    simple-audio-card,format = "i2s";
    simple-audio-card,mclk-fs = <128>;
    simple-audio-card,name = "rockchip-hdmi0";
    simple-audio-card,cpu {
        sound-dai = <&sai3>;
    };
    simple-audio-card,codec {
        sound-dai = <&hdmi>;
    };
};
ilyakurdyukov commented 3 months ago

Did this work for you? I tried a lot of such things and nothing worked.

sputnik2019 commented 3 months ago

Did this work for you? I tried a lot of such things and nothing worked.

Please use the latest armbian source build system! modify linux-rk35xx-vendor.config

CONFIG_SND_SOC_ROCKCHIP_SAI is not set

to CONFIG_SND_SOC_ROCKCHIP_SAI=y and modify dts hdmi_sound: hdmi-sound { status = "okay"; compatible = "simple-audio-card"; simple-audio-card,format = "i2s"; simple-audio-card,mclk-fs = <128>; simple-audio-card,name = "rockchip-hdmi0"; simple-audio-card,cpu { sound-dai = <&sai3>; }; simple-audio-card,codec { sound-dai = <&hdmi>; }; }; and build used vendor branch ./compile.sh build BOARD=xxxx BRANCH=vendor

we test hdmi display and hdmi audio is ok!

ilyakurdyukov commented 3 months ago

modify linux-rk35xx-vendor.config

CONFIG_SND_SOC_ROCKCHIP_SAI is not set

to CONFIG_SND_SOC_ROCKCHIP_SAI=y

My patch uses linux-rk3528-tvbox-legacy.config and CONFIG_SND_SOC_ROCKCHIP_SAI=y has set in this config.

Did you use BOARD=rk35xx?

sputnik2019 commented 3 months ago

armbian rockchip 5.10.160 kernel source is old!not sync rk sdk!pls used armbian rk6.1 kernel source https://github.com/armbian/linux-rockchip/tree/rk-6.1-rkr1

ilyakurdyukov commented 3 months ago

armbian rockchip 5.10.160 kernel source is old!not sync rk sdk!pls used armbian rk6.1 kernel source https://github.com/armbian/linux-rockchip/tree/rk-6.1-rkr1

Can you provide the exact parameters of your Armbian build? Armbian scripts show how to reproduce the build. I don't want to guess what exactly you did.

sputnik2019 commented 3 months ago

./compile.sh build BOARD=mangopi-m28k BRANCH=vendor BUILD_DESKTOP=yes BUILD_MINIMAL=no DESKTOP_APPGROUPS_SELECTED= DESKTOP_ENVIRONMENT=xfce DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base KERNEL_CONFIGURE=no RELEASE=jammy

ilyakurdyukov commented 3 months ago

Thanks, I'll try that out. I noticed that there are more recent drivers available for the newer kernel. But for older kernels, only the vendors have the latest fixes. Because of this there are problems with video and wireless network drivers.

sputnik2019 commented 3 months ago

https://github.com/armbian/linux-rockchip/pull/159 https://github.com/armbian/build/pull/6466 The patch is merged

ilyakurdyukov commented 3 months ago

Now the Ethernet port doesn't work with either my .dtb or from mangopi-m28k.

ilyakurdyukov commented 3 months ago

Have you noticed that Rockchip's crappy U-Boot code randomly crashes? I tried using the suggested build for mangopi-m28k and it keeps happening, because I used your unpatched U-Boot branch. Have you read U-Boot crashes after it can't find a boot logo (fixed) in my readme?

sputnik2019 commented 3 months ago

no,maybe different ddr ?Weused lpddr4

ilyakurdyukov commented 3 months ago

no,maybe different ddr ?Weused lpddr4

This is a bug in U-Boot, when Rockchip's code can't find a logo (that can only be found in Android), then after a while the code uses some garbage from memory and crashes. It seems they never properly tested their code in a situation where the logo is missing.

In the UART log it looks like this:

No resource file: 
VP0 fail to load kernel logo
No resource file: 
VP1 fail to load kernel logo
"Synchronous Abort" handler, esr 0x96000010

* Reason:        Exception from a Data abort, from current exception level
* PC         =   000000000024ae84
* LR         =   000000000024356c
* SP         =   00000000f79f8bb0
* ESR_EL2    =   0000000096000010
* Reloc Off  =   00000000f9a57000

If you don't have a UART connected, all you'll see is that Linux won't boot at all.

This reproduces the same thing until you change something, which changes the garbage in memory. And maybe you will be lucky that with other garbage in memory it will not fail.

ilyakurdyukov commented 3 months ago

RK3528 TV-boxes use gmac0, the driver of which is RK630_PHY:

            rmii0_phy: ethernet-phy@2 {
                compatible = "ethernet-phy-id0044.1400", "ethernet-phy-ieee802.3-c22";
#define RK630_PHY_ID                0x00441400

And the driver is not enabled in config/kernel/linux-rk35xx-vendor.config:

# CONFIG_RK630_PHY is not set
sputnik2019 commented 3 months ago

1.Your TV-BOX used ephy? not gmac? 2.We now have 3 boards on our hands:H28K M28K another board,None of them used ephy!They all used gmac and pcie eth.They all work fine 3.We didn't encounter uboot halt.

ilyakurdyukov commented 3 months ago

1.Your TV-BOX used ephy? not gmac?

What is the difference between ephy and gmac? From what I can see, both ephy and gmac are used. TV-boxes use gmac0.

Look at this and this, gmac0 use ephy inside.

Yesterday I tried to rebuild the kernel with CONFIG_RK630_PHY, it didn’t help, the Ethernet port still doesn’t work.

3.We didn't encounter uboot halt.

This happens so often, 50% of the time, that on Linux distributions it would be immediately noticed. I guess that this only happens on TV-boxes, which are not tested with Linux, only with Android, perhaps this is due to the presence of a TV-out port.

sputnik2019 commented 3 months ago

tv-box used ddr4 or lpddr4?and cpu used rk3528a orrk3528?

ilyakurdyukov commented 3 months ago

tv-box used ddr4 or lpddr4?and cpu used rk3528a orrk3528?

How could I check that? Vontar DQ08 has 5OE77/5NQ77/5NE77 D9PQL (Micron) memory chips, and H96 MAX M1 has the SEC 519/428/410 BYKO K4B4G04460 (Samsung). Those are DDR3.

I don't think it's a memory issue, it never crashes if the logo was found (if I patch it so it looks for logos in the Android partitions in EMMC while Linux boots from the SD card) and it never crashes if I'm using a patch that creates a gray square for the logo.