MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.88k stars 497 forks source link

DietPi-JustBoom | Add support for DSP filters #643

Closed Fourdee closed 7 years ago

Fourdee commented 7 years ago

For devices that use the pcm51xx chipset:

Fourdee commented 7 years ago

Detection:

if (( $( amixer -c 0 scontrols | grep -ci -m1 'DSP Program') ))

Or can we pull from /sys/....alsa?

Get list of available filters:

amixer -c0 sget 'DSP Program' | grep 'Items:'

Get current filter:

amixer -c0 sget 'DSP Program' | grep 'Item0:'
Fourdee commented 7 years ago

...

root@DietPi:~# echo -e "$DSP_FILTER_CONTROL_NAME"
'DSP Program'
root@DietPi:~# echo -e "$DSP_FILTER_TARGET"
'Low latency IIR with de-emphasis'
root@DietPi:~# amixer -c$SOUNDCARD_CARD_INDEX sset "$DSP_FILTER_CONTROL_NAME" "$DSP_FILTER_TARGET"
amixer: Invalid command!

get numid of dsp program:

amixer -c $SOUNDCARD_CARD_INDEX  cget name="$DSP_FILTER_CONTROL_NAME" | grep 'numid=' | sed 's/[^0-9]//g'

List available filters and indexs

amixer -c $SOUNDCARD_CARD_INDEX  cget numid=6 | grep 'Item #' | sed 's/.*#//g'
Fourdee commented 7 years ago

image

image

Fourdee commented 7 years ago

Completed