HifiBerry Amp2

Headless RPi install

https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0
https://www.raspberrypi.org/documentation/installation/installing-images/README.md
https://etcher.io/

https://www.raspberrypi.org/forums/viewtopic.php?t=97314

Select “Advanced Options” from the menu, then either “SPI” or “I2C”, and enable the interfaces there. If you want the driver modules to load automatically (and you probably do) then answer “Yes” to the follow-up question. raspi-config can also be used to disable and re-enable Device Tree.

distributing audio:
https://github.com/badaix/snapcast

https://github.com/pimusicbox/pimusicbox/tree/master

https://docs.mopidy.com/en/latest/installation/debian/#debian-install

ALSA
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=143528

Set default output:

https://superuser.com/questions/626606/how-to-make-alsa-pick-a-preferred-sound-device-automatically

> cat /proc/asound/cards
0 [ALSA ]: bcm2835 – bcm2835 ALSA
bcm2835 ALSA
1 [sndrpihifiberry]: HifiberryDacp – snd_rpi_hifiberry_dacplus
snd_rpi_hifiberry_dacplus

$ cat /proc/asound/modules
0 snd_bcm2835
1 snd_soc_hifiberry_dacplus

$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
hifiberry
dmixer
default
sysdefault:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
dmix:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct sample mixing device
dmix:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct sample snooping device
hw:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Hardware device with all software conversions
sysdefault:CARD=sndrpihifiberry
snd_rpi_hifiberry_dacplus,
Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dacplus,
Direct sample mixing device
dsnoop:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dacplus,
Direct sample snooping device
hw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dacplus,
Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dacplus,
Hardware device with all software conversions

$ amixer
Simple mixer control ‘DSP Program’,0
Capabilities: enum
Items: ‘FIR interpolation with de-emphasis’ ‘Low latency IIR with de-emphasis’ ‘High attenuation with de-emphasis’ ‘Fixed process flow’ ‘Ringing-less low latency FIR’
Item0: ‘Low latency IIR with de-emphasis’
Simple mixer control ‘Analogue’,0
Capabilities: pvolume
Playback channels: Front Left – Front Right
Limits: Playback 0 – 1
Mono:
Front Left: Playback 1 [100%] [0.00dB]
Front Right: Playback 1 [100%] [0.00dB]
Simple mixer control ‘Analogue Playback Boost’,0
Capabilities: volume
Playback channels: Front Left – Front Right
Capture channels: Front Left – Front Right
Limits: 0 – 1
Front Left: 1 [100%] [0.80dB]
Front Right: 1 [100%] [0.80dB]
Simple mixer control ‘Auto Mute’,0
Capabilities: pswitch
Playback channels: Front Left – Front Right
Mono:
Front Left: Playback [on]
Front Right: Playback [on]
Simple mixer control ‘Auto Mute Mono’,0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control ‘Auto Mute Time Left’,0
Capabilities: enum
Items: ’21ms’ ‘106ms’ ‘213ms’ ‘533ms’ ‘1.07s’ ‘2.13s’ ‘5.33s’ ‘10.66s’
Item0: ’21ms’
Simple mixer control ‘Auto Mute Time Right’,0
Capabilities: enum
Items: ’21ms’ ‘106ms’ ‘213ms’ ‘533ms’ ‘1.07s’ ‘2.13s’ ‘5.33s’ ‘10.66s’
Item0: ’21ms’
Simple mixer control ‘Clock Missing Period’,0
Capabilities: enum
Items: ‘1s’ ‘2s’ ‘3s’ ‘4s’ ‘5s’ ‘6s’ ‘7s’ ‘8s’
Item0: ‘1s’
Simple mixer control ‘Deemphasis’,0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control ‘Digital’,0
Capabilities: pvolume pswitch
Playback channels: Front Left – Front Right
Limits: Playback 0 – 207
Mono:
Front Left: Playback 124 [60%] [-41.50dB] [on]
Front Right: Playback 124 [60%] [-41.50dB] [on]
Simple mixer control ‘Max Overclock DAC’,0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 – 40
Mono: 0 [0%]
Simple mixer control ‘Max Overclock DSP’,0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 – 40
Mono: 0 [0%]
Simple mixer control ‘Max Overclock PLL’,0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 – 20
Mono: 0 [0%]
Simple mixer control ‘Volume Ramp Down Emergency Rate’,0
Capabilities: enum
Items: ‘1 sample/update’ ‘2 samples/update’ ‘4 samples/update’ ‘Immediate’
Item0: ‘1 sample/update’
Simple mixer control ‘Volume Ramp Down Emergency Step’,0
Capabilities: enum
Items: ‘4dB/step’ ‘2dB/step’ ‘1dB/step’ ‘0.5dB/step’
Item0: ‘4dB/step’
Simple mixer control ‘Volume Ramp Down Rate’,0
Capabilities: enum
Items: ‘1 sample/update’ ‘2 samples/update’ ‘4 samples/update’ ‘Immediate’
Item0: ‘1 sample/update’
Simple mixer control ‘Volume Ramp Down Step’,0
Capabilities: enum
Items: ‘4dB/step’ ‘2dB/step’ ‘1dB/step’ ‘0.5dB/step’
Item0: ‘1dB/step’
Simple mixer control ‘Volume Ramp Up Rate’,0
Capabilities: enum
Items: ‘1 sample/update’ ‘2 samples/update’ ‘4 samples/update’ ‘Immediate’
Item0: ‘1 sample/update’
Simple mixer control ‘Volume Ramp Up Step’,0
Capabilities: enum
Items: ‘4dB/step’ ‘2dB/step’ ‘1dB/step’ ‘0.5dB/step’
Item0: ‘1dB/step’

