Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Introducing pleezer: a Deezer Connect player
#81
(04-11-2025, 10:18 AM)roderickvd Wrote:
(04-11-2025, 10:13 AM)Tim Curtis Wrote: The /tmp dir at least on PiOS is mounted by systemd as type tmpfs which AFAIK is a RAM based file system.

On my moOde install it seems mounted on the SD card:

Code:
roderick@headphones:~ $ findmnt -T /tmp
TARGET SOURCE         FSTYPE OPTIONS
/      /dev/mmcblk0p2 ext4   rw,noatime

If it were tmpfs, then yes that would also work well to save the SD card.

Wow, I always thought systemd mounted it as a tmpfs :-0

After some digging it turns out the systemd unit "tmp.mount" is not enabled by default on PiOS. The file location is /usr/share/systemd/tmp.mount

To enable it
Code:
sudo cp /usr/share/systemd/tmp.mount /etc/systemd/system/
sudo systemctl enable tmp.mount
sudo reboot

Then we get
Code:
pi@moode9:~ $ findmnt -T /tmp
TARGET SOURCE FSTYPE OPTIONS
/tmp   tmpfs  tmpfs  rw,nosuid,nodev,size=2070800k,nr_inodes=1048576

But best to leave it as-is on PiOS. Now the RAM file option in pleezer makes sense :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#82
There are only two reasons that I can think of why this would be disabled by default:

1. Let the user choose whether he/she wants to spend the RAM on it. Some RPi's may have little RAM onboard, or have software that requires a lot; this is the safe default.

2. Maybe during the boot process some things are initially written to disk-based /tmp before the tmpfs service starts.

I don't know, could be interesting to think about changing the default for moOde? Or make it a system setting? After all, moOde itself takes very little RAM, and most RPi's have plenty. So it would be a safe thing to do in 99.9% of cases.
maintainer of librespot and pleezer, working on a qobuz connect player. sponsor me: https://github.com/sponsors/roderickvd
Reply
#83
(04-11-2025, 11:26 AM)roderickvd Wrote: There are only two reasons that I can think of why this would be disabled by default:

1. Let the user choose whether he/she wants to spend the RAM on it. Some RPi's may have little RAM onboard, or have software that requires a lot; this is the safe default.

2. Maybe during the boot process some things are initially written to disk-based /tmp before the tmpfs service starts.

I don't know, could be interesting to think about changing the default for moOde? Or make it a system setting? After all, moOde itself takes very little RAM, and most RPi's have plenty. So it would be a safe thing to do in 99.9% of cases.

It could be a setting. The systemd unit specifies size=50% (there is actually a bug in that option) It specifies 50%% but the extra % sign doesn't seem to cause any issues.

Code:
[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,nosuid,nodev,size=50%%,nr_inodes=1m

I'll run it on one of my systems for few days and see what happens.

Currently utilization is really low
Code:
pi@moode9:~ $ df -h /tmp
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           2.0G   32K  2.0G   1% /tmp
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#84
(04-11-2025, 11:26 AM)roderickvd Wrote: There are only two reasons that I can think of why this would be disabled by default:

1. Let the user choose whether he/she wants to spend the RAM on it. Some RPi's may have little RAM onboard, or have software that requires a lot; this is the safe default.

2. Maybe during the boot process some things are initially written to disk-based /tmp before the tmpfs service starts.

I don't know, could be interesting to think about changing the default for moOde? Or make it a system setting? After all, moOde itself takes very little RAM, and most RPi's have plenty. So it would be a safe thing to do in 99.9% of cases.

Pi Zeroes and Pi 3A+ have 512 MB of RAM. I think I’d want user-selectable setting for them, just in case Smile

Finding out /tmp isn’t currently a tmpfs in moOde was a surprise to me. I forgot to follow the “trust but verify” dictum.

Regards,
Kent
Reply
#85
I enabled tmpfs with that service on my RPi 4B too. Seems fine on cursory testing.
maintainer of librespot and pleezer, working on a qobuz connect player. sponsor me: https://github.com/sponsors/roderickvd
Reply
#86
(04-11-2025, 05:15 PM)roderickvd Wrote: I enabled tmpfs with that service on my RPi 4B too. Seems fine on cursory testing.

The actual config for this is below. I did end up making it a System Config option (default is on).

1. Cleanup from testing
sudo rm /etc/systemd/system/tmp.mount
sudo reboot

2. Install into /lib
cp /usr/share/systemd/tmp.mount /lib/systemd/system/'
sudo reboot

3. Turn off/on then reboot
# Off
sudo systemctl mask tmp.mount
# On
sudo systemctl unmask tmp.mount
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#87
Important notice to update to pleezer v0.16.0. Versions up until now did not properly clean up the hook script processes, leading to resource exhaustion and in effect a denial of service.

Please build from GitHub source, as I can't release it to crates.io yet due to a dependency issue.
maintainer of librespot and pleezer, working on a qobuz connect player. sponsor me: https://github.com/sponsors/roderickvd
Reply
#88
No prob.

Installation instructions below.
Code:
sudo apt update
sudo apt-mark unhold pleezer
sudo apt -y install pleezer=0.16.0-1moode1
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#89
Hey this is awesome work, just switched to Deezer from using Spotify cast before on Moode.
What i miss is being able to cast from different accounts.
Would it be possible to have an option to have more then one Pleezer instances running for different accounts in my household?
or an idea to solve this in a different way?
 
Another thing i would appreciate, but is completely down on my priority list, would be outputting album art and media info to via mpd.
This so i can have it available in my home assistant integration
Reply
#90
Do you mean write Deezer metadata and cover url to the currensong.txt file?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: