Help in building Raspberry Pi with DAC

@mbhangui excellent explanations.
Can you please highlight why NTFS is avoidable as a format for storing music files as compared to exfat while connecting the drive to raspbian based distros like MoOde Audio.
As I am fully on windows platform, NTFS works flawlessly for me when I need to connect the drive to my laptop for copying files or for anything else.
If NTFS has pitfalls only option left out is exfat.
You can always install smbd (SAMBA) on linux and have the hard disk accessed by all windows machines. With samba, your hard disk can be ext4, xfs, zfs or btrfs and it will be still accessible from windows. That's how my music data is available on my macbook. I don't have any window macine in my house, but one of my colleague could mount the same on his window's laptop.

NTFS is a journaling file system. So writes will be slower than exFAT. So it depends on if you are going to write or read from the disk. For writes, NTFS will be slower, because you are writing the actual music data as well as the data for the journal. But then even ext4 is a journaling file system.

As far as Linux is concerned, the NTFS driver in the kernel is not as good as the windows implementation. It is for this reason alone, a filesystem like ext4, xfs, zfs will give much superior performance over NTFS. I have myself benchmarked the performance and the ext4 performance is many many times that over NTFS. Not because NTFS is bad, but because the linux driver for NTFS isn't good enough. But things may change
By September 2020, Paragon had moved on to the final stage: Acceptance. The company "contributed the read-write NTFS kernel driver under the GPL to the Linux community, for hopeful inclusion in due time to the mainline kernel.

That was wonderful news… except for this one little thing. The NTFS3 code was in no way, shape, or form ready to be added to the kernel. That's the thing with proprietary code – and why I'm cynical about the idea that Microsoft could simply open-source, say, all of Windows 7 – it's often badly written. Unlike open-source, where everyone can see your work, proprietary software can hide its sins from watchers.

EDIT: The exFAT is a better implemented fs on linux than NTFS.
 
You can always install smbd (SAMBA) on linux and have the hard disk accessed by all windows machines. With samaba, your hard disk can be ext4, xfs, zfs or btrfs and it will be still accessible from windows. That's how my music data is available on my macbook. I don't have any window macine in my house, but one of my colleague could mount the same on his window's laptop.

NTFS is a journaling file system. So writes will be slower than exFAT. So it depends on if you are going to write or read from the disk. For writes, NTFS will be slower, because you are writing the actual music data as well as the data for the journal. But then even ext4 is a journaling file system.

As far as Linux is concerned, the NTFS driver in the kernel is not as good as the windows implementation. It is for this reason alone, a filesystem like ext4, xfs, zfs will give much superior performance over NTFS. I have myself benchmarked the performance and the ext4 performance is many many times that over NTFS. Not because NTFS is bad, but because the linux driver for NTFS isn't good enough. But things may change

Thanks. I always connect my externally powered drive to the rpi usb. So playback is direct not via network.
Since i dont write files often, whenever I need to, i just connect the drive directly to laptop. However Samba is installed natively under MoOde and the drives are visible under network on all windows PCs for access.
 
I will switch to exfat on one of my drives and see.
What you will lose with exfat is the excellent recovery from corruption capability of a journaling filesystem like NTFS. As long as your raspberry pi doesn't get switched off suddenly, exfat should be fine.
 
I need the filesystem to be compatible with windows. I don't know if there's now a reliable way to use linux filesystems on windows. I'd look into it. All my external drives are exFAT as of now.
I somehow didn't see that you wrote that your hard drives are exFAT. exFAT will be good enough and faster than NTFS on linux. @Kannan 's reply made me look at your post again and I noticed this. Just make sure that you shutdown your raspberry pi and not switch off the power suddenly.
 
The question is how familiar are you with Linux? Do you know how to read man pages. Nothing much is required. Just few steps
1. Connect the external drive to your raspberrypi on a usb 3.0 port
2. Do journalctl -l, go to the bottom and see the device name.
3. Format your external hard disk to one of the following filesystems (ext4, zfs, xfs, btrfs). ext4 will be a good choice. DONT DONT use NTFS unless you are OK with sub par performance. One uses the mkfs.ext4 to format a filesystem for ext4, mkfs.xfs for xfs, etc, etc
4. Run the blkid command to get the UUID of the hard disk
3. Edit /etc/fstab and put your entry for your hard disk for the above UUID.
4. mount the disk first time using the mount command. If the disk mounts, you have scuccessfully added the hard disk. No on every reboot the hard disk will automatically get mounted

For easy reference all files related to my setup are here https://github.com/mbhangui/pistop/tree/master/example_config/server


