Hacker News new | ask | show | jobs
by k_sze 2021 days ago
I haven’t looked at the actual content of the repo, so this is pure speculation.

One of the possible reasons for stripping it down is for tighter control over real time performance.

To achieve smooth audio playback, you either need to ensure real time task scheduling with a tiny asynchronous buffer or not-so-real-time scheduling with a larger asynchronous buffer. Otherwise the audio will stutter.

The first approach ensures responsiveness: you click stop and it immediately stops; you press volume up and the volume immediately goes up. The second approach is “easier” but results in a bit of lag between your control input and the output.

With HiFiBerryOS, they may go with the first approach. The fewer things you have in a system, the fewer task scheduling surprises you have, and so you can make the buffer smaller and have better responsiveness.

Now, modern hardware, even something as cheap as the Rpi, has plenty enough processing power to ensure smooth playback like 99.9% of the time (I just pulled that number out of thin air), and most non-audiophile people won’t really notice any lag in the usual media players such as VLC in day-to-day listening, but some audiophiles will swear they can notice it.

3 comments

I have the same kind of setup than the parent comment (rpi2 and hifiberry dac, hooked to a marantz amp that also does phono).

It runs on raspbian and is USB powered and Ethernet networked by the close Apple timecapsule NAS / wifi AP. It then provides pulseaudio remote, shairport and mpd services.

I have not witnessed stutter but with buffering comes some kind of lag indeed. I strimmed down the basic install, by removing packages, disabling services and devices, in order to reduce power consumption and have the rpi to work out of the timecapsule USB.

My main takeaways:

1. The system has been stable for years and sounds great. I use it on the weekends mostly.

2. The DAC is great, because the built in audio is really terrible.

3. Spotify over Airport quality is not on par with pulseaudio, nor with playing flac through mpd. I have not found great mobile mpd client. Convenience wins.

4. It is strangely difficult to have pulseaudio running headless.

I'm currently building a Spotify Connect box based on Raspberry Pi 0W.

Do you have any information on what you could strip down from the basic Raspbian to get the best performance / power consumption?

Here is the snippet from my notes. I am not sure it applies to the rpi0w:

Raspbian seems OK.

Regarding the post-install config, mostly about deactivating stuff to lower the power consumption:

# /boot/config.txt [all] # should disable wifi, bluetooth and hdmi at boot time, lowering power consumption dtoverlay=disable-wifi dtoverlay=disable-bt hdmi_blanking=2 #dtoverlay=vc4-fkms-v3d dtoverlay=hifiberry-dacplus

# builtin audio must be deactivated #dtparam=audio=on Also, HDMI deactivation could live in another place, so add the following to /etc/rc.local :

# Disable HDMI /usr/bin/tvservice -o Then, some packages should be installed:

sudo apt-get update sudo apt-get upgrade

sudo apt-get pulseaudio pulsemixer pamix shairport pulseaudio-module-raop pulseaudio-module-zeroconf cmus mpd mpc

Thanks for the follow up. I'll try those and see if I can get some performance improvement.
From there, I have not needed to apply more hacks on top. It works just fine.
Yeah, I had a DIY car bluetooth system set up via some simple pulseaudio configs and a read-only boot setup but the one outstanding issue it had was the lag. I wonder if I'd have more luck using this.
> you press volume up and the volume immediately goes up

Current software only supports laggy playback, but immediate volume control via hardware volume controls.

So I am not certain that the real-time scheduling is as important here.