Hi everyone,
I would like to introduce you to my little achievement that was sparkled by a Christmas gift of Pimoroni Pirate Radio - a cool DIY music player project based on RPi Zero W and PhatBeat DAC.
You can find my new project details there: Pimoroni Pirate Radio Project Enhanced, together with my short reviews of some of music-oriented OSes and software for this combination.
To the point. I’ve managed to successfully replace ALSA with PulseAudio in Volumio2!
As some of you may know, Volumio is tighly coupled with ALSA, and the trouble in my case is, PhatBeat DAC does not really work well with ALSA. While sound quality is ok, the volume is about 20% of what the hardware is capable of, and any attempt to amplify the volume failed. Therefore, I decided to try to modify the PhatBeat library installer so that it performs the complete installation on Volumio2.
In short, instead of running the proposed command that automatically executes the installer after download, just download the script from get.pimoroni.com/phatbeat and edit it before execution, changes are:
- replace OS_NAME=“Volumio” with OS_NAME=“Raspbian” to fool the script (line 232)
- comment out raspbian_check function execution (line 571)
- replace line curl -sS $GETPOOL/pulseaudio | bash -s - “-y” with bash ./pulseaudio.sh -y (line 1109), download get.pimoroni.com/pulseaudio script and name it pulseaudio.sh, place it next to phatbeat installer script, and make similiar changes:
[list=a]
[*] replace raspbianonly=“yes” with raspbianonly=“no” (line 43) - replace OS_NAME=“Volumio” with OS_NAME=“Raspbian” to fool the script (line 232)
- comment out raspbian_check function execution (line 571)
[/*:m][/list:o]
That should do it, now give exec rights to both files (chmod +x phatbeat.sh pulseaudio.sh) and run phatbeat.sh. During installation, you may skip download of documentation and examples, and I’ve agreed to install Python 3, however not sure if it’s required.
After installation, go to /etc/mpd.conf and in audio_output node comment out the line device “hw:0,0” (#-style comments), then save it.
Now, restart Volumio, and after bootup (the startup sound might be gone), go to the UI, then “Playback Options”, and choose “Hifiberry DAC” as your Output Device. That’s all. Do not tick “I2S DAC”, do not change anything else (unless you are up for trouble)
Done! Time to play some music
Now, to the current limitations (I’m working on them):
- you cannot change volume from the UI. To change volume, you need to use terminal command pactl set-sink-volume 0 100% (replace 100% with your desired value, you may set values >100%, I found 150-180% to be the maximum for the hardware). I’m currently working on a Volumio plugin to fix that issue, stay tuned.
- volume of the sound depends on the source type. Not sure if it’s PulseAudio fault, but you may enable volume normalization in [i]/etc/mpd.conf[i] - just replace line volume_normalization “no” with volume_normalization “yes” (line 79). It works quite OK, however sometimes I notice the volume get’s a little up or down, even in the middle of a song… Weird, but not solved yet.
- startup sound is gone - it’s not important for me now, but I will look into it soon
When I make things steady, I may do a pull request to PhatBeat repo to make the installer work for Volumio by default
That’s all I wanted to share. Let me know if case of any questions or problems!
Cheers!