Ubuntu Linux Streamer: Enabling High Quality Audio on Linux ?

rwnano

Well-Known Member
Joined
Jul 21, 2022
Messages
1,014
Points
83
Location
Gurugram, Haryana, India
https://medium.com/@gamunu/enable-high-quality-audio-on-linux-6f16f3fe7e1f
@mbhangui

If you are switched to Linux from Windows you will feel some of the Linux features is much worse than the Windows. One of the best example is sound.

When I compare the sound from Google Play music, YouTube and there is no doubt, music is so much better in the Windows OS because of drivers. In Linux the music sounds like from a can. There is no advanced sound panel to tweak, or is it?

At first, this is what I thought. But actually this is not true, Linux is much more capable and flexible. It happens to be that distribution maintainers of Ubuntu, Arch like distros have configured the default configuration of sound, graphics and fonts to work with all the computers that you can find on the market, or for at least work with most of them.

So, How can you configure the channels, audio depth or Hz, like in windows? It is quite simpler process than you think.

First you have to do little bit of tweaking of the Pulse configuration

FYI
 
I am looking to repurpose my Windows 10 server to a Limux machine.
This looks like a great place to start - will closely follow your thread when I am going to do the switch.


.
 
@rwnano @mbhangui
As someone new to these, I have a few questions and would really appreciate some clarifications, especially around audio-related builds.

I’ve heard many people mention that GentooPlayer is among the best options available for delivering high-quality audio output.
If that's true, Since it's also Linux-based, I’m curious — It must be even deeply tweaked to achieve that level of performance? Or is there something else that makes it stand out?

I also noticed that Gentoo Linux itself is available. If someone were to install and configure Gentoo for Audio, can we potentially achieve similar audio performance as GentooPlayer?

How do these options compare overall with percentage of difference... if we can say,
Ubuntu or other mainstream distros with advised type of configurations vs. GentooPlayer vs. Gentoo Linux, or Arch Linux specially build for Audio?

Thanks in advance for your insights!
 
@rwnano @mbhangui
As someone new to these, I have a few questions and would really appreciate some clarifications, especially around audio-related builds.

I’ve heard many people mention that GentooPlayer is among the best options available for delivering high-quality audio output.
If that's true, Since it's also Linux-based, I’m curious — It must be even deeply tweaked to achieve that level of performance? Or is there something else that makes it stand out?
One of the most important thing in this snake infested hobby is to think critically.

1. What prevents you folks from doing that?
2. Do you have a scientific bent of mind?
3. After answering the above two questions, ask yourself what produces the sound. This is a multiple choice question
a) The Gentoo Music Player
b) The Linux Kernel
c) Some driver on your machine
d) Bowine manure
e) Some code in the kernel
f) The DAC
g) Some mysterious force that science has no answer. So let us thrash ASR because everyting cannot be measured
h) Combination of two ore more points from above
i) None of the above. It is supernatural


I also noticed that Gentoo Linux itself is available. If someone were to install and configure Gentoo for Audio, can we potentially achieve similar audio performance as GentooPlayer?

How do these options compare overall with percentage of difference... if we can say,
Ubuntu or other mainstream distros with advised type of configurations vs. GentooPlayer vs. Gentoo Linux, or Arch Linux specially build for Audio?
Ubuntu is for timepass linux wannabies. Gentoo is a source based linux distribution. If you are using raspberrypi, stay away from it. It is not optimized for RPI like what the RPI foundation do with the raspbian code for RPI.
Thanks in advance for your insights!
Don't let my acerbic comments deter you from trying out 'What people say'. People say anything. It is very easy to say. Install the so called optimized gentoo player and play a dsd file. Then run the following two commands

1. ps -ef | wc -l
2. uptime

and let me know

If you want to optimize music playback, you don't need to hear what people say. The least you can do is to run a simple blind test. It need not be a double blind test. These are the things that matter

1.The processing power of your device should be utillized only for sending the data in your music file to the dac buffer. Once it is in the dac buffer, diretta, piretta, ethernet cable costing thousands of dollar doesn't matter. Unless your concept of how dac works is totally different than what the manufacturer designed it for.
2. Remove all uncessary services (printer, web services, etc). Remember your plan is not to run a data center inside your RPI. So why do you need to install volumio, dietpi and what not.
3. Remove the dreaded mixer like pulseaudio, pipewire, wireplumber, etc
4. Turn off all logging to /etc/systemd/journald.conf
5. Make /tmp, /var/tmp memory based filesystem
6. run the process that sends data to the dac buffer with high priority and high cpu affinity.
 
@rwnano @mbhangui
As someone new to these, I have a few questions and would really appreciate some clarifications, especially around audio-related builds.

I’ve heard many people mention that GentooPlayer is among the best options available for delivering high-quality audio output.
If that's true, Since it's also Linux-based, I’m curious — It must be even deeply tweaked to achieve that level of performance? Or is there something else that makes it stand out?

