How to set all volumes (media, ringer etc.) to some predefined value while booting?

64 views
Skip to first unread message

shridutt kothari

unread,
Nov 24, 2016, 8:05:16 AM11/24/16
to Android-x86
I want to set all volumes (media, ringer etc.) to some predefined value while booting?

i have looking into it in AudioService class but not able to achieve it.

Any way to achieve it? 

Chih-Wei Huang

unread,
Nov 24, 2016, 10:45:48 PM11/24/16
to Android-x86
How about use alsa_amixer?

You may check the do_bootcomplete() function
of /etc/init.sh to understand how to do it.

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

shridutt kothari

unread,
Nov 26, 2016, 9:29:57 PM11/26/16
to Android-x86
First of all thanks Chih for your kind reply.

Yes before posting this, i did try the alsa command in init script, as per this thread,

I did put below code in end of the do_bootcomplete() function of /etc/init.sh
alsa_amixer -c set Master 100 unmute 

But this also didn't work and i don't understand why. So any alternate way to achieve it? What about using Java code in framework system service at boot time? any suggestion??

Thanks in advance!!
Shridutt Kothari

spin877

unread,
Nov 30, 2016, 5:14:00 AM11/30/16
to Android-x86


try to put it in a script, the ramdisk.img


extract :

zcat ramdisk.img | cpio -idmv


compress:

find . | cpio -H newc -o > ../ramdisk.img


insert command in script :

init.rc or init.android_x86.rc

Reply all
Reply to author
Forward
0 new messages