Hey Tech1! As promised some more feedback about the annoying audio switch after reboot. The only thing I could find was:
it is a matter of executing the command via a shell
setprop audio.routing x
where x is 1024 for HDMI, 4096 for S/PDIF or 2 for codec (3.5mm audio connector).
Additionally, perform the following if HDMI is required:
AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
am.setParameters("audio_devices_out_active=AUDIO_H DMI");
or
AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
am.setParameters("audio_devices_out_active=AUDIO_C ODEC");
for codec/3.5mm
I think I will give this script a go when I get back from work. I will make a Tasker task to execute it every time after reboot and hope for the best. Did you already tried the "fix" above? I can imagine that this will not work for us because as I see it we have "HDMI" and "HDMI_passthrough" options available instead of just HDMI or CODEC. Only one way to find out so will keep you posted!!

Cheers mate!
source: https://www.miniand.com/forums/forums/development--3/topics/setting-default-audio-output-mode-android
Comment