Tanix X4 / S905X4

it is not due to the color depth. On YT is working fine
looks more like wrong frequency or wrong codec but I do not know

Did you ever get Bluetooth working on your Tanix X4?

Getting a Tanix X4 soon. Is WI-FI and Bluetooth working now?

SPDIF does not work and this is very important if I want to have high-quality sound.
The topic was discussed here over a year ago and nothing has changed to this day. So we can assume that it will stay that way.

Hello.
My TVbox is Tanix x4 Amlogic S905x4.
I am using CoreELEC-Amlogic-ne.arm-20.2-Nexus-Generic.
In Kodi, I have the playback device set to: ALSA: AML-AUGESOUND, S/PDIF.
With this setting, I only have sound via HDMI but no sound via SPDIF.
I use a translator, so I try to write short sentences to be understood.
Below is the output of the “aplay -l” and “amixer” commands
Please help.

 CoreELEC:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: AMLAUGESOUND [AML-AUGESOUND], device 0: SPDIF-B-SPDIF-B SPDIF-B-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 1: TDM-B-TDM-B TDM-B-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 2: SPDIF-SPDIF SPDIF-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 3: TDM-C-dummy soc:dummy-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0


 CoreELEC:~ # amixer
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Audio HAL Format',0
  Capabilities: enum
  Items: 'PCM' 'DTS_EXPRESS' 'DOLBY_DIGITAL' 'DTS' 'DOLBY_DIGITAL_PLUS' 'DTS_HD' 'MULTI_CHANNEL PCM' 'DOLBY_TRUEHD' 'DTS_HD_MA' 'HIFI PCM' 'DOLBY_AC4' 'DOLBY_MAT' 'DOLBY_DDP_ATMOS' 'DOLBY_THD_ATMOS' 'DOLBY_MAT_ATMOS' 'DOLBY_AC4_ATMOS' 'DTS_HP' 'DOLBY_DDP_ATMOS_PROMPT_ON_ATMOS' 'DOLBY_THD_ATMOS_PROMPT_ON_ATMOS' 'DOLBY_MAT_ATMOS_PROMPT_ON_ATMOS' 'DOLBY_AC4_ATMOS_PROMPT_ON_ATMOS'
  Item0: 'PCM'
Simple mixer control 'Audio In Source',0
  Capabilities: enum
  Items: 'TDMIN_A' 'TDMIN_B' 'TDMIN_C' 'SPDIFIN' 'PDMIN' 'FRATV' 'TDMIN_LB' 'LOOPBACK_A' 'FRHDMIRX' 'LOOPBACK_B' 'SPDIFIN_LB' 'EARCRX_DMAC' 'RESERVED_0' 'RESERVED_1' 'RESERVED_2' 'VAD'
  Item0: 'TDMIN_A'
Simple mixer control 'Audio Out Sink',0
  Capabilities: enum
  Items: 'TDMIN_A' 'TDMIN_B' 'TDMIN_C' 'SPDIFIN' 'PDMIN' 'FRATV' 'TDMIN_LB' 'LOOPBACK_A' 'FRHDMIRX' 'LOOPBACK_B' 'SPDIFIN_LB' 'EARCRX_DMAC' 'RESERVED_0' 'RESERVED_1' 'RESERVED_2' 'VAD'
  Item0: 'TDMIN_A'
Simple mixer control 'Audio hdmi-out mute',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Audio spdif format',0
  Capabilities: enum
  Items: 'Stereo PCM' 'DTS RAW Mode' 'Dolby Digital' 'DTS' 'Dolby Digital Plus' 'DTS-HD' 'Multi-channel LPCM' 'Dolby TrueHD' 'DTS-HD MA' 'HIGH SR Stereo LPCM' 'Dolby Digital(Layout B)' 'One Bit Audio'
  Item0: 'Stereo PCM'
Simple mixer control 'Audio spdif mute',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Audio spdif_b format',0
  Capabilities: enum
  Items: 'Stereo PCM' 'DTS RAW Mode' 'Dolby Digital' 'DTS' 'Dolby Digital Plus' 'DTS-HD' 'Multi-channel LPCM' 'Dolby TrueHD' 'DTS-HD MA' 'HIGH SR Stereo LPCM' 'Dolby Digital(Layout B)' 'One Bit Audio'
  Item0: 'Stereo PCM'
Simple mixer control 'Audio spdif_b mute',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Audio spdifin source',0
  Capabilities: enum
  Items: 'spdifin pad' 'spdifout' 'N/A' 'HDMIRX'
  Item0: 'spdifin pad'
Simple mixer control 'LPCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Media Video Delay',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 0
  Mono: 0 [0%]