$ amixer sget Digital
Simple mixer control ‘Digital’,0
Capabilities: pvolume pswitch
Playback channels: Front Left – Front Right
Limits: Playback 0 – 207
Mono:
Front Left: Playback 124 [60%] [-41.50dB] [on]
Front Right: Playback 124 [60%] [-41.50dB] [on]

alsamixer

> aplay -l | awk -F \: ‘/,/{print $2}’ | awk ‘{print $1}’ | uniq
ALSA
sndrpihifiberry

> cat /proc/asound/modules
0 snd_bcm2835
1 snd_soc_hifiberry_dacplus

https://support.hifiberry.com/hc/en-us/community/posts/206509299-Raspbian-Amp-no-sounds

We often see people having problem with speaker-test. I recommend sox.
sudo apt-get install sox
play -n synth sine 1000

Using Raspbian no Master and Channels, but Digital:
> amixer get Digital
> amixer sset Digital 40%

Use ALSA dmix works out of the box for stretch so no pulseaudio
https://raspberrypi.stackexchange.com/questions/639/how-to-get-pulseaudio-running

mpg123 4234.mp3 &

aplay -vv somefile.wav
mp123

speaker-test -c 2

https://www.hifiberry.com/build/documentation/guide-adding-equalization-using-alsaeq/

Mopidy

https://docs.mopidy.com/en/latest/installation/debian/#debian-install

https://docs.mopidy.com/en/latest/service/#service-management-on-debian

https://discourse.mopidy.com/t/cant-setup-web-extension/548/2
sudo apt-get install python-pip

https://docs.mopidy.com/en/latest/service/

https://raspberrypi.stackexchange.com/questions/27973/how-to-reach-my-mopidy-server-without-port

https://rasspberrypi.wordpress.com/2012/09/04/mounting-and-automounting-windows-shares-on-raspberry-pi/

https://www.mopidy.com/authenticate/#spotify

https://github.com/lfcabend/mopidy-spotify-web
pip install Mopidy-Spotify-Web

RTL-SDR

http://osmocom.org/projects/sdr/wiki/rtl-sdr
https://learn.adafruit.com/freq-show-raspberry-pi-rtl-sdr-scanner/installation
https://pa3ang.nl/archives/3405

