sebanc / brunch

Boot ChromeOS on x86_64 PC - Supports Intel CPU/GPU from 8th gen or AMD Ryzen
GNU General Public License v3.0
3.6k stars 388 forks source link

Internal microphone not working #56

Open frigis1 opened 4 years ago

frigis1 commented 4 years ago

This is on an Acer Spin SP111-31. Internal microphone is not working, but if I plug in a headset with a microphone, the headset mic works fine. Currently using r80 k4.19 stable - r81 k4.19 testing does not work on this laptop.

sebanc commented 4 years ago

Hi, the audio in ChromeOS depends on the linux kernel support and generally works the same way as in linux. Unfortunately, browsing linux forums for your device or similar ones, I found several reports of microphone not working but no solution so it does not seem like I there is something I can do. Don't hesitate to have a look as well and see if you find something interesting.

I am also interested by the second part of the issue as the recent testing versions are the base for future stable releases. Could you tell me what is the issue with testing versions ? (do not boot, no android apps support...)

ggoraa commented 4 years ago

I have the same issue, device HP EliteBook 840 G3, brunch r80 v2

frigis1 commented 4 years ago

Not sure how much this helps, but mic seems to work fine on Lubuntu 19.10 on a live USB. As for the testing versions, r80 k4.19 testing worked fine, but when I updated to r81 testing using the recommended method, the laptop shuts down a few seconds after the login screen. I also tried installing it from scratch with the same results (shutdown a few seconds after welcome screen). Went back to r80 stable with no problems (microphone aside).

And thank you for the prompt reply. This is amazing work!

nicktelindert commented 4 years ago

My internal mic also isn't working at all. Which is really weird because it is linux compatible. The laptop came pre-installed with linux and i have done a lot of distro hopping and never had that problem before. It is a Dell XPS 13 9380

nicktelindert commented 4 years ago

I did some testing, the internal mic works when i plugin a headphone(without mic). I will further look into this.

nicktelindert commented 4 years ago

I get the internal mic working with the following: amixer -c0 set "Internal Mic" toggle amixer -c0 set "Capture" 40%

After reboot the Internal Mic is turned off again.

frigis1 commented 4 years ago

Interesting, this works for me, too! This setting also resets after reboot for me.

After tinkering a bit, I think I see the problem for my case. There are two toggles, the headset mic and internal mic. Enable one, and the other is automatically disabled. Presumably the headset mic should automatically enable when you plug in headphones, and the internal mic gets enabled when nothing's plugged in.

In my case, the toggle is stuck on headset mic whether or not headphones are plugged in, which means my internal mic is always disabled, but headset mic is fine if I plugged one in. I can manually enable internal mic thanks to the commands you posted, but then the headset mic is disabled.

Thank you for that post, nicktelindert!

sebanc commented 4 years ago

I get the internal mic working with the following: amixer -c0 set "Internal Mic" toggle amixer -c0 set "Capture" 40%

After reboot the Internal Mic is turned off again.

Great find !

If you want to automate it, you can create a bootscript by running in crosh shell:

sudo mkdir /var/brunch/bootscripts
echo 'amixer -c0 set "Internal Mic" toggle' | sudo tee /var/brunch/bootscripts/sound.sh
echo 'amixer -c0 set "Capture" 40%' | sudo tee -a /var/brunch/bootscripts/sound.sh
sudo chmod 0755 /var/brunch/bootscripts/sound.sh
jordanvanbergen commented 4 years ago

I get the internal mic working with the following: amixer -c0 set "Internal Mic" toggle amixer -c0 set "Capture" 40%

After reboot the Internal Mic is turned off again.

The first command works on my Lenovo Ideapad Yoga 13 and I thought YES the internal mic is going to work but the second line generates this error: amixer: Unable to find simple control 'Capture' ,0

frigis1 commented 4 years ago

Try running: amixer scontrols It should come up with 'Master',0 and something else below that - try using that name (not master, but the other one) instead of "Capture."