I also noticed that Gentoo Linux itself is available. If someone were to install and configure Gentoo for Audio, can we potentially achieve similar audio performance as GentooPlayer?

How do these options compare overall with percentage of difference... if we can say,
Ubuntu or other mainstream distros with advised type of configurations vs. GentooPlayer vs. Gentoo Linux, or Arch Linux specially build for Audio?

Thanks in advance for your insights!
I'd suggest that you use a flavour of Linux you are comfortable with and modify it to your purposes
 
https://medium.com/@gamunu/enable-high-quality-audio-on-linux-6f16f3fe7e1f
@mbhangui

If you are switched to Linux from Windows you will feel some of the Linux features is much worse than the Windows. One of the best example is sound.
This is an advert for the post
When I compare the sound from Google Play music, YouTube and there is no doubt, music is so much better in the Windows OS because of drivers. In Linux the music sounds like from a can. There is no advanced sound panel to tweak, or is it?

At first, this is what I thought. But actually this is not true, Linux is much more capable and flexible. It happens to be that distribution maintainers of Ubuntu, Arch like distros have configured the default configuration of sound, graphics and fonts to work with all the computers that you can find on the market, or for at least work with most of them.

So, How can you configure the channels, audio depth or Hz, like in windows? It is quite simpler process than you think.

First you have to do little bit of tweaking of the Pulse configuration
If you want quality throw out pulse. If you want audio to be shared between multiple applications, that is where you require pulse. Pulse is akin to the dreaded windows mixer. All sound goes through a user level process (pulse daemon) which thn routes it to ALSA (Advanced Linux Sound Architecture), the only thing that produces the sound.
The first thing I do when I install a device for music playback is to remove. purge pulse. The only thing you loose is for applications like kde, gnome to be able to produce sound
 
I am looking to repurpose my Windows 10 server to a Limux machine.
This looks like a great place to start - will closely follow your thread when I am going to do the switch.


.
There are 3 choices

1. Newbie - Ubuntu
2. Boring but stable - Debian
3. Cutting edge - Arch, openSUSE tumbleweed, fedora - Almost all innovation happens in these distros and all other distros play catchup with these 3 distros. Sometimes the lag is almost as high as 3 years. You can do some cool things with these cutting edge distros like your entire desktop can become a visualizer as in this video


Another cool thing (not shown) is that whenever the song changes, entire song information is displayed, including the dynamic range for the song.
 
Last edited:
There are 3 choices

1. Newbie - Ubuntu
2. Boring but stable - Debian
3. Cutting edge - Arch, openSUSE tumbleweed, fedora - Almost all innovation happens in these distros and all other distros play catchup with these 3 distros. Sometimes the lag is almost as high as 3 years. You can do some cool things with these cutting edge distros like your entire desktop can become a visualizer as in this video


Another cool thing (not shown) is that whenever the song changes, entire song information is displayed, including the dynamic range for the song.
Bhangui sir is there some flowchart illustrating what to do after installing Ubuntu Linux on a fresh laptop 💻 to optimise the same for working as a streamer 🎏? That will help our friends
 
