Sound working only when booting with nomodeset flag on grub

733 views
Skip to first unread message

Fabrício Pereira

unread,
Feb 22, 2018, 8:45:24 AM2/22/18
to Android-x86
Hi everybody,

First of all, would like to thank all creators of Android-X86 - project has grown better and support has improved a lot from first iterations.

Anyway, i'm using latest CM release, cm-x86-14.1-r1, 32-bit version, but as it is heavilly based on vanilla android-x86 (or it's not?), i believe procedure to solve my problem, is the same.

As topic subject is saying, i could get sound on my machine working, only when booting with nomodeset parameter on grub. When doing that, video driver is reverted to swiftshader (software renderer), instead of using MESA. I don't know if it is relevant or has something to do, actually.

So it's clear i can get sound on my machine. I would like to solve this issue so i can boot normally with sound working. Could someone help me in that? Point me some direction, what can i start doing so we can detect problem and solve it.

My (relevant, i believe) specs so far:

- i7 4970k
- Mobo Asrock Fatal1ty Z97 Killer - https://www.asrock.com/MB/Intel/Fatal1ty%20Z97%20Killer/index.asp wich has probably the most important spec: sound chipset - the one i'm using actually for sound output (Realtek ALC1150)
- PowerColor Radeon HD 7850 AX7850 2GBD5-DH (pretty sure model is correct, can confirm later) - https://www.newegg.com/Product/Product.aspx?Item=N82E16814131473

I have another 'bug' report and willing to boot Android on another pc later, but let's get one problem at a time.

Thanks again for project existence. Hope i can get some help!

Fabricio.


Jon West

unread,
Feb 24, 2018, 10:07:21 PM2/24/18
to Android-x86
Try to boot without the nomodeset and instead using the grub command AUTO_LOAD=old

Chih-Wei Huang

unread,
Feb 26, 2018, 9:41:22 PM2/26/18
to Android-x86
2018-02-22 21:45 GMT+08:00 Fabrício Pereira <frp...@gmail.com>:
> Hi everybody,
>
> First of all, would like to thank all creators of Android-X86 - project has
> grown better and support has improved a lot from first iterations.
>
> Anyway, i'm using latest CM release, cm-x86-14.1-r1, 32-bit version, but as
> it is heavilly based on vanilla android-x86 (or it's not?), i believe
> procedure to solve my problem, is the same.
>
> As topic subject is saying, i could get sound on my machine working, only
> when booting with nomodeset parameter on grub. When doing that, video driver
> is reverted to swiftshader (software renderer), instead of using MESA. I
> don't know if it is relevant or has something to do, actually.
>
> So it's clear i can get sound on my machine. I would like to solve this
> issue so i can boot normally with sound working. Could someone help me in
> that? Point me some direction, what can i start doing so we can detect
> problem and solve it.
>
> My (relevant, i believe) specs so far:
>
> - i7 4970k
> - Mobo Asrock Fatal1ty Z97 Killer -
> https://www.asrock.com/MB/Intel/Fatal1ty%20Z97%20Killer/index.asp wich has
> probably the most important spec: sound chipset - the one i'm using actually
> for sound output (Realtek ALC1150)
> - PowerColor Radeon HD 7850 AX7850 2GBD5-DH (pretty sure model is correct,
> can confirm later) -
> https://www.newegg.com/Product/Product.aspx?Item=N82E16814131473

Please provide info of the two cases:

* dmesg
* lsmod
* logcat
* cat /proc/asound/cards


> I have another 'bug' report and willing to boot Android on another pc later,
> but let's get one problem at a time.
>
> Thanks again for project existence. Hope i can get some help!



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

Fabrício Pereira

unread,
Feb 26, 2018, 10:00:42 PM2/26/18
to Android-x86
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.
Reply all
Reply to author
Forward
0 new messages