How to setup a Pi3b to be a NAA using Buster Lite as the OS
download last Buster lite version zip file from:
https://www.raspberrypi.org/downloads/raspbian/
http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-04-09/
Unzip file
write to sd card with Etcher
Copy 0 length (empty) file named "ssh" (not ssh.txt) to /boot to enable SSH
Install micro sd card in pi and power on with ethernet connected.
Find ip address (I find from my router) and make ssh terminal connection
sudo raspi-configselect Change User Password and change password
Finish to exit
1) Install latest OS updates
sudo apt-get updatesudo apt-get -y dist-upgrade2) Install necessary dependencies (alsa-utils is optional, but the utilities are helpful sometimes). I'm not sure you need to do this, seems like they were already there
sudo apt-get install libasound2 alsa-utils3) Download the latest networkaudiod deb package for armhf architecture using “wget”. You should go to https://www.signalyst.eu/bins/naa/linux/stretch/
and see if there is a new version. As of Oct 20,2019, this is latest.
4) Install the package (correct the version number to what ever is latest at the time)
sudo dpkg -i networkaudiod_3.6.0-42_armhf.debTab, then OK to install
reboot
sudo rebootTo check if NAA software is running:
sudo systemctl status networkaudiodControl and c and same time to exit
If you have a problem, you get something like this:
networkaudiod.service: Failed with result 'signal'
Otherwise, something like this if working:
Oct 05 14:54:42 raspberrypi systemd[1]: Started Network Audio Adapter daemon.
Oct 05 14:54:43 raspberrypi networkaudiod[493]: [/usr/sbin/networkaudiod] (493): networkaudiod Copyright (C) 2011-2019 Jussi Laako / Signalyst. All rights reserved
Oct 05 14:54:43 raspberrypi networkaudiod[493]: [/usr/sbin/networkaudiod] (493): asoundlib version: 1.1.8
Oct 05 14:54:43 raspberrypi networkaudiod[493]: [/usr/sbin/networkaudiod] (493): clSocket::SetOption(): setsockopt(): No such device
Oct 05 14:54:44 raspberrypi networkaudiod[493]: [/usr/sbin/networkaudiod] (493): clSocket::SetOption(): setsockopt(): No such device
Oct 05 14:54:45 raspberrypi networkaudiod[493]: [/usr/sbin/networkaudiod] (493): clSocket::SetOption(): setsockopt(): No such device
Oct 05 14:54:46 raspberrypi networkaudiod[493]: [/usr/sbin/networkaudiod] (493): clSocket::SetOption(): setsockopt(): No such device
Turn on dac, config for Hifiberry Dacplus (add dtoverlay=hifiberry-dacplus to /boot/config.txt)
sudo nano /boot/config.txtAdd line
dtoverlay=hifiberry-dacplusAdd # in front of dtparam=audio=on. This turns off pi internal audio.
#dtparam=audio=onExit and save, then reboot
sudo rebootAfter it comes back, check for audio device
aplay -l**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
For some of the changes, reference https://www.runeaudio.com/forum/tweaking-the-audio-performance-rpi3-t4301.html
sudo nano /boot/config.txtReference page for config.txt https://elinux.org/RPiconfig
add lines to config.txt to disable wifi, bluetooth
# Disable wifidtoverlay=pi3-disable-wifi# Disable bluetoothdtoverlay=pi3-disable-btAdd lines below to config.txt to underclock and undervolt
disable pvt (temperature measurements) and avoid PWM_PLL
reference https://github.com/raspberrypi/firmware/issues/497
# underclock and undervolt settingsforce_turbo=1arm_freq=800#arm_freq_min=400# arm freq 400 and other 3 at 200 are ok with dietpi#gpu_freq=200#core_freq=200#sdram_freq=200# over voltage -3 is ok#over_voltage=-3#over_voltage_min=-5#over_voltage_sdram=-3#following four lines ok#sdram_schmoo=0x02000020#over_voltage_sdram_p=-5#over_voltage_sdram_i=-14#over_voltage_sdram_c=-6# Force max current to USB 0=OFF (600mA) 1=ON (1.2A)max_usb_current=0gpu_mem=16disable_l2cache=0disable_pvt=1force_turbo=1avoid_pwm_pll=1install Linux Audio Adjustments
https://github.com/dynobot/Linux-Audio-Adjustments
wget https://github.com/dynobot/Linux-Audio-Adjustments/raw/master/basic-install.shchmod 755 basic-install.shsudo ./basic-install.shedit rc.local and turn off hdmi, leds, ...
sudo nano /etc/rc.localAdd lines so it looks like this, note that "/usr/bin/Sound.sh" line should be near top.
#call Linux Audio Adjustments script/usr/bin/Sound.sh#turn off HDMIsudo /opt/vc/bin/tvservice -o#Power LED off sudo sh -c 'echo 0 > /sys/class/leds/led1/brightness' sudo sh -c 'echo none > /sys/class/leds/led1/trigger' #Activity LED off sudo sh -c 'echo 0 > /sys/class/leds/led0/brightness'sudo nano /boot/cmdline.txtAdd lines after the long first line:
dwc_otg.microframe_schedule=0dwc_otg.nak_holdoff_enable=1dwc_otg.fiq_fix_enable=0smsc95xx.turbo_mode=Ndwc_otg.lpm_enable=0If wifi, turn off ethernet and usb ports
sudo nano /usr/bin/Sound.shUncomment line:
echo 0x0 > /sys/devices/platform/soc/3f980000.usb/buspowerexit and save
Ethernet version
Install hub-cntl, need to install a couple other programs first
sudo apt-get install libusb-dev git git clone https://github.com/codazoda/hub-ctrl.ccd hub-ctrl.cgcc -o hub-ctrl hub-ctrl.c -lusbCopy hub-ctrl program to /bin so it can be executed
sudo cp hub-ctrl /bin
cd ..turn off all usb port
sudo ./hub-ctrl -h 0 -P 2 -p 0
check
lsusb
Set to Ethernet to 100 mb to save power
sudo nano /etc/network/interfacesauto loiface lo inet loopbackauto eth0allow-hotplug eth0iface eth0 inet dhcp link-speed 100 link-duplex fullCheck which processes are running
ps auxreal time processes
htopDisplay temperature
vcgencmd measure_temp
Removing applications:
apt remove --purge [app]
sudo apt remove --purge avahi-daemonAssign to a core
To find PID for networkaudiod
pgrep networkaudiod422
or pidof networkaudiod
ps auxUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 423 1.8 0.7 19032 7660 ? S<Ls 00:38 18:07 /usr/sbin/networkaudiod
Note PID = 423 this time, changed after reboot
ps aux | grep -i networkaudiodTo isolate a cpu core you have to edit /boot/cmdline.txt:
sudo nano /boot/cmdline.txtadd line
isolcpus=3reboot
htop