INTERACTIVE!!! Press LOAD/REWIND to start the tape drive with the patches tape!
Miscellaneous patchsets
Here at Exotic Silicon, we make local changes to a lot of the opensource software that we use. Although we try to upstream the most useful ones, sometimes that doesn't happen either because we're too busy, or because the changes are too specific to be of wider interest.
Some of our more recent patchsets have their own dedicated pages elsewhere on the site together with comprehensive notes and usage instructions.
This page provides download links for a few which do not.
No warranty
Although we take pride in the quality of our work, and strive to deliver only code of the highest standards, the following patches are provided AS IS and with NO WARRANTY. We make no guarantees that they will work as described, or that they won't break other functionality, possibly in subtle ways that might not be immediately obvious.
Be aware that all of our local patches were originally written for our own internal use, and our requirements are likely to be different to yours.
Signify key
All of the patches on this page have been signed with the following signify key:
This patch adds the ability to use true bold and italic text on the OpenBSD console.
Once applied, the terminal will respond to the following control sequences which were previously not implemented:
␛[3m - Enable italics
␛[23m - Disable italics
Note that the default terminal type of 'vt220' does not define the sitm and ritm sequences, so programs which rely on parsing the terminfo terminal description will not support italics even using this patch, without further re-configuration.
Existing file supplement flag for cp
File
Changes
Description
src/bin/cp/cp.c
+3 lines
~3 lines
Add s to getop.
Add int sflag.
src/bin/cp/extern.h
~1 line
Add int sflag.
src/bin/cp/utils.c
+7 lines
~2 lines
If a file exists with the same name in the destination directory, return 1 and do not perform the copy.
Otherwise, allow the copy to proceed and print a diagnostic message to stderr.
This patch adds a new -s flag to cp. When used, the files in the destination directory are supplemented by the files being copied, rather than being overwritten.
For example, if we have two directories, source and dest, containing the following files:
# ls -l source
total 6
-rw-r--r-- 1 root wheel 12 Jan 1 1970 bar
-rw-r--r-- 1 root wheel 26 Jan 1 1970 baz
-rw-r--r-- 1 root wheel 6 Jan 1 1970 foo
# ls -l dest
total 0
-rw-r--r-- 1 root wheel 0 Jan 1 1970 foo
#
Then the output and result of cp -psv source/* dest/ will be:
# cp -psv source/* dest/
dest/bar doesn't already exist, copying
source/bar -> dest/bar
dest/baz doesn't already exist, copying
source/baz -> dest/baz
# ls -l source
total 4
-rw-r--r-- 1 root wheel 12 Jan 1 1970 bar
-rw-r--r-- 1 root wheel 26 Jan 1 1970 baz
-rw-r--r-- 1 root wheel 0 Jan 1 1970 foo
#
The file ‘foo’ in the destination directory was not overwritten.
Call recording and announcement for SXMO
File
Changes
Description
bin/sxmo_modemcall.sh
+11 lines
Make $HOME/call_rec if it doesn't already exist.
Create a base filename using the template YYYYMMDD_HHMMSS_{number}.
Record audio data to a wav file.
Write some cellular network data to a text file
Play an announcement from $HOME/answer.wav file to incoming calls
SXMO 1.4.1 as included in postmarketOS v21.03 20210605-0335.
Tested on
Pinephone.
KNOWN ISSUES
There are a couple of known issues with this patch:
In-call audio quality is negatively affected locally, due to the re-sampling method used to convert 8000 Hz to 48000 Hz. Samples are simply duplicated rather than being interpolated, causing spurious high frequencies.
The wav file header is written with an incorrect length, as the recording is not cleanly stopped when the recording process is terminated.
This patch implements a simple automatic PSTN call recording and announcement function in SXMO.
Once this patch is applied, all PSTN calls placed or received will be recorded.
Call audio is written to a wav file in $HOME/call_rec/ using the following filename template:
YYYYMMDD_HHMMSS_{number}_[inc|out].wav
Call audio filename template
In which number is either the telephone number dialed for outgoing calls, or that provided by the network for incoming calls. Incoming calls are further identified with inc, and outbound calls are identified with out.
Some information provided by the cellular network is written to a text file with a similar name:
YYYYMMDD_HHMMSS_{number}_[inc|out].log
Call metadata filename template
If no telephone number is provided by the network for incoming calls, the number is replaced with the string “unknown”.
Additionally, if the file $HOME/answer.wav exists, and is a valid wav file, it will be played to the remote party when inbound PSTN calls are answered. This can be used, for example, to advise calling parties that the call is being recorded.
Call recordings are dual-channel, which when played as stereo places the local audio on the left channel and the remote audio on the right channel.
As supplied, the patch records 48 Khz, 16 bit audio. This has the advantage of recording the local audio in higher fidelity than it is likely being sent to the remote party. However, remote audio is converted to 48 Khz sampling by simple sample duplication, causing audible artifacts at the local end only, sounding like high frequency scratching during a call and on the recording. These artifacts can be trivially removed from the recording with post-processing.
The recording process is simply terminated when the call is ended, rather than being shut down cleanly. As a result, the wav file contains a header set to the maximum possible duration of recording. This can also trivially be fixed by writing a new header based on the actual length of the file.
You should check applicable regulations regarding the recording of PSTN telephone calls before using this patch.