galliumos-distro icon indicating copy to clipboard operation
galliumos-distro copied to clipboard

Audio issues on some Bay Trail models with custom RW_LEGACY firmware

Open reynhout opened this issue 8 years ago • 34 comments

Initial report was on kernel 4.1.14-galliumos.

Reported on IRC:

2016-03-04 08:24:58 cacahuatl I have a bay trail system, I have no audio. ... 2016-03-04 08:33:34 cacahuatl it's using er, max98090 2016-03-04 08:33:45 cacahuatl all the others seem to be using realtek

Reported problems on:

  • CANDY (IRC cacahuatl, @ghost, @jtknapp)
  • ORCO (@Cohen-Carlisle, @cmwedin)
  • BANJO (@pngltn #280)
    • 4.4.6 John Lewis RW_LEGACY NG (IRC doogielabs)
    • 4.7.2 John Lewis RW_LEGACY NG (IRC doogielabs)
    • 4.7.2 MrChromebox RW_LEGACY NG (IRC doogielabs)
  • SQUAWKS (@dkubatko #289)

Reported no problems on:

  • SWANKY (IRC Marvin)
  • GNAWTY (@ColtonDRG)
  • BANJO (@hugegreenbug)
    • 4.7.2 MrChromebox BOOT_STUB (IRC doogielabs)
  • GLIMMER (4.4.6 OK, 4.7.2 OK @balag12 #291)

UPDATES

  • initial reports on kernel 4.1.14-galliumos
  • problem persisted in 4.4.6-galliumos
  • major audio changes in 4.5-upstream, breaking baytrail audio on all firmware types
  • baytrail audio works again on test kernel 4.7.2-galliumos
    • tests OK on GLIMMER with MrChromebox RW_LEGACY firmware
  • audio is confirmed working on 4.7.2-galliumos with MrChromebox BOOT_STUB firmware

reynhout avatar Mar 06 '16 17:03 reynhout

dmesg output

$ sudo dmesg | grep -i -e pcm -e snd -e 98090 -e i2s -e 0f28
[    0.113528] pci 0000:00:15.0: [8086:0f28] type 00 class 0x040100
[    0.131255] pci 0000:00:15.0: can't claim BAR 0 [mem 0xd0400000-0xd05fffff]: address conflict with 80860F28:00 [mem 0xd0400000-0xd05fffff]
[    0.131261] pci 0000:00:15.0: can't claim BAR 1 [mem 0xd091e000-0xd091efff]: address conflict with 80860F28:00 [mem 0xd091e000-0xd091efff]
[   18.433673] snd_hda_intel 0000:00:1b.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   18.451227] snd_hda_intel 0000:00:1b.0: Invalid codec wake callback
[   18.451234] snd_hda_intel 0000:00:1b.0: Invalid codec wake callback
[   18.451368] snd_hda_intel 0000:00:1b.0: Invalid codec wake callback
[   18.455642] snd_hda_intel 0000:00:1b.0: Invalid codec wake callback
[   18.547424] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input8
[   18.547557] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input9
[   18.717108] byt-max98090 byt-max98090: ASoC: CPU DAI baytrail-pcm-audio not registered
[   18.717116] byt-max98090 byt-max98090: snd_soc_register_card failed -517
[   20.080190] baytrail-pcm-audio baytrail-pcm-audio: unable to start DSP
[   20.280356] baytrail-pcm-audio baytrail-pcm-audio: ipc: error DSP boot timeout
[   90.555375] snd_hda_intel 0000:00:1b.0: Invalid codec wake callback
[   90.555382] snd_hda_intel 0000:00:1b.0: Invalid codec wake callback

lspci output

$ sudo lspci -vv -d 8086:0f28
00:15.0 Multimedia audio controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series LPE Audio Controller (rev 0e)
    Subsystem: Intel Corporation Atom Processor Z36xxx/Z37xxx Series LPE Audio Controller
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 0
    Region 0: Memory at 80000000 (32-bit, non-prefetchable) [size=2M]
    Region 1: Memory at 80201000 (32-bit, non-prefetchable) [size=4K]
    Capabilities: [80] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-

ghost avatar Mar 06 '16 18:03 ghost

adding similar dmesg grep from the device running chromeos

$ sudo dmesg | grep -i -e pcm -e snd -e 98090 -e i2s -e 0f28
$ grep -i -e pcm -e snd -e 98090 -e i2s -e 0f28 foo.txt 
[    1.861695] Modules linked in: iwlmvm(+) iwl7000_mac80211 iwlwifi bluetooth cfg80211 uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev joydev snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device ppp_async ppp_generic slhc tun
[    1.963780] Modules linked in: btusb btbcm btintel iwlmvm(+) iwl7000_mac80211 iwlwifi bluetooth cfg80211 uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev joydev snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device ppp_async ppp_generic slhc tun
[    5.505087] sst-acpi 80860F28:00: Skipping ACPI power domain attach
[    5.715941] snd_hda_intel 0000:00:1b.0: irq 107 for MSI/MSI-X
[    5.715988] snd_hda_intel 0000:00:1b.0: setting latency timer to 64
[    5.723614] snd_hda_intel 0000:00:1b.0: codec_mask = 0x4
[    5.751563] max98090 1-0010: MAX98090 REVID=0x43
[    5.791175] max98090 1-0010: No platform data
[    5.791506] baytrail-pcm-audio baytrail-pcm-audio: ASoC: Failed to create Analog Capture debugfs file
[    5.795672] snd_soc_sst_byt_max98090_mach: get baytrail acpi spk_status: 1
[    5.796121] byt-max98090 byt-max98090:  HiFi <-> Front-cpu-dai mapping ok
[    5.796284] byt-max98090 byt-max98090:  HiFi <-> Front-cpu-dai mapping ok
[    5.796328] byt-max98090 byt-max98090: ASoC: Failed to add Headphone Switch: -16
[    5.848975] input: byt-max98090 Mic Jack as /devices/platform/80860F28:00/byt-max98090/sound/card1/input7
[    5.849153] input: byt-max98090 Headphone Jack as /devices/platform/80860F28:00/byt-max98090/sound/card1/input8
[    5.849593] snd_soc_sst_byt_max98090_mach: snd_byt_mc_probe successful
[    5.949220] input: HDA Intel HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input9
[    5.949398] input: HDA Intel HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input10
[    6.122635] max98090 1-0010: DMIC Mux: put_dmic_mux enable DMIC
[    6.256811] max98090 1-0010: DMIC Mux: put_dmic_mux enable DMIC
[ 2216.209424] calling  baytrail-pcm-audio+ @ 26822, parent: 80860F28:00
[ 2216.209432] call baytrail-pcm-audio+ returned 0 after 0 usecs
[ 2216.209440] calling  byt-max98090+ @ 26822, parent: 80860F28:00
[ 2216.209447] call byt-max98090+ returned 0 after 0 usecs
[ 2216.209786] calling  snd-soc-dummy+ @ 26822, parent: platform
[ 2216.209788] call snd-soc-dummy+ returned 0 after 0 usecs
[ 2216.324906] calling  80860F28:00+ @ 26822, parent: platform
[ 2216.324913] call 80860F28:00+ returned 0 after 0 usecs
[ 2216.853235] calling  baytrail-pcm-audio+ @ 26822, parent: 80860F28:00
[ 2216.853260] call baytrail-pcm-audio+ returned 0 after 16 usecs
[ 2216.940750] calling  baytrail-pcm-audio+ @ 26822, parent: 80860F28:00
[ 2216.974595] call baytrail-pcm-audio+ returned 0 after 33016 usecs
[ 2216.978635] snd_hda_intel 0000:00:1b.0: setting latency timer to 64
[ 2216.978666] snd_hda_intel 0000:00:1b.0: irq 107 for MSI/MSI-X
[ 2217.210359] calling  80860F28:00+ @ 26822, parent: platform
[ 2217.210366] call 80860F28:00+ returned 0 after 0 usecs
[ 2218.296070] calling  snd-soc-dummy+ @ 26822, parent: platform
[ 2218.296077] call snd-soc-dummy+ returned 0 after 0 usecs
[ 2218.296249] calling  byt-max98090+ @ 26822, parent: 80860F28:00
[ 2218.296256] call byt-max98090+ returned 0 after 0 usecs
[ 2218.296263] calling  baytrail-pcm-audio+ @ 26822, parent: 80860F28:00
[ 2218.296271] call baytrail-pcm-audio+ returned 0 after 0 usecs

ghost avatar Mar 08 '16 01:03 ghost

Could you try a newer kernel that I'm working on for 2.0?: http://galliumos.org/apt/pool/main/l/linux-source-4.3.6galliumos/ .

Note, that won't be the final kernel. I hope to move to 4.5 before we release 2.0.

hugegreenbug avatar Mar 08 '16 16:03 hugegreenbug

Linux host 4.3.6galliumos #6 SMP PREEMPT Sat Mar 5 22:10:15 MST 2016 x86_64 x86_64 x86_64 GNU/Linux
[    0.095804] pci 0000:00:15.0: [8086:0f28] type 00 class 0x040100
[   33.036083] snd_hda_intel 0000:00:1b.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   33.169864] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input7
[   33.170004] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input8
[   33.529172] byt-max98090 byt-max98090: ASoC: CPU DAI baytrail-pcm-audio not registered
[   33.529181] byt-max98090 byt-max98090: snd_soc_register_card failed -517
[   33.877613] byt-max98090 byt-max98090: ASoC: CPU DAI baytrail-pcm-audio not registered
[   33.877621] byt-max98090 byt-max98090: snd_soc_register_card failed -517
[   34.910381] baytrail-pcm-audio baytrail-pcm-audio: unable to start DSP
[   35.110553] baytrail-pcm-audio baytrail-pcm-audio: ipc: error DSP boot timeout

Seeing more or less the same as with current (also on ubuntu 15.10, fedora 23, archlinux, etc).

ghost avatar Mar 09 '16 01:03 ghost

https://www.reddit.com/r/linuxquestions/comments/3zxrki/no_sound_with_ubuntu_1510_on_dell_chromebook_11/cyq3rwe someone was able to get the audio working out of the box with 15.10 after tweaking/replacing the ALSA state. I'm not able to reproduce this though. I'm going to see if I can get more information about what they did.

ghost avatar Mar 17 '16 02:03 ghost

I also have the same problem with the exact same dmesg output. Found a guide online for installing debian on a dell candy (https://www.reddit.com/r/linux/comments/4aj29c/howto_debian_on_dell_chromebook_113120_candy2015/), I followed the guide and the firmware that the writer said to install for sound didn't fix the issue for me.

Chemgeer avatar Mar 27 '16 03:03 Chemgeer

I think this thread ( https://www.reddit.com/r/linux/comments/4aj29c/howto_debian_on_dell_chromebook_113120_candy2015/d1ex0mk ) is worth a read, establishing that between users the main difference seems to be RW_LEGACY vs BOOT_STUB, and it seems to result in significantly different behavior in the boot process, possibly starting with the 'CITY'/'Calgary' BIOS detection, however MattDevo and JohnLewis both suggest that this shouldn't be a significant factor ( https://plus.google.com/115072581063115222604/posts/YqTf7XSzabW )

ghost avatar Mar 31 '16 04:03 ghost

https://www.reddit.com/r/linux/comments/4aj29c/howto_debian_on_dell_chromebook_113120_candy2015/d1lk7gk this confirms this is some problem caused by a difference between BOOT_STUB and RW_LEGACY

ghost avatar Apr 01 '16 14:04 ghost

@hugegreenbug The current LTS kernel is 4.4... We should probably use that one if we don't want to do porting work every couple months.

ghost avatar Apr 10 '16 06:04 ghost

@MattDevo will know the current state of things, but we should keep this open for tracking and reference.

reynhout avatar Apr 26 '16 21:04 reynhout

so with RW_LEGACY, the ChromeOS payload (depthcharge) is still run, in order to show the developer mode boot screen. Depthcharge does some hardware initialization on the audio device (and eMMC), which apparently causes some issues when running (non-ChromeOS) Linux. When using a modified BOOT_STUB, depthcharge is replaced with SeaBIOS, so that extra init never happens, and the kernel is happy.

As an example of what's going on, see: https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/firmware-ninja-5216.383.B/src/board/ninja/board.c#85

MrChromebox avatar Apr 27 '16 01:04 MrChromebox

@MattDevo Any ideas on how we could try to get this working from inside the OS? It does seem to work on some models(?) @ColtonDRG reports working audio on GNAWTY...

reynhout avatar May 03 '16 16:05 reynhout

IRC Marvin reports no audio problems on SWANKY with RW_LEGACY from MattDevo.

reynhout avatar Jun 08 '16 17:06 reynhout

No sound on my Lenovo 100s with MattDevo RW_LEGACY running GalliumOS 1.0. Doesn't really bother me but I'm happy to provide any useful debugging information requested.

Cohen-Carlisle avatar Jun 11 '16 14:06 Cohen-Carlisle

I have an ORCO chromebook (Lenovo 100s) with MattDevo's RW_legacy, and I had this problem with both GalliumOS and lubuntu. I haven't tried other OS's, but I would assume they would have the same problem.

cmwedin avatar Jul 23 '16 17:07 cmwedin

IRC TMPS: GNAWTY, MrChromebox RW_LEGACY, GalliumOS kernel 4.7.2:

  • non-working internal speaker
  • non-working internal mic
  • working audio out/headphone jack on first plugin
    • unplug/replug causes static/no audio, ALSA restart restores audio
  • audio in/headset mic is untested

Which would suggest at least partially successful hardware init.

reynhout avatar Nov 21 '16 03:11 reynhout

Toshiba Chromebook 2 CB30-B-103 (SWANKY, Bay Trail), RW_Legacy and John Lewis firmware Experiencing same issues as @reynhout

This problem does effect at least some SWANKY models

jmaris avatar Nov 22 '16 13:11 jmaris

Some more info from IRC pavel: SWANKY, John Lewis RW_LEGACY, GalliumOS kernel 4.7.2:

  • Internal speakers working when mic is disabled and output sink is set to Analog Stereo
  • Internal speakers non-working when mic is enabled

This really sounds like a PulseAudio (or ALSA) configuration problem. If anyone with appropriate hardware can spend some time digging, I think this should be simple to resolve.

For those who need a quick fix (and who are not dual-booting), MrChromebox BOOT_STUB firmware seems to be it.

reynhout avatar Dec 20 '16 17:12 reynhout

Some observations from our test GNAWTY:

  • MrChromebox RW_LEGACY firmware
  • kernels 4.7.2-galliumos and 4.8.15-galliumos

When initially installed, I had perfect audio playback. Started looking at input, and saw that the level meter in pavucontrol for the internal mic was pegged. Tried to record a clip with arecord clip.wav, was silent on playback (aplay clip.wav). Other playback sources were now also silent. Rebooted, and machine had lost the "max98080 Analog audio" sink, but it was still showing the device in the output of aplay -l.

I was able to restore audio by deleting $HOME/.config/pulse, and logging out/in.

Have not been able to repro the initial failure (arecord works, aplay plays back, mic level meter is not pegged, etc).

For those affected and still on RW_LEGACY firmware. Maybe try rm -rf $HOME/.config/pulse and then log out/in to see if anything is improved.

reynhout avatar Jan 10 '17 03:01 reynhout

Toshiba CB30-B-104, Linux Swanky 4.7.2. latest MrChromebox rom/script (download today 2017-02-10) BOOT_STUB installed. As mentioned by many others: No sound on speakers. Sound on headphones first time. Unplug/replug headphones gives static noise with very vaguely some music.

When viewing movie in VLC after plug/unplug headphones: no sound. In VLC from audio menu switch to "internal audio digital Stere (HDMI)": no sound. Still in VLC switching back to "byt-max98090 Analog Stereo": Again sound (yeah!). Somehow VLC is able to restore the output on the headphones. I can repeat this multiple times and it works 9 out of 10 times. When watching/listening a video on Youtube, the sound is also restored after the VLC workaround.

Removing .config/pulse has no effect.

Edit: Sorry. Muting microphone via alsamixer doesn't have any effect on speakers.

hvdwolf avatar Feb 10 '17 19:02 hvdwolf

@hvdwolf Thanks for the report.

Some thoughts:

  • If VLC can trigger the "fix", then it's almost certainly in user config versus system config
  • Removing $HOME/.config/pulse will probably not work unless you also restart pulseaudio, or log out/in
  • The headphone jack detection event handler will definitely transition states, either at the ALSA level or the pulse level. It's possible that that transition is causing the config decay. I have seen similar issues without plugging/unplugging the phones, so the transitioned config is probably not specific to the jack detection event handler..

Just thinking aloud, and capturing info in one place.

reynhout avatar Feb 10 '17 20:02 reynhout

Updated to Linux Swanky 4.8.17-galliumos beta on my Toshiba CB30-B-104, MrChromebox BOOT_STUB installed

Sound is working from both speakers and headphones.

hvdwolf avatar Feb 11 '17 14:02 hvdwolf

Update from RW_Legacy to BOOT_STUB and Full ROM, no changes!

ASUS C300 Chromebook - https://github.com/GalliumOS/galliumos-distro/issues/367

ghost avatar Oct 27 '17 15:10 ghost

I had this issue on my Toshiba Chromebook 2 for a long time under Arch Linux. Switching to https://aur.archlinux.org/packages/linux-max98090/ seemed to fix it. Not super relevant since it's a different distro, but might provide some hints.

d4l3k avatar Nov 02 '17 04:11 d4l3k

It's seems very promising! Now I have to find a the driver for GalliumOS.

  • Thank you!

ghost avatar Nov 02 '17 13:11 ghost

I'm having similar issues on:

  • GNAWTY (Acer CB3-111)
  • GalliumOS 2.1(kernel 4.8.17)
  • MrChromebox's RW_LEGACY firmware

The sound works at first (both internal speakers and headphones), but after a while (especially when opening CPU-intensive webpages in Firefox) gets very choppy. Pulseaudio's CPU usage gets to around 50% and stays there until I close the application that uses audio (I'm assuming this is what causes the choppiness).

Neither killing pulseaudio nor removing the ~/.config/pulse folder works. The issue also persists through restarts.

Getting the following dmesg messages:

[    4.888011] byt-max98090 byt-max98090: ASoC: CPU DAI baytrail-pcm-audio not registered
[    4.888092] byt-max98090 byt-max98090: snd_soc_register_card failed -517

andzaytsev avatar Oct 07 '18 00:10 andzaytsev

Installed GalliumOS 3.0alpha2, the issue persists. The kernel version is 4.16.13. Not getting the above dmesg message anymore, but /var/log/syslog has the following:

Oct  6 21:00:27 chrx pulseaudio[926]: [alsa-sink-1] alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Oct  6 21:00:27 chrx pulseaudio[926]: [alsa-sink-1] alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_soc_sst_cht_bsw_max98090_ti'. Please report this issue to the ALSA developers.
Oct  6 21:00:27 chrx pulseaudio[926]: [alsa-sink-1] alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.

Also the maximum volume on 3.0alpha2 is much quieter.

andzaytsev avatar Oct 07 '18 02:10 andzaytsev

The maximum volume with GalliumOS 3.0 (kernel 4.16.18-galliumos) is too quiet on Acer Chromebook 11 (CB3-131), GNAWTY, 2016, Intel Bay Trail with MrChromebox RW_LEGACY firmware. This works fine with GalliumOS 2.1.

cizmazia avatar Aug 19 '19 06:08 cizmazia

@cizmazia is that the same issue as https://github.com/GalliumOS/galliumos-distro/issues/520 ?

OP said this wasn't an issue on GNAWTY, but that was also probably on GalliumOS 2.1. It seems that something happened in the drivers in 3.0 that caused a bunch of audio problems for Bay Trails. Is this still the appropriate thread for GNAWTY?

kousu avatar Jun 10 '20 17:06 kousu

@kousu thanks for pointing me to #520. I'll give it a try. I've been stuck with GalliumOS 2.1 for this one reason.

cizmazia avatar Jun 10 '20 20:06 cizmazia