Ok I’ve been on a roll playing with OP25 and Raspberry Pi and one thing I can tell you is that the onboard audio from the bcm2835 chip is somewhat inadequate. Oh, it works but you’re going to need a powered speaker or really efficient headphones, and even then it is a bit light.
What to do?
Add a USB Digital to Analog converter (DAC). Depicted here is a HiFiMeDIY USB DAC. This is a tad bit expensive for this project but I have like 4 of these things laying around the house. They are ridiculously good. If you like music slap one of these bad boys on your laptop in the hotel room and the quality of your music will improve ten fold.
That’s not what we’re doing here though.
There are a LOT of USB DAC’s out there and some cost just a few dollars. HiFiMeDIY makes some cheaper ones as well that are way more than enough for improving your OP25 sound.
The Phat DAC costs $15 but you’ll have to solder header pins on yourself. That may be the cheapest, and best route. It has the form factor for the Raspberry Pi Zero but it works on all the Pi’s.
First of all, plug the thing in and boot up.
Check to see if it was found by opening a terminal and typing:
It should look like this:
pi@pib3:~ $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 7/7 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: DAC [HiFimeDIY DAC], device 0: USB Audio [USB Audio] Subdevices: 0/1 Subdevice #0: subdevice #0 card 1: DAC [HiFimeDIY DAC], device 1: USB Audio [USB Audio #1] Subdevices: 1/1 Subdevice #0: subdevice #0 pi@pib3:~ $
HiFimeDIY DAC is Card 1, Subdevice 0
So lets go to our command that we use to open OP25 and we are going to tell it what output device to use for sound.
./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.2625e6 -o 25000 -q 1 -O hw:1,0 -T trunk.tsv -V -2 -U 2> stderr-stream0.2
I’ve added the following to tell OP25 to use hardware device 1, subdevice 0 as an output device by adding
Now lets open
The volume will probably be set low on the device. When you open alsamixer it will likely show the bcm2835 audio device.
Hit the Function key + your F6 key and select HiFimeDIY then hit Enter
Now it is open and you can see the volume is low.
Now hold down the Shift Key + the errrr Plus Key (Shift and +) and increase the volume to max.
Now hit the Control Key + C to close.
You are now running OP25 through a Digital to Analog Converter.
As I mentioned above with the Phat DAC……there are various other HAT devices for the Raspberry Pi. I dug out an old HiFiBerry DAC+ board.
All you do with it is go to /boot/config.txt and scroll down then comment out the line that says dtparam=audio=on and add a line that says dtoverlay=hifiberry-dacplus and then reboot. You can remove the hw:1,0 line from the OP25 script as the HiFiBerry is now the default audio device. Or you could change it to hw:0,0 because that will be the mapping of the default audio device in this case.
# Enable audio (loads snd_bcm2835) #dtparam=audio=on gpu_mem=16 #HiFiBerry DAC+ dtoverlay=hifiberry-dacplus
Lastly you can also get a HiFiBerry DAC+ Zero which costs $17. It has 2 RCA’s and you could easily hook it to your stereo or TV audio out.