Hi Jon and Chih-Wei,
Thanks for your response! I've tried using grub command you told, but no effect.
Fortunately, after doing some research on group, i could figure out what was happening and, after some more google search, i could solve my problem (before your response, Chih)! Of course, if someone wants to point me a better / less intrusive solution, i would be very thankfull.
Sharing below what i've done, to anyome that can have same problem:
1) I saw that android-x86 has a rudimentar way of selecting audio output, leading to wrong port/card selection. And we need to apply workaround manually. So, I'm using analog output from my onboard realtek sound chip, but i can have HDMI sound output from my videocard. Therefore, i've opened my terminal emulator and typed following commands:
android_x86:/ $ su
android_x86:/ # logcat | grep audio_hw
And analysed output; pasting below what really matters from it:
02-23 20:34:59.308 1475 1475 D audio_hw_primary: found audio out at /dev/snd/pcmC0D0p
02-23 20:34:59.308 1475 1475 D audio_hw_primary: card: 0/0 id: ALC1150 Analog
02-23 20:34:59.308 1475 1475 D audio_hw_primary: name: ALC1150 Analog
02-23 20:34:59.308 1475 1475 D audio_hw_primary: subname: subdevice #0
02-23 20:34:59.308 1475 1475 D audio_hw_primary: stream: 0
02-23 20:34:59.308 1475 1475 D audio_hw_primary: found audio out at /dev/snd/pcmC0D1p
02-23 20:34:59.308 1475 1475 D audio_hw_primary: card: 0/1 id: ALC1150 Digital
02-23 20:34:59.308 1475 1475 D audio_hw_primary: name: ALC1150 Digital
02-23 20:34:59.308 1475 1475 D audio_hw_primary: subname: subdevice #0
02-23 20:34:59.308 1475 1475 D audio_hw_primary: stream: 0
02-23 20:34:59.308 1475 1475 D audio_hw_primary: ignore pcmC0D1p
02-23 20:34:59.309 1475 1475 D audio_hw_primary: found audio out at /dev/snd/pcmC1D10p
02-23 20:34:59.309 1475 1475 D audio_hw_primary: card: 1/10 id: HDMI 4
02-23 20:34:59.309 1475 1475 D audio_hw_primary: name: HDMI 4
02-23 20:34:59.309 1475 1475 D audio_hw_primary: subname: subdevice #0
02-23 20:34:59.309 1475 1475 D audio_hw_primary: stream: 0
...
02-23 20:34:59.309 1475 1475 I audio_hw_primary: choose pcmC0D0p for 0
02-23 20:34:59.309 1475 1475 E audio_hw_primary: Failed to open /system/etc/mixer_paths.xml
02-23 20:34:59.324 1475 1475 I audio_hw_primary: choose pcmC0D0p for 0
02-23 20:38:43.085 1475 1745 E audio_hw_primary: reset_mixer_state: invalid audio_route
02-23 20:38:43.085 1475 1745 E audio_hw_primary: audio_route_apply_path: invalid audio_route
02-23 20:38:43.085 1475 1745 E audio_hw_primary: update_mixer_state: invalid audio_route
02-23 20:38:43.086 1475 1745 I audio_hw_primary: choose pcmC1D10p for 3
02-23 20:38:48.145 1475 1745 I audio_hw_primary: choose pcmC1D10p for 3
2) As you can see, it first chooses my analog output (choose pcmC0D0p for 0, wich is ALC1150 Analog), but errors occurs, and then selects first HDMI audio output. I believe it could be because, on system/etc/init.sh, primary audio.hw is set to HDMI. So i googled about those invalid_route errors and found a post on, what i believe, is some forum for PhoenixOS; solution is deleting every pcmC1D file from /dev/snd/, so system reverts back to audio output desired. Original post here:
http://bbs.phoenixstudio.org/cn/read.php?tid=11591 (chinese, used google translate to figure things out). So, on terminal emulator, i did:
android_x86:/ $ su
android_x86:/ # rm /dev/snd/pcmC1D*
Fixed! I believe killall audioserver wasn't required.
3) Next step was automate my solution. Again, the answer lies on same chinese post as above. I just had to edit system/etc/init.sh, putting following commands:
function post_init ()
{
rm /dev/snd/pcmC1D*
}
Just had to create function post_init () above right before function init_cpu_governor (). So i did a reboot and... Everything okay!
--------
I've now put android-x86 on my HTPC, and faced similar audio problem, but on there i have HDMI 0, HDMI 1 and HDMI 2 on same card, so it selects first HDMI stream (HDMI 0) but current output is on second stream (HDMI 1). Followed steps similar as below, but had to do other things to just figured out correct HDMI:
1) On Terminal Emulator:
android_x86:/ $ su
android_x86:/ # alsa_amixer contents
output; pasting below what really matters from it:
numid=35,iface=CARD,name='Front Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
numid=31,iface=CARD,name='Front Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
numid=39,iface=CARD,name='HDMI/DP,pcm=3 Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
numid=45,iface=CARD,name='HDMI/DP,pcm=7 Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on
...
2) Yet on Terminal Emulator:
android_x86:/ # logcat|grep audio_hw
output; pasting below what really matters from it:
02-25 13:58:15.118 3964 3964 D audio_hw_primary: found audio out at /dev/snd/pcmC0D3p
02-25 13:58:15.118 3964 3964 D audio_hw_primary: card: 0/3 id: HDMI 0
02-25 13:58:15.118 3964 3964 D audio_hw_primary: name: HDMI 0
02-25 13:58:15.118 3964 3964 D audio_hw_primary: subname: subdevice #0
02-25 13:58:15.118 3964 3964 D audio_hw_primary: stream: 0
02-25 13:58:15.118 3964 3964 D audio_hw_primary: found audio out at /dev/snd/pcmC0D7p
02-25 13:58:15.118 3964 3964 D audio_hw_primary: card: 0/7 id: HDMI 1
02-25 13:58:15.118 3964 3964 D audio_hw_primary: name: HDMI 1
02-25 13:58:15.118 3964 3964 D audio_hw_primary: subname: subdevice #0
02-25 13:58:15.118 3964 3964 D audio_hw_primary: stream: 0
02-25 13:58:15.118 3964 3964 D audio_hw_primary: ignore pcmC0D7p
...
02-25 13:58:15.119 3964 3964 E audio_hw_primary: Failed to open /system/etc/mixer_paths.xml
02-25 13:58:15.119 3964 3964 I audio_hw_primary: choose pcmC0D0p for 0
02-25 13:58:17.130 3964 3974 E audio_hw_primary: reset_mixer_state: invalid audio_route
02-25 13:58:17.130 3964 3974 E audio_hw_primary: audio_route_apply_path: invalid audio_route
02-25 13:58:17.130 3964 3974 E audio_hw_primary: update_mixer_state: invalid audio_route
02-25 13:58:17.130 3964 3974 I audio_hw_primary: choose pcmC0D3p for 3
Deducted that pcmC0D3p and pcmC0D7p was referring, respectively, to HDMI/DP,pcm=3 and HDMI/DP,pcm=7, so reading output from step one, we see HDMI 0 is off, and HDMI 1 is on. So figured that i just had to delete /dev/snd/pcmC0D3p, and android would pick up following HDMI (wich is /dev/snd/pcmC0D7p)
3) So i just edited system/etc/init.sh, putting following commands:
function post_init ()
{
rm /dev/snd/pcmC0D3*
}
Remembering that function post_init () above right before function init_cpu_governor (). Reboot and... Everything okay!
--------
That's it. I hope it helps other people that eventually can have this problem. Again, if better solution to solve this exists, i would apretiate your help.
Thanks's everyone. I'll report my other problem tomorrow, because it's late here.
Fabrício.