• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

A Raspberry Pi as a music server

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,755
Likes
3,055
@thefsb What ALSA EQ things have you tried, and in what way were they unsatisfactory?

Volumio has plugins that can do EQ. I'm most familiar with the brutefir one that's out of tree and needs installing via ssh, but the parametric and 'simple' 10 band graphic eq plugins are core ones that should be available via the GUI. All actually work by setting up alsa using plugins or passing through an external program (BruteFIR).

The alsa 'equal' plugin is more versatile than it's usually given credit for - it's actually a generic wrapper for LADSPA plugins, and creates alsa mixer controls to adjust them, unlike the more basic alsa ladspa plugin. If whatever front end you're using doesn't have a mixer gui you can try amixer-webui

MPD can be configured with multiple output devices and lets you switch between them. This example uses that to easily switch between unaltered, crossfeed, eq, and eq + crossfeed alsa configurations.
 

maarten

Member
Joined
Jun 1, 2019
Messages
37
Likes
52
Same setup here except I use the Raspbian version of Debian and I connect to the DAC with USB. Why do you use the JustBoom Digi Zero pHAT between the RPiZ and the DAC?

Have connected my ADI-2 DAC through rpi-zero-w micro USB port but after a while very audible crackling is audible when playing music ! Somehow data signal gets polluted with static electricity. Returned to Justboom Digi Zero s/pdif output.
 
Last edited:

thefsb

Addicted to Fun and Learning
Joined
Nov 2, 2019
Messages
796
Likes
657
@somebodyelse Those are some great resources, thanks.

I think it was libasound2-plugin-equal that I tried. http://wiki.linuxmce.org/index.php/Equalizer_for_ALSA https://scribles.net/enabling-equalizer-on-raspberry-pi-using-alsa-equal-plugin/ All I got was a 10-band graphic. If alsa 'equal' has a way to specify parametric filters using a config file then I'm interested. I don't want to have to connect KVM to the RPiZ.

I'll investigate BruteFIR. If Volumio is just acting as a web admin console with respect to these features then we probably don't need it. (My feeling towards Volumio is that of Bartleby, the Scrivener.) I should probably ask about using a FIR filter for room EQ in a separate thread. I didn't know FIR filtering was favored for room EQ. (Totally OT but I did my undergraduate dissertation on a adaptive FIR 33 years ago.)

How what about an ALSA plugin to route the signals through ffmpeg? It's got filters you could configure on the basis of REW output.

Switching between multiple MPD outputs on the fly might be useful in testing.
 

thefsb

Addicted to Fun and Learning
Joined
Nov 2, 2019
Messages
796
Likes
657
Have connected my ADI-2 DAC through rpi-zero-w micro USB port but after a while very audible crackling is audible when playing music ! Somehow data signal gets polluted with static electricity. Returned to Justboom Digi Zero s/pdif output.

That's curious. But if you have a working config, why fix it?
 

thefsb

Addicted to Fun and Learning
Joined
Nov 2, 2019
Messages
796
Likes
657
@somebodyelseHow what about an ALSA plugin to route the signals through ffmpeg? It's got filters you could configure on the basis of REW output.

Wait, what am I talking about? ffmpeg has ALSA input and output. So it should be a matter of writing a suitable asound.conf and running ffmpeg with suitable options.
 

0bs3rv3r

Active Member
Joined
Oct 24, 2019
Messages
248
Likes
234
I'm using Kodi on Raspbian Buster (on a pi 4) which works but I've noticed that the volume controls work, which is different to when I tried volumio which disables it.

Volumio seems to be having all sorts of problems in this area at the moment (has for a while). I switched to the current version of moOde and it works as it should. The developer is VERY active on the forums and seems to know what he's doing.
 

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,755
Likes
3,055
Have connected my ADI-2 DAC through rpi-zero-w micro USB port but after a while very audible crackling is audible when playing music ! Somehow data signal gets polluted with static electricity. Returned to Justboom Digi Zero s/pdif output.
The description matches a known issue that's probably related to the USB-OTG port used on the Pi models below the Pi 4. The simple answer is stick to your spdif output.