Simple mixer control 'SPDIF CLK Fine Setting',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 2000000
  Mono: 5644750 [282%]
Simple mixer control 'SPDIFIN Audio Type',0
  Capabilities: enum
  Items: 'LPCM' 'AC3' 'EAC3' 'DTS' 'DTS-HD' 'TRUEHD' 'PAUSE'
  Item0: 'LPCM'
Simple mixer control 'SPDIFIN audio samplerate',0
  Capabilities: enum
  Items: 'N/A' '32000' '44100' '48000' '88200' '96000' '176400' '192000'
  Item0: 'N/A'
Simple mixer control 'SPDIF_B CLK Fine Setting',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 2000000
  Mono: 5644750 [282%]
Simple mixer control 'Spdif to HDMITX Select',0
  Capabilities: enum
  Items: 'Spdif' 'Spdif_b'
  Item0: 'Spdif'
Simple mixer control 'TDM MCLK Fine Setting',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 2000000
  Mono: 12287939 [614%]
Simple mixer control 'VAD',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'VAD Source sel',0
  Capabilities: enum
  Items: 'TDMIN_A' 'TDMIN_B' 'TDMIN_C' 'SPDIFIN' 'PDMIN' 'LOOPBACK_B' 'TDMIN_LB' 'LOOPBACK_A'
  Item0: 'PDMIN'
Simple mixer control 'VAD Test',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'VAD enable',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'VAD wake up timeout fs count',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 4096
  Mono: 200 [5%]
Simple mixer control 'audio inskew set',0
  Capabilities: enum
  Items: '0' '1' '2' '3' '4' '5' '6'
  Item0: '0'
Simple mixer control 'audio locker enable',0
  Capabilities: enum
  Items: 'Disable' 'Enable'
  Item0: 'Disable'
Simple mixer control 'spdif out channel status',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - -1
  Mono: 256 [-25600%]
Simple mixer control 'spdif_b out channel status',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - -1
  Mono: 256 [-25600%]
Simple mixer control 'tdmout_c binv set',0
  Capabilities: enum
  Items: '0' '1'
  Item0: '0'
CoreELEC:~ #

Maybe?

Or wrong gpio?

I used the dtb file: sc2_s905x4_4g.dtb
And everything works except SPDIF.
Android 11 is originally installed on this TVbox and SPDIF works here.

Here is a fragment of the dtb file with the word spdif.
The first one comes from Android 11 and the second one from Coreelec.
Which values should I change to make spdif work in Coreelec?
Am I asking this question in the right place?

Tvbox Tanix X4 amlogic S905x4.
Android:
spdifin {

				mux {
					groups = "spdif_in_h";
					function = "spdif_in";
				};
			};

			spdifout {
				phandle = <0x2b>;

				mux {
					groups = "spdif_out_d";
					function = "spdif_out";
				};
			};

            spdifout_a_mute {
				phandle = <0x2c>;

				mux {
					groups = "GPIOD_10";
					function = "gpio_periphs";
					output-low;
				};
			};


		spdif@0 {
			compatible = "amlogic, tm2-revb-snd-spdif-a";
			#sound-dai-cells = <0x00>;
			clocks = <0x0b 0x35 0x0b 0x09 0x26 0x10 0x26 0x11 0x26 0x2a 0x26 0x2b>;
			clock-names = "sysclk\0fixed_clk\0gate_spdifin\0gate_spdifout\0clk_spdifin\0clk_spdifout";
			interrupts = <0x00 0x23 0x01>;
			interrupt-names = "irq_spdifin";
			pinctrl-names = "spdif_pins\0spdif_pins_mute";
			pinctrl-0 = <0x2b>;
			pinctrl-1 = <0x2c>;
			clk_tuning_enable = <0x01>;
			status = "okay";
			phandle = <0xa7>;
		};

		spdif@1 {
			compatible = "amlogic, tm2-revb-snd-spdif-b";
			#sound-dai-cells = <0x00>;
			clocks = <0x0b 0x39 0x26 0x15 0x26 0x31>;
			clock-names = "sysclk\0gate_spdifout\0clk_spdifout";
			status = "okay";
			phandle = <0xa8>;
		};

