{"id":2414,"date":"2025-03-10T13:44:34","date_gmt":"2025-03-10T13:44:34","guid":{"rendered":"https:\/\/www.klokocka.info\/?p=2414"},"modified":"2025-04-07T21:18:10","modified_gmt":"2025-04-07T21:18:10","slug":"android-tv-box-surround-sound-enable","status":"publish","type":"post","link":"https:\/\/www.klokocka.info\/?p=2414","title":{"rendered":"LibreELEC on PC"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>After days of trying to get multichanel sound from cheap android 10 box &#8211; I end up with LibreElec on PC. <br>Just downloaded USB Creator from their site, chose Generi Legacy image, boot from it and it WORKS like a charm.<\/p>\n\n\n\n<p>Litle bit strugling was to force KODI to hbe shown on monitor connected via HDMI on Lenovo notebook. Desktop PC does not have this problem, if only one display (TV) is connected.<\/p>\n\n\n\n<p>This is the way how to force LibreELEC to use output of lenovo T570 notebook:<\/p>\n\n\n\n<p>Connect to LibreElec dedicated PC via Putty (you must enable SSH during libreEelec first boot)<\/p>\n\n\n\n<p>Some testing commands:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/get DRM - shows display devices\nls \/sys\/class\/drm\n\n\/\/check DRM status: -  - shows connected displays\ntail \/sys\/class\/drm\/*\/status\n\n\/\/Output example\n==> \/sys\/class\/drm\/card0-DP-1\/status &lt;==\ndisconnected\n\n==> \/sys\/class\/drm\/card0-DP-2\/status &lt;==\ndisconnected\n\n==> \/sys\/class\/drm\/card0-HDMI-A-1\/status &lt;==\ndisconnected\n\n==> \/sys\/class\/drm\/card0-HDMI-A-2\/status &lt;==\nconnected\n\n==> \/sys\/class\/drm\/card0-eDP-1\/status &lt;==\ndisconnected\n\n\/\/Show display driver\ngetedid gpu<\/pre>\n\n\n\n<p>Editing configutration file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/edit syslinux.cfg - first of all: enable writing of config file:\nLibreELEC:\/etc # mount -o remount,rw \/flash\n\n\/\/then use nano editor to edit the file\nLibreELEC:\/etc # nano \/flash\/syslinux.cfg\n\n\/\/add exactly this after the \"quiet\": video=HDMI-A-2:1920x1080M@60 video=eDP-1:d\n\/\/which means: use HDMI-A-2 display with 1920x1080 at 60 Hz and disable eDP-1 display, \n\/\/which is laptop display\n\/\/This worked for me for every display output, either embedded HDMI or docking station outputs\n\/\/My \/flash\/syslinux.cfg file now looks lkike this:\nLABEL live\n  KERNEL \/KERNEL\n  APPEND boot=UUID=1901-3952 live quiet vga=current\n\nLABEL run\n  KERNEL \/KERNEL\n  APPEND boot=UUID=1901-3952 disk=UUID=279513d9-e3fe-4b07-8121-a6530f2ab377 portable quiet video=HDMI-A-2:1920x1080M@60 video=eDP-1:d<\/pre>\n\n\n\n<p>Enable shutdown by pressing Power button<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/create new file with nano editor (in my case keyboard.xml did not exist)\n\nnano \/storage\/.kodi\/userdata\/keymaps\/keyboard.xml\n\n\/\/then put following code (copied to clipboard,then right click to putty)\n\/\/then Ctrl+S to save, Ctrl+x to exit\n\n&lt;keymap>\n    &lt;global>\n        &lt;keyboard>\n            &lt;power>shutdown&lt;\/power>\n            &lt;f5>ActivateWindow(Favourites)&lt;\/f5>\n        &lt;\/keyboard>\n    &lt;\/global>\n&lt;\/keymap>\n\n\/\/then restart KODI and test it\nsystemctl restart kodi<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Android TV Box Surround sound enable : No succes :-\/ <\/h2>\n\n\n\n<p>It was chepa Allwinner based Android 10 box from Aliexpress. I gave up. Maybe I&#8217;ll try to write an android app to force linux ALSA sound driver to be visible for KODI.<\/p>\n\n\n\n<p>Sources I tried<\/p>\n\n\n\n<p><a href=\"https:\/\/www.reddit.com\/r\/AndroidTV\/comments\/xcnq5z\/missing_manual_surround_sound_setting_in_km7_and\/\">https:\/\/www.reddit.com\/r\/AndroidTV\/comments\/xcnq5z\/missing_manual_surround_sound_setting_in_km7_and\/<\/a><\/p>\n\n\n\n<p>Long story short, did some testing, and with a few ADB shell script commands you too can unhide the MANUAL SurroundSound setting&#8217;s UI toggles in the MECOOL KM7 and probably other ATV11 devices as well.<\/p>\n\n\n\n<p>!!!! First, inside the DISPLAY_&amp;_SOUND settings under ADVANCED_SOUND_SETTINGS option turn-OFF the S\/PDIF output, and note the Formats is either &#8220;Automatic&#8221; or &#8220;None&#8221; &#8211; and after you input the script cmds neither option will be chosen.<\/p>\n\n\n\n<p>All works well in passthrough including kodi, netflix, amazon prime and apple tv but when I restart all is lost<\/p>\n\n\n\n<p>so I am using tvQuickAction to send ADB Shell commands: settings put global digital_audio_format 2 settings put global encoded_surround_output 3<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-f5addf788af61e56f96742ac875ea839\" style=\"color:#f10d0d\">You can also use adb on boot apk (<a href=\"https:\/\/xdaforums.com\/t\/app-no-root-adb-on-boot-run-adb-commands-at-boot-automatically.4368281\/\">https:\/\/xdaforums.com\/t\/app-no-root-adb-on-boot-run-adb-commands-at-boot-automatically.4368281\/<\/a>)<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-a6570cc5a807225fcce8d179c8745b90\" style=\"color:#f10d0d\">write exactly this to the apk:<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-79e5454a4859b6063b2ce91026c4f50f\" style=\"color:#f10d0d\">sleep 20; settings put global digital_audio_format 2; settings put global encoded_surround_output 3<\/p>\n\n\n\n<p>Source: <a href=\"https:\/\/www.reddit.com\/r\/Homatics\/comments\/11wnu9a\/homatics_driver_and_sound_issue\/\">https:\/\/www.reddit.com\/r\/Homatics\/comments\/11wnu9a\/homatics_driver_and_sound_issue\/<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings put global digital_audio_format 2\nsettings put global encoded_surround_output 3\n\n\/\/ADB Shell cmds to manually input Surround Sound ENABLED_FORMATS:\nsettings put global digital_audio_subformat \"5,6,7,18\"\nsettings put global digital_audio_subformat \"5,6,7,18\"\nsettings put global encoded_surround_output_enabled_formats \"5,6,7,18\"<\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">DIGITAL and ENCODED formats must have the same Format variables:<\/h6>\n\n\n\n<ul class=\"wp-block-list\">\n<li>AC3 (DD) = 5<\/li>\n\n\n\n<li>E_AC3 (DD+) = 6<\/li>\n\n\n\n<li>DTS = 7<\/li>\n\n\n\n<li>DTS_HD = 8<\/li>\n\n\n\n<li>DOLBY_TRUEHD = 14<\/li>\n\n\n\n<li>E_AC3_JOC (DD+Atmos) =18<\/li>\n\n\n\n<li>There are way more ENCODED audio codecs in ANDROID&#8217;s main source-code that can be sent via passthrough, but they need to have a corresponding DIGITAL entry in Amlogic&#8217;s source-code to work with an Amlogic SoC. But they are just not all populated in Amlogic&#8217;s JAVA. But personally, I believe the real reason that HD-Audio codecs can&#8217;t be sent via passthrough is Amlogic&#8217;s Linux Kernel is still broken for Android 11, but there is hope that it might be fixed for Android 12.<\/li>\n<\/ul>\n\n\n\n<p>After entering the above ADB cmds, I recommend doing a device REBOOT, and checking that the settings persisted by connecting ADB again and scrolling through the GLOBAL settings list.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">NOTE:<\/h6>\n\n\n\n<p>I have NOT tested these Audio settings extensively with every streaming app available, I tested with Amazon PrimeVideo and DolbyAtmos worked and was sent via Passthrough, so was happy and deemed my mini exploit a success.<\/p>\n\n\n\n<p>Don&#8217;t have a Netflix sub personally, also KM7 not Netflix certified, but if somebody with the Realme 4K stick wanted to try inputting these settings with ADB, Netflix may still not passthrough ATMOS unless inputting two further ADB settings:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings put global nrdp_external_surround_sound_enabled 1\nsettings put global external_surround_sound_enabled 1<\/pre>\n\n\n\n<p><a href=\"https:\/\/forum.kodi.tv\/showthread.php?pid=2862271\">https:\/\/forum.kodi.tv\/showthread.php?pid=2862271<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">adb shell settings put global digital_sound 1\nadb shell settings put global encoded_surround_output 2<\/pre>\n\n\n\n<p>encoded_surround_output 0 = auto (random behavior)<br>encoded_surround_output 1 = pcm<br>encoded_surround_output 2 =&nbsp;<strong>always<\/strong><\/p>\n\n\n\n<p>!!!! ???? AMLogic Android devices running Oreo v8.1 or greater no longer has IEC61937 Kodi HD audio passthrough support in Firmware.<br>No idea why it was taken out.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.reddit.com\/r\/AndroidTV\/comments\/yrgjoh\/android_tv_10_and_51_spdif\/?rdt=64115\">https:\/\/www.reddit.com\/r\/AndroidTV\/comments\/yrgjoh\/android_tv_10_and_51_spdif\/?rdt=64115<\/a><\/p>\n\n\n\n<p>Scripts to test in ADB Shell to make SPDIF work for just DolbyDigital\/DTS 5.1:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings put global digital_audio_format 1\n\nsettings put global digital_audio_subformat 5,7\n\nsettings put global nrdp_external_surround_sound_enabled 1\n\nsettings put global digital_sound 1<\/pre>\n\n\n\n<p><a href=\"https:\/\/www.reddit.com\/r\/AndroidTV\/comments\/pu5pdk\/anyone_else_seeing_this_when_accidently\/\">https:\/\/www.reddit.com\/r\/AndroidTV\/comments\/pu5pdk\/anyone_else_seeing_this_when_accidently\/<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/Enter these commands through ADB shell:\nsettings put global audio_mixing 0\n\nsettings put global digital_audio_format 3\n\nsettings put global digital_audio_subformat 5,6,7,8,13,14,17,18,19\n\nsettings put global encoded_surround_output 3\n\nsettings put global encoded_surround_output_enabled_formats 5,6,7,8,13,14,17,18,19\n\nsettings put global external_surround_sound_enabled 1\n\nsettings put global nrdp_external_surround_sound_enabled 1\n\nsettings put global surround_sound_supported 1\n\nsettings put global use_external_surround_sound_flag 1\n\nsettings put system enable_pass_through 1\n\nsettings put system support_dolby 1\n\nreboot\n\n\/\/Don't have the MiBox S anymore, but you can take notes beforehand of the original setting by changing &lt;put> to &lt;get> and not inputting the &lt;variable_at_end> just in case you want to reverse the input later, one example to get current original settings:\n\n\/\/settings get global encoded_surround_output_enabled_formats<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/www.reddit.com\/r\/AndroidTV\/comments\/13j1g1k\/issues_with_51_sound_on_netflix_xiaomi_tv_box_s\/\">https:\/\/www.reddit.com\/r\/AndroidTV\/comments\/13j1g1k\/issues_with_51_sound_on_netflix_xiaomi_tv_box_s\/<\/a><\/p>\n\n\n\n<p>Are you still using same SPDIF cable with AVR?<\/p>\n\n\n\n<p>Cause your Audio problem can only potentially be solved with some ADB shell scripts.<\/p>\n\n\n\n<p>Netflix needs this setting shell command to be set for SPDIF passthrough:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><code>settings put global nrdp_external_surround_sound_enabled \"1\"<\/code><\/p>\n<\/blockquote>\n\n\n\n<p>Other options to enable beforehand:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><code>settings put global db_id_sound_spdif_output_enable \"1\"<\/code><\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><code>settings put global digital_audio_format \"1\"<\/code><\/p>\n<\/blockquote>\n\n\n\n<p>*note: DIGITAL_AUDIO_FORMAT=1 is the old Amlogic setting that enabled SPDIF in Android 9.<\/p>\n\n\n\n<p>If your AVR doesn&#8217;t support DolbyDigital+, only old standard DD, then add:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><code>settings put global digital_audio_subformat \"5,6\"<\/code><\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><code>settings put global encoded_surround_output_enabled_formats \"5,6\"<\/code><\/p>\n<\/blockquote>\n\n\n\n<p>Settings to force SPDIF codecs with ExoPlayer2 video engine:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><code>settings put global use_external_surround_sound_flag \"1\"<\/code><\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><code>settings put global external_surround_sound_enabled \"1\"<\/code><\/p>\n<\/blockquote>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">getprop\nsetprop vendor.audio.input.active AUDIO_AC107\nsetprop vendor.audio.output.active AUDIO_CODEC,AUDIO_HDMI<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>After days of trying to get multichanel sound from cheap android 10 box &#8211; I end up with LibreElec on PC. Just downloaded USB Creator from their site, chose Generi Legacy image, boot from it and it WORKS like a &hellip; <a href=\"https:\/\/www.klokocka.info\/?p=2414\">Continued<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"kt_blocks_editor_width":"","pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-2414","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.klokocka.info\/index.php?rest_route=\/wp\/v2\/posts\/2414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.klokocka.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.klokocka.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.klokocka.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.klokocka.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2414"}],"version-history":[{"count":10,"href":"https:\/\/www.klokocka.info\/index.php?rest_route=\/wp\/v2\/posts\/2414\/revisions"}],"predecessor-version":[{"id":2447,"href":"https:\/\/www.klokocka.info\/index.php?rest_route=\/wp\/v2\/posts\/2414\/revisions\/2447"}],"wp:attachment":[{"href":"https:\/\/www.klokocka.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.klokocka.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.klokocka.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}