changeset 164:9336a48746d9

audio-tones: experimental tools and findings
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 13 Nov 2021 04:49:06 +0000
parents 5f9dd4056420
children 7a4e8d23ab3a
files audio-tones/README audio-tones/busy audio-tones/cw audio-tones/dtmf audio-tones/keybeep audio-tones/ringing audio-tones/tstop
diffstat 7 files changed, 85 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio-tones/README	Sat Nov 13 04:49:06 2021 +0000
@@ -0,0 +1,25 @@
+As of 2021-11, we are still far away from being able to clean up the
+implementation of audio tones in our handset UI fw: before we can clean up the
+implementation of audio tones, we will first need to detangle the wrong-minded
+coupling between these audio tones and the buzzer, and that detangling will
+require a development platform with a working buzzer, which means FC Venus.
+
+However, we can apply a band-aid fix to the current misdesigned Condat audio
+driver that would allow keybeep tones to be re-enabled on FC Luna with FC-HDS4
+without being brutal on the developer-operator's ears: we can change the dBfs
+amplitudes baked into F_xxx defined constants, and we can conditionalize this
+change on CONFIG_TARGET_LUNA.  With this method we are constrained to picking
+just one amplitude for the 3 different tones based on F_425 (busy, CW and
+ringing) and likewise the same amplitude between the half-tone of keybeep and
+the low tone of DTMF - but we are not seeking fully optimal tuning here, only a
+band-aid fix to protect the developer-operator's hearing.
+
+The set of shell scripts contained in this directory was put together to
+facilitate easier experimentation with different amplitudes, easier than
+entering full AT@TONE commands manually.
+
+Amplitude selections being made for now:
+
+Keybeep-half and DTMF-low: -26 dBfs
+DTMF-high: -24 dBfs
+F_425 tones: -21 dBfs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio-tones/busy	Sat Nov 13 04:49:06 2021 +0000
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# play a busy tone, amplitude set on the command line
+
+if [ $# != 1 ]
+then
+	echo "usage: $0 ampl" 1>&2
+	exit 1
+fi
+
+exec fc-shell "at@tone=0,500,425,$1,0,500,0,0,0,500,0,0,500,500,1000,4"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio-tones/cw	Sat Nov 13 04:49:06 2021 +0000
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# play a calling waiting tone, amplitude set on the command line
+
+if [ $# != 1 ]
+then
+	echo "usage: $0 ampl" 1>&2
+	exit 1
+fi
+
+exec fc-shell "at@tone=0,200,425,$1,800,1000,425,$1,0,200,0,0,1000,1000,4000,65535"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio-tones/dtmf	Sat Nov 13 04:49:06 2021 +0000
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# generate a DTMF '#' keybeep, low and high ampl set on the command line
+
+if [ $# != 2 ]
+then
+	echo "usage: $0 low-ampl high-ampl" 1>&2
+	exit 1
+fi
+
+exec fc-shell "at@tone=0,100,941,$1,0,100,1477,$2,0,100,0,0,100,100,100,1"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio-tones/keybeep	Sat Nov 13 04:49:06 2021 +0000
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# generate a plain keybeep, amplitude set on the command line
+
+if [ $# != 1 ]
+then
+	echo "usage: $0 ampl" 1>&2
+	exit 1
+fi
+
+exec fc-shell "at@tone=0,120,697,$1,0,120,697,$1,0,120,0,0,120,120,120,1"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio-tones/ringing	Sat Nov 13 04:49:06 2021 +0000
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# play a ringing tone, amplitude set on the command line
+
+if [ $# != 1 ]
+then
+	echo "usage: $0 ampl" 1>&2
+	exit 1
+fi
+
+exec fc-shell "at@tone=0,1000,425,$1,0,1000,0,0,0,1000,0,0,1000,1000,5000,65535"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio-tones/tstop	Sat Nov 13 04:49:06 2021 +0000
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# stop previously started tone
+
+exec fc-shell at@tstop