Open21

raspi zeroのセットアップ〜スピーカー利用までのメモなど

n0bisuken0bisuke
sudo apt install git autoconf libdaemon-dev libpopt-dev libconfig-dev libasound2-dev libpulse-dev libavahi-client-dev libssl-dev libsoxr-dev
n0bisuken0bisuke
git clone https://github.com/waveshare/WM8960-Audio-HAT
cd WM8960-Audio-HAT
sudo ./install.sh 

ためす

n0bisuken0bisuke
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: wm8960soundcard [wm8960-soundcard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

おぉ!きた。読み込まれたっぽい!

n0bisuken0bisuke

音を鳴らすサンプル。 元々wavファイルが入ってるのはありがたい。

aplay  /usr/share/sounds/alsa/Front_Right.wav
n0bisuken0bisuke

ラズパイ上で

$ npm i
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'nodetunes@0.1.2',
npm WARN EBADENGINE   required: { node: '0.10.x' },
npm WARN EBADENGINE   current: { node: 'v17.1.0', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN deprecated coffee-script@1.3.3: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated react-tools@0.13.3: react-tools is deprecated. For more information, visit https://fb.me/react-tools-deprecated
npm notice
npm notice New patch version of npm available! 8.1.2 -> 8.1.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.1.3
npm notice Run npm install -g npm@8.1.3 to update!
npm notice
npm ERR! code 1

0.10.x系って前すぎて...

$ nodebrew install-binary 0.10.48
v0.10.48 is not found

Can not fetch: https://nodejs.org/dist/v0.10.48/node-v0.10.48-linux-armv7l.tar.gz
n0bisuken0bisuke
$ git clone https://github.com/FD-/RPiPlay.git
$ cd RPiPlay

依存ライブラリをいれる。

$ sudo apt install cmake -y 

なぜかcmakeと分け無いとエラーだった。

$ sudo apt install libavahi-compat-libdnssd-dev libplist-dev libssl-dev -y 

ビルド

$ mkdir build && cd build
$ cmake ..
$ make -j
$ ./rpiplay -h