Skip to content

Instantly share code, notes, and snippets.

View fermino's full-sized avatar

Fermín Olaiz fermino

View GitHub Profile
@fermino
fermino / cs35l41_spi.md
Created April 4, 2023 16:28 — forked from lamperez/cs35l41_spi.md
CS35L41 amplifiers in an ASUS Zenbook on linux

Asus Zenbook UX3402 speakers on Linux

I got the speakers working on my Asus Zenbook 14 OLED UX3402, the one with Intel CPU and the two CS35L41 audio amplifiers connected over SPI (not the UM3402YA, with AMD and I²C). The amplifiers are supported by the snd_hda_scodec_cs35l41 module in recent kernel versions, but they require some model-specific configuration paramaters, that should be provided by the BIOS, via ACPI. Of course, they are missing. It seems that the Windows drivers have those parameters somehow hardcoded, instead of using ACPI (bad idea, but who am I to criticise). Since Asus has been nasty and refused/was not able to update the BIOS with the missing data, I have patched the ACPI tables myself.

Warning
As stated by Cirrus developers, if you try this there is a non-zero (low, I hope) possibility of

@fermino
fermino / custom_acpi_tables.md
Created April 4, 2023 16:17 — forked from lamperez/custom_acpi_tables.md
Load custom ACPI tables
@fermino
fermino / 20180819-crostini_sommelier_fix.md
Created September 9, 2022 19:34 — forked from bzub/20180819-crostini_sommelier_fix.md
Fix Crostini Wayland/X (sommelier) service

If you can't get X11 or Wayland GUI Linux apps to start anymore on Chrome OS, try the following.

In the Terminal app, this will show the status of your systemd user services/units:

systemctl --user

If sommelier@0.service and sommelier-x@0.service show a failed status, the following worked for me:

sudo ln -s /opt/google/cros-containers/bin/sommelier.elf /usr/bin/
@fermino
fermino / Expressions.php
Created November 30, 2015 02:55 — forked from ircmaxell/Expressions.php
A math parser and evaluator implementation
<?php
class Parenthesis extends TerminalExpression {
protected $precidence = 6;
public function operate(Stack $stack) {
}
public function getPrecidence() {
return $this->precidence;
@fermino
fermino / EmailObfuscator.php
Created November 25, 2014 21:49
Email HTML obfuscator
<?php
function ObfuscateEmail($Email)
{
$Code = 'mailto:';
$Length = strlen($Email);
for($i = 0; $i < $Length; $i++)
{
$Char = dechex(ord($Email[$i]));