@@ -47,10 +47,10 @@ if [ ! -f "$DEFAULT_PA" ]; then
4747 exit 1
4848fi
4949
50- # Comment out module-sles -sink (missing Android HAL deps on most devices )
51- if grep -q " ^${SLES_LINE } " " $DEFAULT_PA " ; then
52- sed -i " s|^${SLES_LINE } |#${SLES_LINE } |" " $DEFAULT_PA "
53- detail " Commented out $SLES_LINE "
50+ # Comment out module-aaudio -sink (fails on multiple Snapdragon devices due to HAL block )
51+ if grep -q " ^${AAUDIO_LINE } " " $DEFAULT_PA " ; then
52+ sed -i " s|^${AAUDIO_LINE } |#${AAUDIO_LINE } |" " $DEFAULT_PA "
53+ detail " Commented out $AAUDIO_LINE "
5454fi
5555
5656# Comment out module-console-kit (no D-Bus system bus on Android, causes futex deadlock)
@@ -65,22 +65,22 @@ if grep -q "^${SIDLE_LINE}" "$DEFAULT_PA"; then
6565 detail " Commented out $SIDLE_LINE "
6666fi
6767
68- # Check if already patched (aaudio appears before always-sink)
69- AAUDIO_LINE_NUM =$( grep -n " ^${AAUDIO_LINE } $" " $DEFAULT_PA " | head -1 | cut -d: -f1)
68+ # Check if already patched (sles appears before always-sink)
69+ SLES_LINE_NUM =$( grep -n " ^${SLES_LINE } $" " $DEFAULT_PA " | head -1 | cut -d: -f1)
7070ALWAYS_LINE_NUM=$( grep -n " ^${ALWAYS_LINE} $" " $DEFAULT_PA " | head -1 | cut -d: -f1)
7171
72- if [ -n " $AAUDIO_LINE_NUM " ] && [ -n " $ALWAYS_LINE_NUM " ] && [ " $AAUDIO_LINE_NUM " -lt " $ALWAYS_LINE_NUM " ]; then
73- detail " default.pa already patched, skipping."
72+ if [ -n " $SLES_LINE_NUM " ] && [ -n " $ALWAYS_LINE_NUM " ] && [ " $SLES_LINE_NUM " -lt " $ALWAYS_LINE_NUM " ]; then
73+ detail " default.pa already patched for OpenSL ES , skipping."
7474else
75- sed -i " s|^${ALWAYS_LINE} |${AAUDIO_LINE} \n${ALWAYS_LINE} |" " $DEFAULT_PA "
76- detail " Injected $AAUDIO_LINE before $ALWAYS_LINE "
75+ sed -i " s|^${ALWAYS_LINE} |${SLES_LINE} \nset-default-sink OpenSL_ES_sink \n${ALWAYS_LINE} |" " $DEFAULT_PA "
76+ detail " Injected $SLES_LINE and default sink before $ALWAYS_LINE "
7777
78- # Remove duplicate aaudio line at bottom if present
79- AAUDIO_COUNT =$( grep -c " ^${AAUDIO_LINE } $" " $DEFAULT_PA " || true)
80- if [ " $AAUDIO_COUNT " -gt 1 ]; then
81- awk " BEGIN{found=0} /^${AAUDIO_LINE } $/{if(found){next}; found=1} {print}" " $DEFAULT_PA " > " $DEFAULT_PA .tmp"
78+ # Remove duplicate sles line at bottom if present
79+ SLES_COUNT =$( grep -c " ^${SLES_LINE } $" " $DEFAULT_PA " || true)
80+ if [ " $SLES_COUNT " -gt 1 ]; then
81+ awk " BEGIN{found=0} /^${SLES_LINE } $/{if(found){next}; found=1} {print}" " $DEFAULT_PA " > " $DEFAULT_PA .tmp"
8282 mv " $DEFAULT_PA .tmp" " $DEFAULT_PA "
83- detail " Removed duplicate $AAUDIO_LINE "
83+ detail " Removed duplicate $SLES_LINE "
8484 fi
8585fi
8686
0 commit comments