hacker1024 commented 4 years ago

@nicktelindert, what do those commands do? They fix it, but why 40%?

jordanvanbergen commented 4 years ago

Try running: amixer scontrols It should come up with 'Master',0 and something else below that - try using that name (not master, but the other one) instead of "Capture."

I get this output

amixer scontrols Simple mixer control 'Master',0 Simple mixer control 'Capture',0

So it's Capture but I get:

amixer -c0 set "Internal Mic" toggle Simple mixer control 'Internal Mic',0 Capabilities: cvolume cvolume-joined cswitch cswitch-joined Capture channels: Mono Limits: Capture 0 - 80 Mono: Capture 0 [0%] [-74.00dB] [on]

and:

amixer -c0 set "Capture" 40% amixer: Unable to find simple control 'Capture',0

frigis1 commented 4 years ago

@jordanvanbergen Maybe try: amixer set "Capture" 40% (without -c0) @hacker1024 The commands seem to enable the internal mic, and then set "capture" (input) to 40% volume, you can set it to 100% volume if you want.

sebanc commented 4 years ago

Hi, could you confirm that the issue persist with the new testing release ?

jordanvanbergen commented 4 years ago

Hi, could you confirm that the issue persist with the new testing release ?

Will try today. This will be the 2nd time I am going to upgrade brunch & Chrome OS. I assume I will have to do this:

sudo chromeos-update -r < path to the ChromeOS recovery image > -f < path to the Brunch release archive >

sebanc commented 4 years ago

yes if you want to update both, if you only want to update brunch: sudo chromeos-update -f < path to the Brunch release archive >

hacker1024 commented 4 years ago

The issue is still there for me.

jordanvanbergen commented 4 years ago

yes if you want to update both, if you only want to update brunch: sudo chromeos-update -f < path to the Brunch release archive >

Installed new Brunch release. How can I tell it's been installed correctly? Can I see a version number somewhere from command line ?

So it's updated correctly -> Chrome OS update tells me I am on the latest version (even with or without options=enable_updates

But the internal mic is not working.

https://imgur.com/7gwlSXA

it shows in skype for example or other programs. But it's not working.

frigis1 commented 4 years ago

@sebanc Mic issue still persists - microphone still has no jack detection. The good news is, the laptop no longer shuts down after the welcome screen (note: still using rammus). @jordanvanbergen One more thing you can try, punch in the following: sudo nano /etc/modprobe.d/alsa.conf Then add the following at the end of the file: options snd-hda-intel model=generic Then hit ctrl+x, hit Y to save, hit enter, then reboot. For me, this disables the headset mic, but enables the internal mic.

sebanc commented 4 years ago

@frigis1 Thanks for the feedback, i will keep looking into it

jordanvanbergen commented 4 years ago

@sebanc Mic issue still persists - microphone still has no jack detection. The good news is, the laptop no longer shuts down after the welcome screen (note: still using rammus). @jordanvanbergen One more thing you can try, punch in the following: sudo nano /etc/modprobe.d/alsa.conf Then add the following at the end of the file: options snd-hda-intel model=generic Then hit ctrl+x, hit Y to save, hit enter, then reboot. For me, this disables the headset mic, but enables the internal mic.

the sudo nano /etc/modprobe.d/alsa.conf with options snd-hda-intel model=generic did not work for me (Lenovo Ideapad Yoga 13)

sebanc commented 4 years ago

Hi, I applied audio fixes on the new release, not sure which devices were actually affected by those issues though but don't hesitate to try it.

nicktelindert commented 4 years ago

@sebanc I'll try it out

frigis1 commented 4 years ago

@sebanc Thank you, but issue still persists on my laptop.

sebanc commented 4 years ago

@frigis1 Thanks for testing, i will keep looking into it

tungmeister commented 4 years ago

