OSDN Git Service

init.sh: support IntelHDMI audio HAL
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 8 Aug 2016 07:41:54 +0000 (15:41 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 8 Aug 2016 07:41:54 +0000 (15:41 +0800)
Only enable IntelHDMI audio HAL if it's the only sound card.
It doesn't work on devices other than ASUS ViVoStick (TS10).

init.sh

diff --git a/init.sh b/init.sh
index caec377..e9bbb98 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -32,6 +32,10 @@ function init_hal_audio()
                *)
                        ;;
        esac
+
+       if [ "`cat /proc/asound/card0/id`" = "IntelHDMI" ]; then
+               [ -d /proc/asound/card1 ] || set_property ro.hardware.audio.primary hdmi
+       fi
 }
 
 function init_hal_bluetooth()