Edit: To be clear, I don't mean that the Pi's USB (<pi4) will always be a problem - for many it's fine, including me with PiCorePlayer. The fundamental problem is that under certain conditions the usb packets are delivered to the DAC slightly too late. The problem is that 'certain conditions' isn't well defined. Among the things that make it more likely/worse are heavy USB traffic, increasing sample rate / bit depth, and certain programs running, including BruteFIR (unless you restrict it to a single cpu core) and, I believe, the database engine used by Volumio among others.
 
Last edited:

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,755
Likes
3,055
Wait, what am I talking about? ffmpeg has ALSA input and output. So it should be a matter of writing a suitable asound.conf and running ffmpeg with suitable options.
I'd expect so, similar to the way brutefir gets used. modprobe snd-aloop to create a virtual sound device. ffmpeg reads from hw:CARD=Loopback,DEV=1, and outputs to your real output device. Mpd, squeezelite or whatever plays into hw:CARD=Loopback,DEV=0
 

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,755
Likes
3,055
All I got was a 10-band graphic. If alsa 'equal' has a way to specify parametric filters using a config file then I'm interested. I don't want to have to connect KVM to the RPiZ.
For parameters in a config file you just need the normal alsa plugin type ladspa in the alsa config. The template file from the volumio parametric plugin should give you the gist of it. It's using the EqFA4p ladspa plugin with config values (the 'controls []' part) that it reads from the volumio gui.

The 'equal' plugin lets you use the mixer interface to change the parameters without having to edit the config and reload. The docs on that github page are a bit brief, but should get you there - see the 'More Advanced Stuff:' section further down the page. The 10 band graphic is the default when using the simple config from the 'USAGE:' section.
 

thefsb

Addicted to Fun and Learning
Joined
Nov 2, 2019
Messages
796
Likes
657
For parameters in a config file you just need the normal alsa plugin type ladspa in the alsa config. The template file from the volumio parametric plugin should give you the gist of it. It's using the EqFA4p ladspa plugin with config values (the 'controls []' part) that it reads from the volumio gui.

The 'equal' plugin lets you use the mixer interface to change the parameters without having to edit the config and reload. The docs on that github page are a bit brief, but should get you there - see the 'More Advanced Stuff:' section further down the page. The 10 band graphic is the default when using the simple config from the 'USAGE:' section.

Once confirmed, we should write this up as a howto.
 

thefsb

Addicted to Fun and Learning
Joined
Nov 2, 2019
Messages
796
Likes
657
Confirmed: EQ using the ffmpeg filters in BubbleUPNP Server's OpenHome Renderer works. For example, this filter cuts by 20 dB below 3000 Hz. CPU use on the RPi is very low.

1576678398964.png
 

maarten

Member
Joined
Jun 1, 2019
Messages
37
Likes
52
The description matches a known issue that's probably related to the USB-OTG port used on the Pi models below the Pi 4. The simple answer is stick to your spdif output.

Edit: To be clear, I don't mean that the Pi's USB (<pi4) will always be a problem - for many it's fine, including me with PiCorePlayer. The fundamental problem is that under certain conditions the usb packets are delivered to the DAC slightly too late. The problem is that 'certain conditions' isn't well defined. Among the things that make it more likely/worse are heavy USB traffic, increasing sample rate / bit depth, and certain programs running, including BruteFIR (unless you restrict it to a single cpu core) and, I believe, the database engine used by Volumio among others.

Thanks did not know that... I'll stick to spdif output which is flawless.
 

JoachimStrobel

Addicted to Fun and Learning
Forum Donor
Joined
Jul 27, 2019
Messages
519
Likes
304
Location
Germany
As this seems to be the Raspi thread, I have a question:
I found a Raspi 4 under my Christmas tree and wonder if I should go the electronic or audio route with it.
For audio, I hoped that I could get Mch from the Hdmi port(s), but that seemed not to work for the old R3, or only badly, and I wonder if that is ok now for the R4. I was disappointed to see, that HDMI audio output is disabled when used as a Roon bridge. It seems not to run Amazon HD, and I have not found stuff like a stereo to Mch conversion software yet. Is there an ADC add on? Volumio seems to be a nice application, it seems to let audio out of the HDMI port, but I have read conflicting posts on that. Any advice?
 

