Skip to content

Instantly share code, notes, and snippets.

View CypherpunkSamurai's full-sized avatar
😶
Currently Busy 🌻🐢

Cypherpunk Samurai CypherpunkSamurai

😶
Currently Busy 🌻🐢
View GitHub Profile
@CypherpunkSamurai
CypherpunkSamurai / Display_ST7701.cpp
Created September 2, 2025 15:06 — forked from fallenartist/Display_ST7701.cpp
Waveshare ESP32-S3 Touch LCD 2.1 Example
#include "Display_ST7701.h"
spi_device_handle_t SPI_handle = NULL;
esp_lcd_panel_handle_t panel_handle = NULL;
void ST7701_WriteCommand(uint8_t cmd)
{
spi_transaction_t spi_tran = {
.cmd = 0,
.addr = cmd,
.length = 0,

What is this?

This is where I'll document my research for controlling the SoundCore Liberty Air 2 Pro TWS earbuds without using the manufacturer's mobile app.

First task

The first thing I'll do, and likely the easiest, is figure out how to switch between ANC modes. These earbuds come with Active Noise Cancellation and let you switch between 3 modes: Noise Cancellation, Transparency, and Normal (no ANC applied). The two ANC modes also come with their own submodes.

  • Noise Cancellation
    • Transport
    • Indoor
    • Outdoor
  • Custom (lets you spin a slider to adjust some opaque parameter of the ANC algorithm, ignored for now)

[fit]Port Bluedroid to RTOS






by スカイストリーム せきね

@CypherpunkSamurai
CypherpunkSamurai / irc.md
Created September 2, 2025 15:02 — forked from xero/irc.md
irc cheat sheet
@CypherpunkSamurai
CypherpunkSamurai / gist:526230232a5b0bdd9e0a356236e1ad4f
Created September 2, 2025 15:01 — forked from Quasimondo/gist:ad6e3bc3e0e29db42ee9f3bfcf057853
Stream WAV Files as Bluetooth Mic Input from Raspberry Pi Zero W

Stream WAV Files as Bluetooth Mic Input from Raspberry Pi Zero W

Author: Mario Klingemann

Description

This guide configures a Raspberry Pi Zero W to stream WAV files (8kHz, mono PCM) to a phone via Bluetooth Hands-Free Profile (HFP), simulating a microphone for calls. Tested on Raspbian Bullseye with a Pixel 8 Pro and Pixel 6 Pro, it should work with similar setups.

Note: due to restrictions of Android it seems that headset microphones are not allowed to use certain features like voice assistant or voice typing on the keyboard. This seems to be an ongoing nuisance and I have not found a solution for it.

Note: this might not work on a Raspberry Zero 2 W, since it is using a different bluetooth chip which seems to have certain quirks.

@CypherpunkSamurai
CypherpunkSamurai / switch_audio_profile.sh
Created September 2, 2025 15:00 — forked from untainsYD/switch_audio_profile.sh
Sony MX5/MX6 audio profile switcher
# Sony MX5 profile switcher with proper profile names
# Features:
# - Automatic notifications when switching profiles
# - Toggle between LDAC and mSBC with visual feedback
# - Shows profile transition (from → to) in notifications
DEVICE_MAC="AC:80:0A:30:3A:DD"
get_card_name() {
pactl list cards short | grep bluez_card.${DEVICE_MAC//:/_} | cut -f2
@CypherpunkSamurai
CypherpunkSamurai / win10colors.cmd
Created September 2, 2025 14:59 — forked from mlocati/win10colors.cmd
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@CypherpunkSamurai
CypherpunkSamurai / a2dp.py
Created September 2, 2025 14:58 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@CypherpunkSamurai
CypherpunkSamurai / ANSI.md
Created September 2, 2025 14:57 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@CypherpunkSamurai
CypherpunkSamurai / ANSI-color-codes.h
Created September 2, 2025 14:56 — forked from RabaDabaDoba/ANSI-color-codes.h
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"