Problem setting S/PDIF as a default audio output CE22 Ugoos am8 pro

Device: Ugoos AM8 Pro
SoC: Amlogic S928X
RAM: 8 GB
Boot medium: microSD
CoreELEC versions tested:
22 Alpha 1
22 Alpha 2
22 Alpha 3
22 Beta 1
22 nightly 20260730
22 nightly 20260806
DTB: stock am8 DTB supplied with each respective release
Firmware: 2.0.8
SD Card - Lexar A2, V30, U3, 128GB
Kodi: bundled with CoreELEC
Playback:
Native + Jellyfin integration
Media stored on NFS mount (kernel-level mount) + usb stick
Display HDMI out: 1080p projector
Audio S/PDIF out to denon AVR 3805

Hi I have an old Denon that do not support HDMI so the only way to directly connect Ugoos to it is via SPDIF however whenever I restart my box its defaulting to HDMI. Is there anyway to hard code SPDIF in CE22 so that no mater what it would default to SPDIF and not HDMI?

Its actually a quite weird but I had CMA memory leak so within last 6 months I reinstalled CE like 20 times and sometimes the bug was present sometime it wasnt… cant put my finger on what could cause it…

More interested in just a simple script or some config modification via ssh so that CE would set SPDIF as a audio output on start-up.

a couple paths forward

add-ons changing/overriding: check for any audio addons or non standard and disable

coreelec not saving option because of device reset instead of reboot: change the setting in audio then perform 1 reboot so settings save normally

if still forgets or gets overridden refer to the blue box at the top of the forum and provide logs:
Before posting an error:

You won’t believe this because I didn’t until I tried it.

System/Coreelec/Services - under the Bluetooth settings there’s Restore Audio device (optional).

Yes, I know you’re not returning from Bluetooth but give it a go. N.B. You don’t have to have Bluetooth enabled for this to work.

P.S. I reported the behaviour with logs a while ago and then some kind person pointed me this way.

Hope you’ve seen my answer because if not I’ve wasted the effort of drafting it and I could have kept the knowledge to myself.

Your efforts are not wasted!!.I just tested your method :wink:.

It works!!

In the old days your post would be marked as a “Sticy” Maybe the CoreELEC bot will give you a Solution .

It should be noted this is not SoC /box specific.Probably be cause by default is set to auto-detect

User needs to select ALSA AML AUGESOUND S/PDIF