I have used mpd extensively and recently also used Logitech media server. I prefer MPD because I find it is the one that is the most efficient and doesn't take any system resource. to install you just need to run the command apt-get install mpd. Once you have done that you need to edit /etc/mpd.conf to point to your music folder on your external hard disk. mpd will scan your entire music directory in few seconds and build its tag database with tags that are already present in your music files (title, author, album, year, etc).
mpd doesn't come with any interface. It is a client server model where any client can connect to mpd on port 6600 and query mpd for details like what song is playing, what is the position of playback, the song title, song author, etc. It can also issue commands like stop, play, pause, etc. There are plenty of clients available. You are free to chose any client that gives a good graphical interface. I use cantata on my macbook and linux latop.

Logitech media server is similar. It runs a service written in perl and provides http interface on port 9000. You can use any web browser to connect to LMS on port 9000.

Since I have tried both. Here are few pros and cons of LMS and mpd

MPD: Pros
1. Extremely efficient and tiny code. It has the best code available to buffer music data and send it to the dac. It works flawlessly with ALSA. Extremly IMPORTANT. mpd passes the music data locally from the hard disk directly to the dac. It doesn't stream the data like LMS.
2. Extremely low latency output. This is expected because the code is small and written in C/C++. Low latency is also because the data is passed directly to the DAC and not via streaming. Also because mpd does nothing that is not related to producing sound. (e.g. recording when the song was played, providing rating button, maintaining playcounts, etc).
3. You can have a satellite system. If you have multiple clients or multiple music playback systems (e.g. multiple RPIs in different rooms). In this case one mpd will provide the song database and it's metadata. slave mpd clients pick can exchange the traffic with miniscule amount of data
4. You can even use the unix telnet command to play song. As a developer who is always on the terminal and uses vi editor for coding, the worst thing that can happen when you have to use the mouse. Using the mouse drastically reduces your typing throughput as your hand has to leave the keyboard. I use tmux to run multiple terminals on different screens. i run the vim on one screen and a terminal based mpd player on another screen. So when I have to pause, stop, play any music, I can do just by switching ther terminal screen and type few letters to do any song operation. There is a command line player for LMS too, but I haven't tried it yet.
5. mpd can play all formats natively (DSD, wav, flac, mpd, ogg, etc). It can also do only the fly conversion if your DAC doesn't support it.
6. mpd serves both as a media server as well as a player.
7. Opens the audio device only when playing. So you can use any other music client when you are not playing song using mpd
8. It can do MQA. It has plugin for both Tidal as well as Qobuz
9. It has 64-bit version.

MPD: Cons
1. No graphical interface. mpd is a pure music player. With few commands that can be sent on port 6600. So for a novice it takes longer to understand mpd. A newcomer often struggles finding the proper gui or client to play music. But there are plenty of clients (linux desktops, command line and web based clients). See https://www.musicpd.org/clients/

LMS Pros
1. The LMS server is quite efficient even though it is in perl. It does consume more resources than mpd, takes longer to tag files, but is many times better than the so called distributions. Some members call these distributions OS.
2. It stores lot of metadata technically not part of song data (things like user rating for the song, how many times song was played, etc)
3. Plenty of plugins. The material skin plugin gives you a nice web based player. The connection to the internal web interface is persisent and efficient. WHen you use volumio, moode, the so called distributions, they continuously connect to mpd just to display the song played position.
4. With the chromecast plugin, it can play your local music on google chromecast devices with the albumart. I can effortlessly play song on my android tv. The feature is what I love the most. It plays song even on my google home mini and chromecast audio device.
5. Once you have installed LMS and the player, using it is a breeze.
6. It has 64-bit version

LMS Cons:
1. Takes more resources than a mpd setup.
2. DSD playback is not native. You require to enable a plugin which does DSD over PCM.
3. You don't have LMS in the official debian repository. So you have to download from here https://mysqueezebox.com/download. The client can be downloaded from here https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/
4. LMS is just the media server. For playback you need a player. The player is a separate executable called squeezelite.
5. Grabs the audio device even when you are not playing any song. This prevents other players like airplay, spotify from using the audio device. So to play spotify for example, you have to press the power button on the player interface to turn off the player
8. Higher latency than mpd. So sound will not be neutral. Music playback is always by exchanging data from the LMS server to the squeezelite client on the network. So if you are using LMS, then it is important that you use a gigabit network and not wifi connectivity between the LMS server and the squeezelite client.


Using any Linear Power supply for the hat is always better. A good low cost solution is the Allo Shanti LPS.

This is my music interface when using mpd
View attachment 68886

This is my interface for LMS.
View attachment 68887
EDIT:

If you use one of the distributions, the pain of doing setup goes away. You get everything installed and configured. I have tried moode, dietpi and volumio. IMHO moode is the best. It exploits the maximum features of mpd. I have also heard good reviews of picore player which uses LMS. But haven't tried that distribution.
@mbhangui: I recently switched to LMS+Squeeze lite. Everything is just good.
However, I am not able to setup upnp/dlna. The plugin is installed and enabled in the server, but while using Hificast/bubbleupnp, streaming of youtube urls are returning the error 714, illegal mimetype. However, casting local files stored in my android phone via Hificast just works (Bubbleupnp is still not working).
Any help on this is appreciated.
 