gfx_1

Active Member
Joined
Nov 9, 2019
Messages
138
Likes
96
I've a digiberry clone on my raspberry pi 3 (optical and coax digital output via i2c) and it works fine.
Running standard raspbian (no gui just ssh) with mpd mpc and cyp (control your player a web interface)
music is on an usb ssd drive in flac with a cover.jpg image in each album folder. It all works pretty quickly.

I played around with volumio and moodeaudio but the last one had issues with updating and cyp whilst very basic is quick.
(sorry for all the 3 letter abbreviations, can do a longer write-up last time I installed it I took notes)

Volumio is configurable it can do other outputs. (if available)
 

JoachimStrobel

Addicted to Fun and Learning
Forum Donor
Joined
Jul 27, 2019
Messages
519
Likes
304
Location
Germany
That may be the wrong place for this post, but anyway: Brave new world.

So I installed Volumio on my Raspberry4. The Hdmi output only works when booting with the HDMI cable attached to my Oppo 103, it does not work when booting into my NanoAvr, and I tried all keywords in the config.txt. Works ok, but the HDMI output sounds a bit rough. Playing webradios via IPhone over airplay into Apple TV sounds better.
I then saw the Roon plugin for Volumio and installed that. Got a Roon test license. Found out that my 1000+ Amazon autorips can not be upgraded from their low quality MP3 size to HD even when subscribing to Amazon HD. So I run Roon with my 250kb/s autorips downloaded into a folder.
Roon finds the Volumio HDMI frontend and it works - same edgy sound, but I am streaming 250kbyte/s from my PC’s core to my R4 into my NanoAvr. Hurra.
Roon is nice as it shows me most of the CD Album information without me having to get the CD from my bookshelf- which I could of course. And the times when I had to remember all musicians from Woody Herman’s Thundering Herd in order to find them in other Big Bands are over now.
I tried to get Mch out of the R4‘s HDMI but it caused a hang up.
I need to say that one of my PCs has a nice housing and sits in an isolated box near my audio system, so I can send HDMI directly from the PC to the NanoAvr. That sounds better. I tried Mch again, but Roon refused that as the HDMI output did not work then.
I could now rip (I guess copy is the correct word as I own my CDs and they of course have no DRM) into my Pc for Roon to play them. I could also find them on Amazon and then stream them with one click in HD into Airplay/Blutooth/OTG-HDMI/VNC while viewing the full cover notes. I guess I could spend some time with such things ...

That was my post-Xmas dive into the brave new streaming world. I then played an audio Blu-ray (Duets2 from T Bennett) on my Oppo and BenQ projector and thought about how that would work now streaming-wise. I then order the 100 piece electronic kit for my Raspberry.
 
Last edited:

threni

Major Contributor
Joined
Oct 18, 2019
Messages
1,281
Likes
1,532
Location
/dev/null
I could now rip (I guess copy is the correct word as I own my CDs and they of course have no DRM)

Rip is still the correct word; also, CDs have never contained DRM as it's not allowed for in the standard (except for that copy flag thing everybody/app/law ignores). I've returned "so-called CDs" for a refund when I discovered DRM; not that it wasn't possible to rip them but just for the principle.
 

JoachimStrobel

Addicted to Fun and Learning
Forum Donor
Joined
Jul 27, 2019
Messages
519
Likes
304
Location
Germany
English is obviously not my mother-tongue. Still I would separate the issue of ripping Dvds and Sacds from making a legal copy of my CD which, according to the RedBook, is not licensed to have a DRM system included.
 

threni

Major Contributor
Joined
Oct 18, 2019
Messages
1,281
Likes
1,532
Location
/dev/null
English is obviously not my mother-tongue. Still I would separate the issue of ripping Dvds and Sacds from making a legal copy of my CD which, according to the RedBook, is not licensed to have a DRM system included.

I'm in the UK and here it is illegal to rip CDs for use on your other device. Seriously. We still do it, though - to the extent anyone buys CDs that is - and it's still called ripping.
 
Top Bottom