I'm also getting this issue on my Dell E5840, running amixer -c0 set "Internal Mic" toggle does resolve the problem though until reboot. I was going to add a startup script however there's no brunch directory under var.

sebanc commented 4 years ago

@tungmeister you have to create the /var/brunch/bootscripts directory first

tungmeister commented 4 years ago

@sebanc I wasn't certain due to the lack of existing brunch directory, I've created the brunch and bootscripts directories however it doesn't work.

sebanc commented 4 years ago

Try the following commands:

sudo mkdir -p /var/brunch/bootscripts
echo 'amixer -c0 set "Internal Mic" toggle' | sudo tee /var/brunch/bootscripts/alsa.sh
sudo chmod 0755 /var/brunch/bootscripts/alsa.sh
sebanc commented 4 years ago

For those of you who updated to r83, have you tried the flag "chrome://flags/system-tray-mic-gain" and if so does it help with this issue ?

frigis1 commented 4 years ago

I have updated to r83 and the latest Brunch framework, and enabled the flag. I only get white noise.

sebanc commented 4 years ago

@frigis1 Could you try to update to the latest build in the "brunch-testing" repo: https://github.com/sebanc/brunch-testing/releases

frigis1 commented 4 years ago

Updated to latest testing build, still the same result.

sebanc commented 4 years ago

Thanks for the feedback on both tests

kowalski7cc commented 4 years ago

Same thing happens on XPS 13 9350: Card: HDA Intel PCH Chip: Realtek ALC3246 lspci: 1c.5-[3b]----00.0 Realtek Semiconductor Co., Ltd. Device [10ec:525a]

sebanc commented 4 years ago

For those who use, 'amixer -c0 set "Internal Mic" toggle' to activate internal mic, could you verify if your mic works without this command if you create a file /etc/init/alsafix.conf (sudo nano /etc/init/alsafix.conf) with the below content ?

start on stopped udev-trigger

script
        if [ $(amixer -q -c 0 get "Internal Mic") -eq 0 ]; then amixer -q -c 0 set "Internal Mic" unmute; fi
end script
frigis1 commented 4 years ago

Internal mic does not switch on for me if I use this file.

sebanc commented 4 years ago

@frigis1 Thanks! Could you try the below one ?

start on stopped udev-trigger and started ui

script
    if [ "$(amixer -q -c 0 get "Internal Mic")" = "0" ]; then amixer -q -c 0 set "Internal Mic" toggle; fi
end script

Also if your run "udevadm info" in crosh shell and then plug your headphones, do you see related lines appear in crosh shell ?

frigis1 commented 4 years ago

That script does not work for me either. I ran udevadm info and the shell listed some options: help, query, path, etc. Didn't seem to provide any information.

Shamw0w commented 4 years ago

EDIT: After re-reading the thread and looking at what I did, I realised that whilst I had turned on Capture and set the capture volume / gain, I hadn't activated internal mic (even thought it was listed in the sound settings and had its own slider). Once I ran amixer -c0 set "Internal Mic" toggle it worked.

Hi all, on Dell Inspiron 3000. Internal mic does not work, but headset with mic works when plugged in 3.5mm jack.

I've read the above and tried the following and these are the results I get:

chronos@localhost / $ amixer Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 100 Mono: Playback 100 [100%] [on]

chronos@localhost / $ amixer -c0 set "Capture" toggle Simple mixer control 'Capture',0 Capabilities: cvolume cswitch Capture channels: Front Left - Front Right Limits: Capture 0 - 63 Front Left: Capture 63 [100%] [30.00dB] [on] Front Right: Capture 63 [100%] [30.00dB] [on]

Even with toggling the mic on and setting capture to 100% I don't seem to capture any input.

When I run AlsaMixer it only shows 1 master channel (at 100).

Any tips / advice? Have I missed something I need to try in the thread?

Shamw0w commented 4 years ago

Also, FWIW, I just did a reboot and tested the mic (without saving a boot script), and the mic worked without needing to toggle it on.