Two things that linux still cannot do. More to do with proprietary nature of protocols by google and apple.You will end up installing tons of code using python, rust etc to achieve sub optimal implementation of YT music or apple music. What I do is to use apple hardware to play apple music and chromecast audio for YT music using an ethernet interface like this. All my dac, amps have been converted to my own self designed ethernet interface to transfer audio (explained in this DIY post https://www.hifivision.com/threads/...cable-over-ethernet-cable.97926/#post-1078014)

1759511804937.png

1759511834450.png
 
Two things that linux still cannot do. More to do with proprietary nature of protocols by google and apple.You will end up installing tons of code using python, rust etc to achieve sub optimal implementation of YT music or apple music. What I do is to use apple hardware to play apple music and chromecast audio for YT music using an ethernet interface like this. All my dac, amps have been converted to my own self designed ethernet interface to transfer audio (explained in this DIY post https://www.hifivision.com/threads/...cable-over-ethernet-cable.97926/#post-1078014)

View attachment 93212

View attachment 93213
Fundoooo Sir....(Does mexican wave 🌊 👋)
 
@mbhangui : Gentooplayer is not gentoo linux. It's a Linux binary (read paid) optimised distribution for rpi that uses gentoo linux as its base.
I know that. What you need to know is that if you purchase a dac and it gets delivered by India Post. Buy the same dac and it gets delivered by DHL express, both DAC will sound the same. So How your DAC got delivered to your house has no impact on how the audio will play. So regardless of your player (gentoo, pentoo, sentoo, itunes, etc), how the audio bits got delivered to the DAC buffer has no impact as long as there is no underrun. Also doesn't matter if the India Post postman had gutka while riding his bicycle and the DHL express guy drank a bottle of DIretta lemonade juice before delivering the DAC.
 
Last edited:
BTW - I appreciate the work of Balena - which is Docker for IoT devices like Raspberry Pi, they have really done good work.
Anyone interested in multiroom audio for FREE - can check out:


 
Bhangui sir is there some flowchart illustrating what to do after installing Ubuntu Linux on a fresh laptop 💻 to optimise the same for working as a streamer 🎏? That will help our friends
It is not possible for me to put out everthing. Too much time/effort involved. But you can do it in phases.

You require minimum two machines.
1. Machine one. Do a minimal installation. This will be optimized for music playback. This machine will not have any gui or web browser, etc. Install first ask me questions later on how to optimize post installation
2. Machine two. This is the controller. This is the machine which you will use to control playback, stop, pause, skip, fast forward, rewind, select song, add songs, etc. It doesn't matter how good or bad your installation is
 
What I do is use zerotier-one network to make my hard disk with around 55k songs available on vpn. I have a master mpd daemon that serves the hard disk and satellite mpd setups connecting using zerotier-one network to my master mpd.

All my raspberry pi's have bluetooth and wireless disabled. They are all connected to the main router using a lan cable. The network interface ztklhy6mhm with IP 192.168.194.101 is available to me globally anywhere in the world. My android phone too has zerotier-one installed and can access the hard disk.

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.101 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::7517:885:c132:c954 prefixlen 64 scopeid 0x20<link>
inet6 fd9f:3e71:ac61:6747:93a1:3193:946c:d15c prefixlen 64 scopeid 0x0<global>
ether dc:a6:32:28:62:f0 txqueuelen 1000 (Ethernet)
RX packets 1160111 bytes 308757191 (294.4 MiB)
RX errors 0 dropped 37 overruns 0 frame 0
TX packets 6942583 bytes 9338683344 (8.6 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 60709 bytes 11507763 (10.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 60709 bytes 11507763 (10.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ztklhy6mhm: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2800
inet 192.168.194.101 netmask 255.255.255.0 broadcast 192.168.194.255
inet6 fe80::944e:c1ff:fe85:a597 prefixlen 64 scopeid 0x20<link>
ether 96:4e:c1:85:a5:97 txqueuelen 1000 (Ethernet)
RX packets 22848 bytes 5232601 (4.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 336 bytes 68283 (66.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
 
What I do is use zerotier-one network to make my hard disk with around 55k songs available on vpn. I have a master mpd daemon that serves the hard disk and satellite mpd setups connecting using zerotier-one network to my master mpd.

All my raspberry pi's have bluetooth and wireless disabled. They are all connected to the main router using a lan cable. The network interface ztklhy6mhm with IP 192.168.194.101 is available to me globally anywhere in the world. My android phone too has zerotier-one installed and can access the hard disk.
Zero-tier usage is pretty cool, in other words, "God-tier" !
Have used it to deploy Raspberry Pi's in the wild in the past. Nixed it for OpenVPN
 
I know that. What you need to know is that if you purchase a dac and it gets delivered by India Post. Buy the same dac and it gets delivered by DHL express, both DAC will sound the same. So How your DAC got delivered to your house has no impact on how the audio will play. So regardless of your player (gentoo, pentoo, sentoo, itunes, etc), how the audio bits got delivered to the DAC buffer has no impact as long as there is no underrun. Also doesn't matter if the India Post postman had gutka while riding his bicycle and the DHL express guy drank a bottle of DIretta lemonade juice before delivering the DAC.
DAC buffers are tiny and that is not the cause of noise. If there are 10 post men coming at the same time vs 1 post man coming at 1 hr intervals matters. In the former the raspberry pi has to boost up and increase its clocks to avoid a buffer underrun. Everytime a cpu changes states by boosting up, it is extra voltage being applied to the CPU and as a result extra noise on all the bus lines. This can be heard if your system and dac are resolving enough.

This is a measurable phenomenon - noise at output is higher when cpu is under heavy load. I work for a cpu manufacturer and we do these measurements to check if the noise at the output is acceptable or not. Not sure how much of this is done on a raspberry pi but it will be easy to measure.
 
DAC buffers are tiny and that is not the cause of noise. If there are 10 post men coming at the same time vs 1 post man coming at 1 hr intervals matters. In the former the raspberry pi has to boost up and increase its clocks to avoid a buffer underrun. Everytime a cpu changes states by boosting up, it is extra voltage being applied to the CPU and as a result extra noise on all the bus lines. This can be heard if your system and dac are resolving enough.

This is a measurable phenomenon - noise at output is higher when cpu is under heavy load. I work for a cpu manufacturer and we do these measurements to check if the noise at the output is acceptable or not. Not sure how much of this is done on a raspberry pi but it will be easy to measure.
WOW
 
Get the Award Winning Diamond 12.3 Floorstanding Speakers on Special Offer
Back
Top