Coreelec:

			spdifin {

				mux {
					groups = "spdif_in_h";
					function = "spdif_in";
				};
			};

			spdifout {
				phandle = <0x23>;

				mux {
					groups = "spdif_out_h";
					function = "spdif_out";
				};
			};

			spdifout_a_mute {
				phandle = <0x24>;

				mux {
					groups = "GPIOH_5";
					function = "gpio_periphs";
					output-low;
				};
			};

		spdif@0 {
			compatible = "amlogic, tm2-revb-snd-spdif-a";
			#sound-dai-cells = <0x00>;
			clocks = <0x07 0x35 0x07 0x09 0x22 0x10 0x22 0x11 0x22 0x2a 0x22 0x2b>;
			clock-names = "sysclk\0fixed_clk\0gate_spdifin\0gate_spdifout\0clk_spdifin\0clk_spdifout";
			interrupts = <0x00 0x23 0x01>;
			interrupt-names = "irq_spdifin";
			pinctrl-names = "spdif_pins\0spdif_pins_mute";
			pinctrl-0 = <0x23>;
			pinctrl-1 = <0x24>;
			clk_tuning_enable = <0x01>;
			status = "okay";
			phandle = <0x7e>;
		};

		spdif@1 {
			compatible = "amlogic, tm2-revb-snd-spdif-b";
			#sound-dai-cells = <0x00>;
			clocks = <0x07 0x39 0x22 0x15 0x22 0x31>;
			clock-names = "sysclk\0gate_spdifout\0clk_spdifout";
			status = "okay";
			phandle = <0x7c>;
		};

Nobody will help me?
Which values should I change?

In the dtb coreelec file I changed the clock spdif@0 and values
clock spdif@1 to those extracted from Android:
clocks = <0x0b 0x35 0x0b 0x09 0x26 0x10 0x26 0x11 0x26 0x2a 0x26 0x2b>
and:
clocks = <0x0b 0x39 0x26 0x15 0x26 0x31>;
But after these changes I had no sound at all.
Can someone help me here on the forum or am I writing in the wrong place?
Attached are .dts files from Android and Coreelec.
android_filename.dts (87.5 KB)
coreelec_filename.dts (78.6 KB)

Please help.
I read that you don’t like Tanix and Amlogic S905x4.
But I already have this box, what should I do now?
I only care about spdif audio output.
Even if HDMI stops working, it will work on SPDIF
I will be very pleased with the sound.
Once again, I am asking for help.

It all take time. When we have a free slot we maybe will take a look.

The problem was reported over a year ago and
nothing has changed to this day.

No One in the team owns a Tanix X4. There a number of supported devices where we can test bugs or features. If and when a dev has the time the situation can be addressed. It was Tanix choice to it be included in supported devices. Despite of that, Tanix devices work very well with CE, some uses are not yet supported.

Above I provided the dts file from Android and Coreelec.
Could someone take a look at these files and tell me which pins to change to make spdif work?
I will test it and describe it here.

I think Tanix X4 uses different Portpin for SPDIF. Maybe try SSH:

mount -o remount,rw /flash
fdtput -t s /flash/dtb.img soc/apb4@fe000000/pinctrl@4000/spdifout/mux groups “spdif_out_d”
fdtput -t s /flash/dtb.img soc/apb4@fe000000/pinctrl@4000/spdifout_a_mute/mux groups “GPIOD_10”
sync
reboot

1 Like

Yes, this looks the problem.

CoreELEC:~ # mount -o remount,rw /flash
CoreELEC:~ # fdtput -t s /flash/dtb.img soc/apb4@fe000000/pinctrl@4000/spdifout/mux groups “spdif_out_d”
Error at 'soc/apb4@fe000000/pinctrl@4000/spdifout/mux': FDT_ERR_BADPATH
CoreELEC:~ # fdtput -t s /flash/dtb.img soc/apb4@fe000000/pinctrl@4000/spdifout_a_mute/mux groups “GPIOD_10”
Error at 'soc/apb4@fe000000/pinctrl@4000/spdifout_a_mute/mux': FDT_ERR_BADPATH

I think it must be:

mount -o remount,rw /flash
fdtput -t s /flash/dtb.img /soc/apb4@fe000000/pinctrl@4000/spdifout/mux groups 'spdif_out_d'
fdtput -t s /flash/dtb.img /soc/apb4@fe000000/pinctrl@4000/spdifout_a_mute/mux groups 'GPIOD_10'
sync
reboot
CoreELEC:~ # mount -o remount,rw /flash
CoreELEC:~ # fdtput -t s /flash/dtb.img /soc/apb4@fe000000/pinctrl@4000/spdifout/mux groups 'spdif_out_d'
CoreELEC:~ # fdtput -t s /flash/dtb.img /soc/apb4@fe000000/pinctrl@4000/spdifout_a_mute/mux groups 'GPIOD_10'
CoreELEC:~ # sync
CoreELEC:~ # reboot

It works.
I’m very happy that SPDIF works for me and I can connect the DAC.
Thank you very much for your help.