hacker1024 commented 3 years ago

@frigis1 Could you try to update to the latest build in the "brunch-testing" repo: https://github.com/sebanc/brunch-testing/releases

Enabling the new option added fixes it for me. Thanks for your great work.

I have a Dell Inspiron 7586 with an ALC295 card.

ghost commented 3 years ago

Inspiron 3443 microphone not working ALC3234. "amixer -c0 set "Internal Mic" toggle" - wont work

Output: Unable to find Simple Control "Internal Mic"

omminp commented 3 years ago

Internal mic not working, but when pluged in headset mic works. Realtek ALC3204

Fix by crosh shell sudo alsactl restore

To make permanent after reboot, create /var/brunch/bootscripts as described earlier in this thread, create alsa.sh with the line sudo alsactl restore and make alsa.sh executable.

Works for me, so maybe worth a try.

dkannegi commented 3 years ago

I am running Chrome 84 Rammus on Brunch r85 k4.19 testing 20200905 on the following laptops: Panasonic Toughbook CF-C2 MK1 and a MK2. They load up without the mic control showing at all in the UI, my fix was to steal alsa-base.conf from my Linux Mint 20 x64 boot usb and plopped it into Chrome's install at /etc/modprobe.d/alsa.conf (original renamed as a .bak). One reboot later and I got my mic working as internal mic. Of note, on the CF-C2s and maybe most other toughbooks, the headphone port is software switchable, however the mic port only shows up as 'internal mic' and an external mic is switched in-line by the jack circuit. My Amixer -q c0 and c1 output is attached (this computer has two, c1 is my main onboard sound).
amixer_c1_panasonic_CFC2MK2.txt amixer_c0_panasonic_CFC2MK2.txt dmesg.txt alsa.conf.txt

sebanc commented 3 years ago

@dkannegi Thanks for the report, that's a very interesting find :) Now I would need to understand exactly what command is causing this.

I don't really see what in the linux mint alsa-base.conf file could be related to this, however it is replacing the chromeos alsa.conf which contains "options snd cards_limit=1" by default.

Could you rebuild the rootfs and try to only remove "options snd cards_limit=1" from chromeos /etc/modprobe.d/alsa.conf ?

dkannegi commented 3 years ago

I upgraded using the chromeos-update command after the first post using ChromeOS 85 and the latest brunch (Brunch r85 k4.19 testing 20200919) which reset the asla.conf and the mic remained available in the UI upon reboot. I afterwards went into the alsa.conf and #remarked the "options snd cards_limit=1" line. Not sure if an upgrade is different from doing a full wipe of the hard drive.

sebanc commented 3 years ago

An upgrade just resets the rootfs partition, several things could have happened here:

To directly implement a fix in brunch, I would need to know exactly what modification is necessary to make mic work on a clean install. (Without too many modifications, copying over the full Linux Mint alsa conf over the chromeos would probably break sound for others)

dkannegi commented 3 years ago

I did a test with a fresh USB install of CrOS 84 and brunch r85 k4.19 testing 20200905 with the mic not showing up, and tested commenting out "options snd cards_limit=1". End result is that the mic still didn't show up. I will attempt running a chromeos-update command in the USB to bring both CrOS to 85 and brunch to the latest test version and see if it catches it. Of note, it turns out this laptop has a Realtek ALC269 (PCIID 10EC:0269) as found out when I put Windows 10 on it, Windows 10 picked it up correctly, but I had another laptop with the same chip not correctly enumerate under Windows so I had basic audio out and no input/mic until I manually installed the Realtek driver, which then allowed everything to work. Realtek DACs are very weird as they can act as a passthru if there is another sound controller onboard (e.g. nVidia nForce chipsets) OR they can be the sound controller also.

sebanc commented 3 years ago

@dkannegi Thanks for trying it :) The issue must then be related to something else, I will try to see what other parameter could cause that