# Raspberry Pi 3 + DietPi: let’s share our optimisations

**URL:** <https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420>\
**Category:** DietPi\
**Created:** [December 15, 2018, 11:36am UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420 "2018-12-15T11:36:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phil\_Active\_Audio](https://community.roonlabs.com/letter_avatar/phil_active_audio/32/5_5575768a8748004e209b776fc1b2916d.png) [@Phil\_Active\_Audio](https://community.roonlabs.com/u/Phil_Active_Audio)\
**Post date:** [December 15, 2018, 11:36am UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/1 "2018-12-15T11:36:02Z")

</div>

Hi there,

I started my DietPi on Raspberry Pi 3 optimisation. This device is used as a Roon Bridge and Apple Airplay end point. Apple Airplay is being used to stream Qobuz from my iPad until Roon includes this service + various other services occasionally. I use the Allo Digione Signature hat cause the USB output SQ of the Raspberry Pi is low.

This topic is to share optimizations that may improve the overall SQ of this cheap but quite good device. So feel free to share your learnings.

My setup is as following:

- HDMI is off
- Ethernet is off, only WiFi
- Bluetooth is off
- CPU is in powersave mode
- CPU is in fixed frequency (600 MHz)
- All Linux processes are running on core 0
- All Roon Bridge processes are running on cores 1 & 2 in SCHED\_RR schedule policy (real time) and priority 99 (maximum). Nice is also set to -20, may be redundant or of no use.
- All Shairport processes are running on core 3 with similar options than Roon.

Overall SQ has been improved, especially dynamics and bass.

I used to use additional ALSA settings with Daphile (buffer time and period count). Those settings were having huge impact on SQ. But my knowledge in ALSA is not good enough to find where those settings were located. If one can help.

----- Edit 16th of december 2018 : CPU fixed frequency added

---

<div class="post-metadata">

**Author:** ![bevan\_court](https://community.roonlabs.com/letter_avatar/bevan_court/32/5_5575768a8748004e209b776fc1b2916d.png) [@bevan\_court](https://community.roonlabs.com/u/bevan_court)\
**Post date:** [December 15, 2018, 1:35pm UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/2 "2018-12-15T13:35:35Z")

</div>

How do you select the cores for different processes?

---

<div class="post-metadata">

**Author:** ![Phil\_Active\_Audio](https://community.roonlabs.com/letter_avatar/phil_active_audio/32/5_5575768a8748004e209b776fc1b2916d.png) [@Phil\_Active\_Audio](https://community.roonlabs.com/u/Phil_Active_Audio)\
**Post date:** [December 15, 2018, 10:09pm UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/3 "2018-12-15T22:09:41Z")

</div>

Use **DietPi-Process\_tool** menu and select, for each process, the according Affinity.  
Affinity is for processor’s cores.  
Simply unselect the core(s) you don’t want to be used by one process, and apply by clicking OK.

---

<div class="post-metadata">

**Author:** ![bevan\_court](https://community.roonlabs.com/letter_avatar/bevan_court/32/5_5575768a8748004e209b776fc1b2916d.png) [@bevan\_court](https://community.roonlabs.com/u/bevan_court)\
**Post date:** [December 16, 2018, 1:56am UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/4 "2018-12-16T01:56:59Z")

</div>

Thanks, though I just changed over to volumio

---

<div class="post-metadata">

**Author:** ![anon44636269](https://community.roonlabs.com/letter_avatar/anon44636269/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon44636269](https://community.roonlabs.com/u/anon44636269)\
**Post date:** [December 16, 2018, 8:35am UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/5 "2018-12-16T08:35:28Z")

</div>

Not sure you can change Alsa for Roon as it ignores the configs and has low level access. I asked a question in another thread about being able to use Alsa to mono my output as I have done this and it works for mod but not Roon.

---

<div class="post-metadata">

**Author:** ![Magnus](https://community.roonlabs.com/user_avatar/community.roonlabs.com/magnus/32/50384_2.png) [@Magnus](https://community.roonlabs.com/u/Magnus)\
**Post date:** [December 16, 2018, 10:22am UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/6 "2018-12-16T10:22:45Z")

</div>

I run my USBridge on fixed CPU frequency (720 Mhz), not sure if it improved the sound (if it did, it was minimal), but the reason is I read that CPU switching frequency was noisy.

---

<div class="post-metadata">

**Author:** ![Phil\_Active\_Audio](https://community.roonlabs.com/letter_avatar/phil_active_audio/32/5_5575768a8748004e209b776fc1b2916d.png) [@Phil\_Active\_Audio](https://community.roonlabs.com/u/Phil_Active_Audio)\
**Post date:** [December 16, 2018, 5:17pm UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/7 "2018-12-16T17:17:15Z")

</div>

Indeed Magnus, this was a best practice with Daphile and, I suppose, all computer based network source. I add it to the initial list.  
I had set it at 600 MHz on my device. Average load is less than 5% for the 2 Roon Bridge cores, and less than 10% for Linux processes core.

---

<div class="post-metadata">

**Author:** ![Magnus](https://community.roonlabs.com/user_avatar/community.roonlabs.com/magnus/32/50384_2.png) [@Magnus](https://community.roonlabs.com/u/Magnus)\
**Post date:** [December 18, 2018, 1:24pm UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/8 "2018-12-18T13:24:04Z")

</div>

Do you know how to make changes to process Affinity so they don’t reset after reboot. When I use dietpi\_process-tool I can make changes, but once I reboot they are gone.

---

<div class="post-metadata">

**Author:** ![Dan\_Knight](https://community.roonlabs.com/user_avatar/community.roonlabs.com/dan_knight/32/8669_2.png) [@Dan\_Knight](https://community.roonlabs.com/u/Dan_Knight)\
**Post date:** [December 18, 2018, 4:09pm UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/9 "2018-12-18T16:09:26Z")

</div>

Hi Magnus,

Settings are saved after reboot, in our local testing:

 ![image](https://roon-community-uploads.s3.amazonaws.com/original/3X/8/0/8092e25cbb7b736f708bf12b15eb810c0fa5006e.png)

Might be an issue with DietPi-RAMdisk not saving during shutdown.

Please apply your process\_tool settings, then run following to force a ramdisk sync to disk:

```auto
systemctl restart dietpi-ramdisk
```

Reboot, and verify settings are as set.

---

<div class="post-metadata">

**Author:** ![Magnus](https://community.roonlabs.com/user_avatar/community.roonlabs.com/magnus/32/50384_2.png) [@Magnus](https://community.roonlabs.com/u/Magnus)\
**Post date:** [December 18, 2018, 4:44pm UTC](https://community.roonlabs.com/t/raspberry-pi-3-dietpi-let-s-share-our-optimisations/55420/10 "2018-12-18T16:44:12Z")

</div>

Thanks, that did the trick. But even with RoonBridge set to affinity 3, htop shows 2 cores (the top ones, 0 and 1 I would guess) working at around 4% when RoonBridge works at 8%.
