Ugoos X4 Pro Amlogic-ne audio device switching

I do have Ugoos X4 Cube but on none device I did any analog out testing. But will check it out in next days.

And no, we do not have Ugoos X4 Android kernel source and .config.

1 Like

I did some testing but sadly no sound comes from it. Need to find one device to make comparison but sound is not my area of work.

Not much help from my side.

1 Like

Thanks @vpeter to confirm and for your valuable time.

It does help in that finally I now realize my hardware does not differ from any other Ugoos X4 (Pro) for sure.

I may try myself to fix the ALSA AV-OUT, and, I guess, but I cannot test, also the ALSA S/PDIF-OUT.

I asked Ugoos support for some assistance as well.
In theory they should provide their Linux source and .config.

As said: the specific limitation does not hurt me at all, but, I would be happy if one could reach 100% CE functionality, if not for myself, then probably for some or few others.

Have a nice day and thanks for contributing to CE!

They are not needed to provide their Linux, no.
Only the base Linux what is used and under GPL.

So vendor kernel - vendor changes - Amlogic modifications → mainline Linux.
You can dump your Android Linux config by terminal somehow. But they use arm, we use arm64.

The Alsa config is a generic one for all devices so I don’t think the error is located there.
You will need to search a driver for the analog audio amp SoC.
Open the device and find by the amp marking what driver is needed for the assembled amp.

1 Like

@Portisch

Thanks for explaining the relevant aspects of Linux source code licence. It now seems I have never fully and correctly understood these.

The Android Ugoos kernel has no support for /proc/config.gz (as I could verify via adb and being root). But there may be another way to dump it.

Thanks for explaining most probably a driver needs to be added for the specific audio hardware.

Unfortunately I cannot figure out how to open this box (I have opened some boxes in the past though).

I will perhaps ask Ugoos support which analog audio amp SoC is used in the device.

Inside X4 Cube is only see TPF632C near the connector.

3-VRMS Audio Line Driver with Integrated Charge Pump

https://static6.arrow.com/aropdfconversion/3711a2c3dd70eaf1f86de013136d910d8f129302/tpf632c-tpf605c-tpf607c.pdf

1 Like

The same line driver is used on X4 Pro according here

So SOC internal DAC is used, with ext. line driver, which needs to be enabled.
The question left (to UGOOS): which GPIO is used for ENABLE?

1 Like

Hi @rho-bot @Portisch @vpeter

X4 online spec mentions

Built-in serial digital audio SPDIF/IEC958 output and PCM input/output

FYI : I built image with kernel having all CONFIG_SND_SOC_XYZ_SPI=m and CONFIG_SND_SOC_XYY_I2C=m hoping maybe one of them fits the 3PEAK TPF632C audio.

I did modprobe all modules but I get no different (i.e. no working av) audio behavior.
So my hope was not correct or appropriate.

I guess perhaps we need specific hardware or vendor driver code for TPF632C?

Sorry for my somewhat wet finger guessing

here is diff with official .config

