#! /bin/zsh # # this file: # https://dataswamp.org/~incal/.zsh/audio-test # # don't do this: # # $ pactl load-module module-equalizer-sink # $ pactl load-module module-dbus-protocol # # commands: # # $ /etc/init.d/alsa-utils restart # # $ pulseaudio -D # $ pulseaudio --check # # $ sudo rm -fr ~/.config/pulse /tmp/pulse-* # $ pulseaudio --kill # $ pulseaudio --start audio-online () { aplay -l > /dev/null && pactl list > /dev/null && echo up || echo down } test-audio-a () { local snd=/usr/share/sounds/alsa/Front_Center.wav local out if [ -f $snd ]; then for out in 0..2; do echo "output: $output" sudo amixer -q -c 0 cset numid=3 $out sudo aplay -q $snd done else echo "no file $snd" >&2 fi } test-audio-b () { local bin=/opt/vc/src/hello_pi/hello_audio/hello_audio.bin if [ -x $bin ]; then echo "C-< or ^\ when done" sudo $bin # 3.5 mm jack sudo $bin 1 # HDMI else echo "no bin $bin" >&2 fi } test-audio-list () { echo "$ sudo lspci | grep Audio" sudo lspci | grep Audio echo "$ sudo lsmod | grep snd" sudo lsmod | grep snd echo "$ aplay -l" aplay -l echo "$ pacmd list-sinks" pacmd list-sinks echo "$ acmd list-sinks" pacmd list-sinks } test-audio () { sudo modprobe snd_bcm2835 audio-online test-audio-a test-audio-b test-audio-list }