raphael / linux-samus

Linux 4.16 on Chromebook Pixel 2015
GNU General Public License v2.0
181 stars 36 forks source link

Kernel 4.6.2 - Sound? #141

Closed rroll1 closed 8 years ago

rroll1 commented 8 years ago

So I just went full-dive into Arch on my Samus LS, and it turns out that in kernel 4.6.2 + Gnome Wayland, (almost) everything works flawlessly out of the box. Trackpad multitouch, touchscreen, suspend, wifi, the works. Cool!

Linux localhost 4.6.2-1-ARCH #1 SMP PREEMPT Wed Jun 8 08:40:59 CEST 2016 x86_64 GNU/Linux

However, the sound still doesn't work. What files / modules / steps would I need to take from this in order to get sound working? I've tried going through the sound.sh script, as well as doing the step-by-step for sound in the README. I've copied the firmware files to /lib/firmware, and I have the conf file in /etc/modprobe.d/. However it appears that I'm missing some modules or drivers:

[root@localhost setup]# ALSA_CONFIG_UCM=ucm/ alsaucm -c bdw-rt5677 set _verb HiFi ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file ucm//bdw-rt5677/bdw-rt5677.conf ALSA lib parser.c:1210:(load_master_config) error: could not parse configuration for card bdw-rt5677 ALSA lib main.c:802:(snd_use_case_mgr_open) error: failed to import bdw-rt5677 use case configuration -2 alsaucm: error failed to open sound card bdw-rt5677: No such file or directory

My presumption here is that I'm missing a driver that's probably included with the Samus kernel -- would anyone be able to provide some insight into this? Or does this need to be baked into the kernel at compile?

Thanks!

ehegnes commented 8 years ago

Somebody correct me if I am wrong, but I believe the driver for our Broadwell audio SoC is completely absent from the vanilla/mainline kernel, and there are many changes to the codec the ASoC uses and its dependent code. Essentially, it doesn't recognize our sound card.

I'm currently attempting to create a minimalistic patchset for 4.6.2 stable, but it takes some time to manually select and apply every necessary commit from the ChromeOS branch. @raphael may be able to do this more quickly with the diffing scripts — I had limited success with them.

raphael commented 8 years ago

Yeah the driver is absent from the main kernel tree hence this repo. You can't just "add it" either because the code just does not work with the latest kernel tree. My patches retrograde the SoC code to a 3.14 compatible interface so that the driver can then be properly compiled. The only way you'll get sound is by using the kernel tree of this repo or when / if the driver gets properly ported. While I've started doing a proper port (rather than the current hacky retrograde stragegy) it's more work than I have time for at the moment. I'm planning on resuming that work end of summer. One last note: the 4.5 kernel introduced too many changes to the SoC components for the retrograde strategy to remain feasible. That's why this repo is still using 4.4 and probably will until a proper driver is devised for the latest kernel. The good news is that everything works great with the kernel in this tree, it's also faster as it is configured specifically for this hardware (CPU etc.).

rroll1 commented 8 years ago

Great, thanks for the thorough explanation! I installed your branch from the AUR and it works great, everything seems to work just as well as CrOS (even the trackpad, which is always what I'm a stickler about).

Thanks again for the great work!