RaspberryPi ZERO-W にAirPlayをインストール

このマシンにはすでに、VLC/Radikoの環境が構築されており、インターネットラジオとして稼働中。

さらにiPhoneの音楽をこのスピーカーで鳴らすのが目的。

 

installしたversionは以下

$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

reference
  https://qiita.com/yuyakato/items/600f499cf0610bfc1a16

## リファレンスを参考にinstall.shを作成して実行
$ ~/AirPlay-temp/install.sh
===install.sh

# library update & get
sudo apt-get update
sudo apt-get install libshairport2 autoconf libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev

# ソースコードをクローンし、ビルドする
cd ~/AirPlay-temp
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
autoreconf -i -f
./configure --with-alsa --with-avahi --with-ssl=openssl --with-metadata --with-soxr --with-systemd
make
./shairport-sync --version

# デーモンを動かすためのユーザ、グループを作成する
sudo groupadd -r shairport-sync
sudo useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync

# インストールする
sudo make install

===ここまで


## status checkは以下
$ systemctl status shairport-sync

## confは/usr/local/etc に作成

### reference に従ってshairport-sync.confを作成

## 起動
$ sudo systemctl start shairport-sync

iPhone のミュージックから"XXX"が見える
iPhone上で再生すれば、スピーカーから音がなる
再生中に他のアプリを起動しようとするとbusyになる
他のアプリ起動中にiPhoneから再生しようとするとはじかれる。

 

 

2024年7月4日にリリースされたRaspberry Pi OSのインストールメモ

最新のbookwormのみならず、Bulleseyeもインストールでトラブったので、健忘録。

 

現象

1.Desktopバージョンをインストール中に突然ハングアップ。ハングアップする箇所は安定せず。

  Networkconfig であったり、cupsであったり、あるいは以下のメッセージが出たり。

 8<--- cut here ---

Unable to handle kernel paging request

...

2.w/o desktopバージョン(LITE)をインスール中に、以下のメッセージ発生

error: oops - undefine instruction

 

対策

以下が参考になりました。

どうも、CPUの周波数or/and電圧の設定の問題のようです。

以下をboot/config.txtに追記してrebootしたら、boot-upで問題発生しないようになりました。

over_voltage=4
arm_freq=1000

 

 

設定の確認は以下

 $ vcgencmd measure_volts
volt=1.4000V

 

 

 

 

RaspberryPI ZeroのBluetooth接続でPairingできなくなった。

以下を参考に対応。

 

 

 

現象

  Bluetoothctlを使ってPairingしようとすると、Failedでconnectがnoになる。

  $ sudo systemctl status bluetooth.service でチェックすると、

  上記と同じエラーが出ている。

  上記に従い

# バックアップ
 $ mv /lib/systemd/system/bluetooth.service /lib/systemd/system/bluetooth.service.org
# 設定値作成
 $ sudo su -
 $ mkdir -p /root/services/bluetooth
 $ cp /lib/systemd/system/bluetooth.service.org /root/services/bluetooth/bluetooth.service
  viで/root/services/bluetooth/bluetooth.serviceを修正
修正前:ExecStart=/usr/libexec/bluetooth/bluetoothd
修正後:ExecStart=/usr/libexec/bluetooth/bluetoothd --noplugin=sap
 $ chmod -R 600 /root/services
# シンボリックリンク作成
 $ ln -s /root/services/bluetooth/bluetooth.service /lib/systemd/system/bluetooth.service
# 再起動
 $ systemctl daemon-reload
 $ systemctl restart bluetooth.service
 $ systemctl status bluetooth.service
上記のとおり、以下のエラーだけになる。
Failed to set privacy: Rejected (0x0b)
引き続き、以下を実行(rootで行う)
$ mkdir -p  /root/configs/bluetooth/bthelper@.service.d
viで/root/configs/bluetooth/bthelper@.service.d/override.conf を作成
[Unit]
After=hciuart.service bluetooth.service
Before=
 
[Service]
ExecStartPre=/bin/sleep 5
 $ chmod -R 600 /root/configs
 $ mkdir /etc/systemd/system/bthelper@.service.d/
 $ ln -s /root/configs/bluetooth/bthelper@.service.d/override.conf /etc/systemd/system/bthelper@.service.d/override.conf 
 $ reboot now
これにより、RN41は接続できるようになった。
でも、格安BT SlaveのHC-06は接続できず。こちらはさらに深い闇があった。