jamesmead@floehopper.local:~$ sudo dd bs=1m if=/Users/jamesmead/Downloads/2015-02-16-raspbian-wheezy.img of=/dev/disk2
pi@raspberrypi ~ $ sudo raspi-config
# Choose option 1 to "Expand Filesystem" - Ensures that all of the SD card storage is available to the OS
# Choose Finish & reboot

pi@raspberrypi ~ $ sudo apt-get update
pi@raspberrypi ~ $ sudo apt-get upgrade
pi@raspberrypi ~ $ cat <<EOF >no-rtl.conf
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
EOF
pi@raspberrypi ~ $ sudo mv no-rtl.conf /etc/modprobe.d/

pi@raspberrypi ~ $ sudo apt-get install git-core
pi@raspberrypi ~ $ sudo apt-get install git
pi@raspberrypi ~ $ sudo apt-get install cmake
pi@raspberrypi ~ $ sudo apt-get install libusb-1.0-0-dev
pi@raspberrypi ~ $ sudo apt-get install build-essential

pi@raspberrypi ~ $ git clone https://gitea.osmocom.org/sdr/rtl-sdr.git
pi@raspberrypi ~ $ cd rtl-sdr/
pi@raspberrypi ~/rtl-sdr $ mkdir build
pi@raspberrypi ~/rtl-sdr $ cd build
pi@raspberrypi ~/rtl-sdr/build $ cmake ../ -DINSTALL_UDEV_RULES=ON
pi@raspberrypi ~/rtl-sdr/build $ make
pi@raspberrypi ~/rtl-sdr/build $ sudo make install
pi@raspberrypi ~/rtl-sdr/build $ sudo ldconfig
pi@raspberrypi ~/rtl-sdr/build $ cd ~
pi@raspberrypi ~ $ sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
pi@raspberrypi ~ $ sudo reboot

pi@raspberrypi ~ $ rtl_test
Found 1 device(s):
  0:  Generic, RTL2832U, SN: 77771111153705700

Using device 0: Generic RTL2832U
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.

Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.

Reading samples in async mode...

pi@raspberrypi ~ $ sudo apt-get install libasound-dev
pi@raspberrypi ~ $ sudo apt-get install libpulse-dev

pi@raspberrypi ~ $ wget  http://www.aishub.net/downloads/aisdecoder-1.0.0.tar.gz
pi@raspberrypi ~ $ tar zxvf aisdecoder-1.0.0.tar.gz
pi@raspberrypi ~ $ cd aisdecoder-1.0.0/
pi@raspberrypi ~/aisdecoder-1.0.0 $ mkdir build
pi@raspberrypi ~/aisdecoder-1.0.0 $ cd build/
pi@raspberrypi ~/aisdecoder-1.0.0/build $ cmake ../ -DCMAKE_BUILD_TYPE=Release
pi@raspberrypi ~/aisdecoder-1.0.0/build $ make
pi@raspberrypi ~/aisdecoder-1.0.0/build $ sudo cp aisdecoder /usr/local/bin
pi@raspberrypi ~/aisdecoder-1.0.0/build $ cd ~
pi@raspberrypi ~ $

view raw

install.md

hosted with ❤ by GitHub

rtl_fm -f 96.5M -M fm -s 170k -A fast -r 32k -l 0 -E deemp -g 1000 | play -r 32k -t raw -e s -b 16 -c 1 -V1 –

rtl_fm -M wbfm -f 96.5M | play -r 32k -t raw -e s -b 16 -c 1 -V1 –

rtl_fm -f 96.5M -M fm -s 170k -A fast -r 44100 -l 0 -E deemp -g 1000 | play -r 44100 -t raw -e s -b 16 -c 1 -V1 –

Click to access cqqso201607_rtlsdrrpi_on7cfi_0.pdf

https://raspberrytips.nl/fm-radio-dvb-t-usb-stick/

Leave a comment