Skip to content

Commit

Permalink
Add dump_coeff.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebeaton committed Mar 6, 2022
1 parent ee5785c commit 02983de
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ AppleALC Changelog
==================
#### v1.7.0
- Fix headphones after sleep on Latitude 7390 2-in-1 (ALC225 layout 30)
- Added `dump_coeff.sh` script in `Tools` to dump processing caps under macOS, plus docs in Wiki

#### v1.6.9
- Added 0x100003 revision for ALCS1220A
Expand Down
30 changes: 30 additions & 0 deletions Tools/dump_coeff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# dump_coeff.sh - Dump processing caps for node in macOS using alc-verb.
#
# Copyright (c) 2022, Michael Beaton. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-3-Clause
#

if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ ! -z "$4" ]
then
echo "Usage: dump_coeff {device-index} {node-id} {count}"
exit 0
fi

if ! command -v alc-verb &> /dev/null
then
echo "alc-verb is not installed in path"
exit -1
fi

echo "Node $2"
echo " Processing caps: ncoeff=$(($3))"

for (( i = 0; i < $(($3)); i++ ))
do
alc-verb -d $1 $2 SET_COEF_INDEX $i 2>/dev/null >/dev/null
coeff=$(alc-verb -d $1 $2 GET_COEF_INDEX 0 2>/dev/null | tail -n 1)
value=$(alc-verb -d $1 $2 GET_PROC_COEF 0 2>/dev/null | tail -n 1)
printf " Coeff 0x%02x: 0x%04x\n" $coeff $value
done

0 comments on commit 02983de

Please sign in to comment.