wm8960-soundcard 734 B

1234567891011121314151617181920212223242526272829303132
  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. for loop in 1 2 3 4 5
  9. do
  10. is_1a=$(i2cdetect -y 1 0x1a 0x1a | egrep "(1a|UU)" | awk '{print $2}')
  11. if [ "x${is_1a}" != "x" ] ; then
  12. echo "install wm8960-soundcard"
  13. dtoverlay wm8960-soundcard
  14. sleep 1
  15. rm /etc/asound.conf
  16. rm /var/lib/alsa/asound.state
  17. echo "create wm8960-soundcard configure file"
  18. ln -s /etc/wm8960-soundcard/asound.conf /etc/asound.conf
  19. echo "create wm8960-soundcard status file"
  20. ln -s /etc/wm8960-soundcard/wm8960_asound.state /var/lib/alsa/asound.state
  21. break
  22. fi
  23. sleep 3
  24. done
  25. alsactl restore