wm8960-soundcard 702 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. set -x
  3. exec 1>/var/log/$(basename $0).log 2>&1
  4. #enable i2c interface
  5. dtparam i2c_arm=on
  6. modprobe i2c-dev
  7. sleep 1
  8. is_1a=$(i2cdetect -y 1 0x1a 0x1a | egrep "(1a|UU)" | awk '{print $2}')
  9. if [ "x${is_1a}" != "x" ] ; then
  10. echo "install wm8960-soundcard"
  11. dtoverlay wm8960-soundcard
  12. sleep 1
  13. rm /etc/asound.conf
  14. rm /var/lib/alsa/asound.state
  15. echo "create wm8960-soundcard configure file"
  16. ln -s /etc/wm8960-soundcard/asound.conf /etc/asound.conf
  17. echo "create wm8960-soundcard status file"
  18. ln -s /etc/wm8960-soundcard/wm8960_asound.state /var/lib/alsa/asound.state
  19. fi
  20. alsactl restore
  21. #Fore 3.5mm ('headphone') jack
  22. amixer cset numid=3 1