To get onboard sound working on Teclast F5 with ES8336 codec we needs to use Linux kernel patches from SOF Project and the latest sof-firmware (v1.9).
On NixOS modify your configuration.nix
like the following:
{ config, pkgs, lib, ... }:
{
imports = [
./hardware-configuration.nix
./hardware-fixes/asoc-es8336.nix
];
boot.kernelPackages = pkgs.linuxPackages_5_14;
}
So, I just installed latest available kernel :)
And also added to .bash_profile these commands. If you wish, you can create a systemd service. Note: after disconnecting from bluetooth headset you have to execute the commands again. I saw an awesome script with key binding, but I can't find one again.
The default sound card did not work because the speaker/microphone was turned off in the alsa settings. It is important to use alsa directly. Apparently, the alsa pipewire bridge cannot interact with the soundcard.