Skip to content

Reverse Engineering Hardware

Matthew Anderson edited this page May 21, 2024 · 4 revisions

These instructions are still a WIP are are incomplete

Audio

Dumping Audio Codecs from Windows

You can use a tool called RtHDDump to dump your codecs. You will want to get a dump with and without your headphones plugged in to see what changes under these conditions. You can download the tool here.

Dumping Audio Codecs from Linux

To dump your codecs that are being used in Linux you will want to run these commands
echo 1 |sudo tee /sys/module/snd_hda_codec/parameters/dump_coef
cat /proc/asound/card0/codec#0 > lin_codec-dump
The card number will change based on how your device is configured so be sure to identify that your target device is the correct one.

Dumping Your Pin Layout Using Alsa-Tools

To dump your current pin setup you will want to install the alsa-tools package and run alsa-info.sh which will be located at /usr/bin/alsa-info.sh

Using HDAJackSenseTest

Using HDAJackRetask

Using HDA-Anaylzer

Writing Verbs

Example on how to set what register to read and what to set to write. In this instance we are looking at address 0x10 and writing value 8a20
hda-verb /dev/snd/hwC0D0 0x20 0x500 0x10
hda-verb /dev/snd/hwC0D0 0x20 0x400 0x8a20
0x500 is the read command and 0x400 is the write command. 0x20 is the node, as far as I know this is always the node that will will want to get the coeffs from.

USB

Reading USB Packets using Wireshark

Sending USB Packets To A Device

Setting Up Wireshark To Filter USB-HID Events

HIDRAW

I2C

SPI

ACPI

DSDT

SSDT

Writing A Kernel Patch

Setting Up Git

Setting Up Thunderbird To Manage MBOX