TTGO T9 Audio – Everything

I have had those boards (V1.6) for over a decade, had fun plans for them, but never got around to doing anything with them !

This document will always be a work in progress, even after i finish whatever project I will be making, anything new that I find about this board or similar boards will end up here

The TTGO T9 Audio RGB_LED WM8978 is an

  • ESP32 : ESP32-WROVER 802.11 b/g/n + Bluetooth 4.1 LE module with 4MB Flash, 4MB PSRAM
  • audio chip (WM8978 stereo CODEC)
  • SD card slot and 18 RGB LEDs.
  • Gyroscope++: InvenSense MPU-9250 : 9-axis motion-tracking sensor IMU 9-DOF MPU-9250 9-Axis Attitude + Gyroscope + Accelerator + Magnetometer Sensor Module
  • Battery: The circuitry to charge and use a battery in UPS mode !
  • built-in microphone
  • 3.5mm audio jack

Now that I might have some free time soon, I decided to compile the resources here for my reference, and to see what fun project they might be good for !

1- Links

Unorganized links

new boards, AI Thinker … ESP32-A1S

New boards, LyraT

Creating ISO with large files

xorriso -as mkisofs \
-o /hds/1tb/tmp/mystuff.iso \
-iso-level 3 \
-full-iso9660-filenames \
-volid MyStuff \
/hds/12tb/mystuff

As simple as that, now you can just mount the ISO image and files larger than 4GB will just work, but it seems that filenames are correct in Linux, but in ALL CAPS in windows

Should start experimenting with

xorriso -as mkisofs \
-o /hds/1tb/tmp/mystuff.iso \
-iso-level 3 \
-full-iso9660-filenames \
-J \
-R \
-volid MyStuff \
/hds/12tb/mystuff

I am pasting this here because all the other methods (Mounting and writing to, or using the traditional tools seem to fail for some reason)

Installing Whisper AI to a an entry level GPU

Obviously, as you can see from my blog, I have a bunch of high end GPUs for my AI work, the GPU I use on my daily driver PC on the other hand is a complete joke (Nvidia rtx 1650) with 4GB of ram… Not exactly a GPU you would use for anything remotely demanding

But running whisper on my local machine is very convinient, the audio files are already there, no need to login to any remote machines and the like, so i will be installing a small version of whisper here, and let us see how this ancient GPU does

1- I already have Python 3.12.7 installed, if you don’t, then “sudo apt install python3 python3-pip”

python3 -m venv whisper-env

And activate it

source whisper-env/bin/activate

Now, before you procede, if you want your “HuggingFace” directory on a different drive or something (Where the models actually live), you should start by adding the following line to ~/.bashrc or whatever your system uses, also remember to either run (source ~/.bashrc) or to close and open your terminal again for the changes to take effect

export HF_HOME=/mnt/bigdrive/huggingface

Now, let us go ahead and install faster-whisper

pip install faster-whisper

Also, make sure PyTorch with GPU support is available:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Test GPU availability:

python3 -c "import torch; print(torch.cuda.is_available())"

Now, I thought tiny would be the correct size that suits my GPU, but it turned out “mini”base” works just fine !

faster-whisper sample.wav --model-size base --compute-type float16

How do we know if we are hitting the GPU limits ?

watch -n 1 nvidia-smi

12TB disk does not show up

I have been using an intel “D525mw” intel atom system as a network attached storage system for some time now, I have an extra SATA PCIe card (Silicon Image, Inc. SiI 3132) so that I can connect 4 disks, when the 12TB western digital disk (HGST HUH721212AL) is connected to the external SATA card, it does not show up, meaning, an “fdisk -l” does not bring it up !

So the next thing to do is swap the SATA connection with a different disk connected to the motherboard, and suddenly it works, amazing, but I need to know where the problem comes from

The first theory is that disks that are SFF-8447 compliant (rather than the old IDEMA standard) are not supported by this controller !

DVD VOB files to MP4 with FFMPEG

Let us start by analyzing our input files and what we expect to find

  • A video stream, the obvious
  • Audio streams for different languages
  • Audio streams that should play together
  • dvd_subtitle

dvd_subtitle

Let us start with the subtitles, the encoder/decoder for dvd_subtitle stream is either dvdsub or dvbsub.

According to documentation, This codec decodes the bitmap subtitles used in DVDs; the same subtitles can also be found in VobSub file pairs and in some Matroska files.

Metroska uses VobSub, vobsub is basically the same as the stream in DVD but in a file with the extension “*.sub”.

So, I have a stream with “dvd_subtitle” on stream 0:3, to extract, I will probably use a command such as

Extracting the subtitle files

ffmpeg -i input.VOB -c copy -map 0:3 subtitles.sub

Now, at this stage, if you want to convert them to srt for example (Or a text base subtitle system), you will need to use a tool that has OCR !! Such a tool is VobSub2SRT =>

Another method after extracting is using an online service such as this one (https://subtitletools.com/convert-to-srt-online) to turn subtitles into SRT

Find in files and replace in files in Linux

If you are looking for functionality similar to notepad++ functionality of replacing a string in all the files in a certain folder, Look no more, in linux this is a simple command

Assuming you are on the command line and the directory containing the files is the active one (cd)

the following line will replace foo with bar in all files on the current root directory but not in subdirectories

sed -i -- 's/foo/bar/g' *

If you want it to go recursively into sub directories, you can combine the above with the find command

 find . -type f -exec sed -i 's/foo/bar/g' {} +

if you want sed to backup the files before it does the replace, use the following command, you can replace the .bak with anything you like

sed -i.bak -- 's/foo/bar/g' *

SD cards trim command

Many modern SD cards support the trim command () in Linux, the problem is that not many SD card readers (Mostly USB) do

So running () on a mounted card will usually return an error such as

fstrim -v /hds/usb
fstrim: /hds/usb: the discard operation is not supported

The command “lsblk –discard /dev/sdf” should tell you whether your SD card/adapter combination support trim right now, so the failure of the fstrim command above can be predicted in advance with this command

Now, assuming your SD card is not mounted, and you need to format it, Will formatting restore the speed ? unfortunately not, to restore the speed, before formatting your SD card, you might want to run the blkdiscard function, mind you, this command will delete all your data !

blkdiscard -f /dev/sdf

but even that might not work

blkdiscard: Operation forced, data will be lost!
blkdiscard: /dev/sdf: BLKDISCARD ioctl failed: Operation not supported

Adding an internal network to KVM

A private network connects select virtual machines to other virtual machines on the same host, and to the host itself, I usually use it to use samba shares between all virtual machines without giving those virtual machines access to the internet.

To do this, you will need to add a vridge to the host computer without an actual network interface that the bridge connects to, you can also add DHCP if you don’t care to hard code the IP addresses, the virtual machine can then use this interface to talk to other virtual machines or the host itself, A virtual machine can have both this network interface and another that does have access to the internet if you so chose

Continue reading “Adding an internal network to KVM”