@mbhangui: I recently switched to LMS+Squeeze lite. Everything is just good.
However, I am not able to setup upnp/dlna. The plugin is installed and enabled in the server, but while using Hificast/bubbleupnp, streaming of youtube urls are returning the error 714, illegal mimetype. However, casting local files stored in my android phone via Hificast just works (Bubbleupnp is still not working).
Any help on this is appreciated.
I have seen the upnp/dlna plugin in the plugin list, but never tried it because I have dlna installed without using the plugin and it works flawlessly on the same server where I have LMS installed.

This is what I did
sudo apt install minidlna

My external hard disk is mounted as /home/pi/MDrive which has the folder Music containing all my music file. So this is what I have in /etc/minidlna.conf. Note that I am use network_interface=eth0 which the wired gigabit port. Apart from that you will have to adjust media_dir, db_dir, log_dir as per your taste
user=minidlna
media_dir=A,/home/pi/MDrive/Music
db_dir=/home/pi/MDrive/data/minidlna.MusicPI
log_dir=/var/log/minidlna
network_interface=eth0
port=8200
friendly_name=MusicPI
model_name=MusicPI (MiniDLNA)
inotify=yes
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg
album_art_names=AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg
album_art_names=Folder.jpg/folder.jpg
strict_dlna=yes
enable_tivo=no
notify_interval=895
max_connections=10
wide_links=yes
 
I will switch to exfat on one of my drives and see.
Here are the result of file system performance tests @Kannan , that I just carried out

1. Copying Data

Copying files, exfat gives the best performance without fsync. It performs better than all linux filesystems. But that is also because the linux filesystems are journaling file systems. With fsync enabled which ensures data is safely written to disk, ntfs performs slightly better than exfat. Also ntfs performance is almost that of ext4. If you are not going to power off the disk suddenly, ntfs performance is extremely poor to be used on linux. This test is important if you are going to copy files to your hard disk frequently.

Conclusion: exfat wins

Screenshot 2022-04-22 at 13.26.13.png


2. Deleting Data

For deletion, NTFS performance is very poor on linux, but not as bad as zfs. zfs is anyway known for bad delete performance. exfat performs as good as ext4.
Conclusion: exfat wins
Deletion TImes (fsync).png
3. Accessing Data

NTFS performs very poorly compared to exfat when it comes to accessing files. The performance improves when you have files spread over multiple directories. But the performance is extremeley bad when comparing with any file system.

Conclusion: exfat wins and NTFS should be avoided at all costs on Linux.
Access Times (fsync).png
 
Last edited:
You just need to install samba and your samba share will work on mac or windows. That's how it is in my setup. My hard disk is ext4 but the shared folder is mountable on mac, windows and my android phones.
That'd certainly work. Thanks!

With LMS each and every machine is streaming audio over the network. Even on the machine having the hard disk, LMS will be streaming data to the loal squeezelite client on the loopback network interface on TCP port 3483.

Remember that the music playback is always happenng from the buffer, regardless of whether you are using mpd or using squeezlite client of LMS. The underlying driver for both is ALSA. So both should sound the same. However there is more likelyhood of things going wrong for LMS than with mpd because of the extra network layer involving TCP port 3483.
I was confused about the streaming aspect and its impact on performance, but if it's on loopback address, I can rest easy.

In the end, it is neither mpd or squeezelite playing the audio. It is the ALSA driver. Our ears are so biased that we here things differentlly just by looks, cost, etc of the equipment.
Ain't that the truth!
 
apparently the paragon ntfs driver was added to linux kernel from 5.15. So it is already now part of the linux mainline kernel.

according to this user the new driver from paragon performed worse then the original linux driver (which itself is bad) on a hard drive but performed better on a nvme drive.

Should You Switch to the New NTFS3 Driver?​

Well, that depends. If all you care is read speed – like I do – you have to consider the storage media. In my test the new NTFS3 kernel driver gave a 27% boost with a NVMe flash drive when reading data. But it was 14% slower on a regular HDD.

One just have to use the ntfs3 driver

 
Last edited:
Hi guys, I finally managed to get a Rpi 4 with original power supply (boxed) for 2K. Its a 2GB varient. I wanted to use it as my roon end point. I installed RopieeeXL first, everything worked fine. I wanted to display the album art to my TV via HDMI. I purchased micro HDMI and connected with my TV but later I realised that HDMI out is disabled for RopieeeXL. I installed MoOde OS and updated OS for Roon bridge, again music is playing fine, but HDMI output is not working. I am getting a dark screen on my TV. No boot screen as well. I have enabled display under Config>System, still no display. Am I missing something here? What I learn from MoOde forums is that I need to enable Local Display. Please suggest.

1666364945276.png
 
Check out our special offers on Stereo Package & Bundles for all budget types.
Back
Top