ラズパイ、持ってますか?持ってますよね(強制)
安価で常時稼働可能なサーバーという神器、使わなければ損というもの。
次にセットアップするときに備えて、またラズパイ同士のために備忘録を残します。
はじめに
この記事は2月12日に現状に合わせて加筆されました。
MPD(Bullseye,Amulech DACの場合)
ミュージックサーバーです。10万円足らずでハイエンドの音が出ます。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| sudo nano /boot/config.txt
# #dtparam=audio=on
# dtoverlay=i-sabre-q2m
sudo reboot
# 略
sudo nano /etc/mpd.conf
# bind_to_address "any"
#
#audio_output {
# type "alsa"
# name "AmulechDac"
# device "hw:DAC,0"
# mixer_type "disabled"
# format "352800:32:2"
# dsd_usb "yes"
# samplerate_converter "soxr very high"
#}
## 一番最後に
# audio_buffer_size "256"
# buffer_before_play "100%"
sudo systemctl restart mpd
|
略部分はリンク先様を見ればわかると思います(手抜き)format等はアップサンプリング設定です。
Samba
1
2
3
4
5
6
7
8
9
10
| # 各種設定
sudo nano /etc/samba/smb.conf
# [Data]
# comment = Data file space
# path = /home/furamon/Data
# public = yes
# read only = no
# browsable = yes
# force user = furamon
|
smb.confが人によってバラバラ過ぎるのですが、私はとりあえずこれでうまいこと行きました。
追加したいなら調べれば出てきます(丸投げ)
shairport-sync
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| sudo apt-get update
sudo apt-get -y install libshairport2 autoconf libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev
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
sudo make install
sudo systemctl enable shairport-sync
sudo systemctl start shairport-sync
sudo nano /usr/local/etc/shairport-sync.conf
# general =
#{
#interpolation = "soxr";
#output_backend = "alsa";
#ignore_volume_control = "yes";
}
#sessioncontrol =
#{
#allow_session_interruption = "yes";
#}
#alsa =
#{
#output_device = "hw:DAC,0"
#output_format = "S32";
#output_rate = 176400;
#period_size = 16384;
#buffer_size = 65536;
#}
sudo ufw allow 5000
sudo ufw allow 6001:6011/udp
|
Bluetoothレシーバー化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
| sudo apt -y install pulseaudio pulseaudio-utils alsa-base alsa-utils bluetooth bluez pulseaudio-module-bluetooth
[Service]
Type=dbus
BusName=org.bluez
ExecStart=/usr/lib/bluetooth/bluetoothd
NotifyAccess=main
#WatchdogSec=10
Restart=on-failure
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
LimitNPROC=1
ProtectHome=true
ProtectSystem=full
[Install]
WantedBy=bluetooth.target
Alias=dbus-org.bluez.servicec
sudo nano /etc/pulse/system.pa
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
sudo nano /etc/pulse/default.pa
load-module module-udev-detect tsched=0 ignore_dB=1
sudo nano /etc/pulse/daemon.conf
default-sample-format = s32le
default-sample-rate = 176400
pulseaudio -D
sudo nano /etc/bluetooth/main.conf
[General]
#Enable=Source,Sink,Headset,Gateway,Media,Control,Socket
Enable=Sink
$ bluetoothctl
$ power on
$ agent NoInputNoOutput
$ default-agent
$ discoverable on
$ trust xx:xx:xx:xx:xx:xx
|
死闘の結果「pulseaudio-module-bluetoothが入っていてPulseAudioが起動していればいい」と分かったのでこれでいけるはずです。
だめならぷちのいずさんの参考記事を読めばたぶん行けます。それでもだめならご一報を。
minidlna
ここのコピペで行けます(解説放棄)
Node-Red
Pythonやシェルスクリプト組んでAlexa Home Bridgeに叩かせればなんでもできます。最高。
PiVPN
ルーターの機種やらなんやら人によりすぎるので割愛いたします。ポートさえ開けば行けますがipv6が絡むと難しいかもしれません。
ですがやる方法はあるのでがんばってください(放棄)