CONFIG_SND_SOC_ADAU1761_I2C=m
CONFIG_SND_SOC_ADAU1761=m
CONFIG_SND_SOC_ADAU1761_SPI=m
CONFIG_SND_SOC_ADAU17X1=m
CONFIG_SND_SOC_ADAU_UTILS=m
CONFIG_SND_SOC_CS4270=m
CONFIG_SND_SOC_CS4271_I2C=m
CONFIG_SND_SOC_CS4271=m
CONFIG_SND_SOC_CS4271_SPI=m
CONFIG_SND_SOC_ES8328_I2C=m
CONFIG_SND_SOC_ES8328=m
CONFIG_SND_SOC_ES8328_SPI=m
CONFIG_SND_SOC_PCM179X_I2C=m
CONFIG_SND_SOC_PCM179X=m
CONFIG_SND_SOC_PCM179X_SPI=m
CONFIG_SND_SOC_PCM186X_I2C=m
CONFIG_SND_SOC_PCM186X=m
CONFIG_SND_SOC_PCM186X_SPI=m
CONFIG_SND_SOC_PCM3060_I2C=m
CONFIG_SND_SOC_PCM3060=m
CONFIG_SND_SOC_PCM3060_SPI=m
CONFIG_SND_SOC_PCM3168A_I2C=m
CONFIG_SND_SOC_PCM3168A=m
CONFIG_SND_SOC_PCM3168A_SPI=m
CONFIG_SND_SOC_PCM512x_I2C=m
CONFIG_SND_SOC_PCM512x=m
CONFIG_SND_SOC_PCM512x_SPI=m
CONFIG_SND_SOC_SIGMADSP=m
CONFIG_SND_SOC_SIGMADSP_REGMAP=m
CONFIG_SND_SOC_SSM2602_I2C=m
CONFIG_SND_SOC_SSM2602=m
CONFIG_SND_SOC_SSM2602_SPI=m
CONFIG_SND_SOC_TLV320AIC23_I2C=m
CONFIG_SND_SOC_TLV320AIC23=m
CONFIG_SND_SOC_TLV320AIC23_SPI=m
CONFIG_SND_SOC_TLV320AIC32X4_I2C=m
CONFIG_SND_SOC_TLV320AIC32X4=m
CONFIG_SND_SOC_TLV320AIC32X4_SPI=m
CONFIG_SND_SOC_WM8804_I2C=m
CONFIG_SND_SOC_WM8804=m
CONFIG_SND_SOC_WM8804_SPI=m

3PEAK TPF632C is just amplifier with enable/disable pin (with I assume controlled by avout_mute-gpios). No driver is needed for it.

But this doesn’t get us any closer to the sound :slight_smile:

1 Like

Thanks @vpeter

As said : the avout_mute-gpios lines in auge_sound section are same for decompiled Android and CoreELEC dtbs.
Namely:

avout_mute-gpios = <0x1b 0x1f 0x00>;

with 0x1f corresponding to GPIOD_2. So that seems correct.

Then maybe something else deviates or is missing or maybe there is a bug somewhere.

Not sure if the deviation in IRQ 31 matters.

Try this DTB (it works for me on X4 Cube).

1 Like

@vpeter

Great!

It works as dtb.img for X4 Pro as well.

I decompiled it and notice some hex values seem incremented by one.

It would be cool if the change could be committed without affecting other devices.

I will push it asap :slight_smile: Only Ugoos X4 is affected.

1 Like

I wonder if similar change would benefit X3.

By the way if I build CoreELEC on tag 20.1-Nexus using commands

make -j31 release
make -j31 image

I get NE targets.
How would I build NG targets?
Given the dts diff I can test Ugoos X3 then myself without the need to bother you.

The fix for CE20 NE: dts: fix analog sound on Ugoos X4 · CoreELEC/linux-amlogic@c6c82cb · GitHub

Add DEVICE=Amlogic-ng before make and you will get NG image. But same change doesn’t work for me on NG project. Need more investigation.

1 Like

I have never been able to get analog audio out from the headphone jack on any of my SC2, S4 and T7 devices I tried the settings suggested here Activate Headphone Jack - #5 by iku and they didn’t work so I figure it is an issue with all device.

Could be. Analog sound output is probably barely tested.

Maybe my usage is not so common (and certainly not fancy):

I consume media from my desk where I use my desktop computer.

On that same desk I have, for CE, an extra, good HDMI video, 22" HD monitor with, IMO, bad HDMI audio. So I connect CE av-out to a good audio box. I could use BT as well but I often share the audio box with other devices so dedicated physical connection is convenient to garantie no other device takes over.

Like you I use one of my CE devices on an HD monitor and the volume via is too low with the monitor’s amplifier. I could use LE and an RPi but I prefer CE devices.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.