Jump to content

Tasso

Building the ideal(ish) Music Server

Recommended Posts

But 'scuse me, is the 'idealish' word not being used in vain? The mighty 'Zilla is part of the package!

 

It aint an omelette without the eggs.

 

It would be good to test both contenders with at least an Uptone JS-2 LPS.

 

 

Share this post


Link to post
Share on other sites
10 minutes ago, BioBrian said:

But 'scuse me, is the 'idealish' word not being used in vain? The mighty 'Zilla is part of the package!

 

It aint an omelette without the eggs.

 

It would be good to test both contenders with at least an Uptone JS-2 LPS.

 

 

That's what I'm using. Tried it. SOtM is a tad better. So much so I've passed on the "idealish".

I admit I never went the full 'Zilla version.

Share this post


Link to post
Share on other sites
19 minutes ago, a.dent said:

So much so I've passed on the "idealish".

Sorry to hear this. It still feels like we never got to the end of it.

 

The plug went missing for me, when the 3.3V Motherboard injection thing never happened. Well, maybe for Chanh.

 

I think the weak spot is the Pico - it seemed the ATX timing thing was about to be conquered, but it all fizzled out, the last 2 boards crossing the Atlantic, never to be heard of again.

 

I'm running mine on 2 x JS-2s now: 12V to Pico, 5V to SSD, separate 5V to Shaar USB card (and the other 12V running 'control' fanless mITX etc computer). Nice, but I want to keep going!

 

Hopefully, someone will suggest ways of doing the individual core thing (etc) within Snakeoil - it's looking pretty sexy nowadays.

Share this post


Link to post
Share on other sites
15 hours ago, BioBrian said:

Hopefully, someone will suggest ways of doing the individual core thing (etc) within Snakeoil - it's looking pretty sexy nowadays.

 

We could prolly step through it here. 

 

A properly-optimised version of as much is up to the Snakeoil admins though - it's certainly not impossible to do (there's been some terrific work there with some very complex stuff, so no reason the rest can't be done). 

Share this post


Link to post
Share on other sites


Thanks Ric.

 

I just noticed this: might be a good place to start. Should probably leave one available for testing/mouse - how do we know which ones belong to which sockets?

 

53389970_SnakeoilUSBclosing.JPG.0a1c26b6b9984ccaef19a6faf2458dd0.JPG

Share this post


Link to post
Share on other sites
9 minutes ago, BioBrian said:

I just noticed this: might be a good place to start. Should probably leave one available for testing/mouse - how do we know which ones belong to which sockets?

 

53389970_SnakeoilUSBclosing.JPG.0a1c26b6b9984ccaef19a6faf2458dd0.JPG

Do you control it remotely (another computer/tablet/phone) or via keyboard/mouse?

 

If the latter, shut them all down except for the port the Amanero is connected to. It'll sound better. If the former, then let's work out how to SSH into your PC remotely. 

 

In fact let's work out how to SSH in anyway. 

Share this post


Link to post
Share on other sites
7 minutes ago, frednork said:

fairly straightforward explained below

https://www.snakeoil-os.net/Manual/configuration/logging-in

 

Bam. There it is. 

 

SSH in. If you have a mouse, a keyboard, a whatever plugged in type lsusb and copy what's there. But honestly you'll sound better with nothing but the audio device connected, I would control remotely and remove everything else. 

 

The USB power control will either be at BIOS or through uhubctl or via kernel device commands. All pretty straightforwards. 

 

If you can SSH in we can play and see what's going on for core use, though honestly I'd be surprised if most isn't already sorted - we can have a play at any rate.

Share this post


Link to post
Share on other sites


I always use VNC on the 'control' computer to access the server. I just unchecked all the other USB ports, and clicked 'Reset', when I think it should've been 'Save'. I've now lost the Amanero connection altogether. I find this all too much - need someone to 'remote desktop' it, for any results this century!

 

I have done the putty - SSH thing a few times, but with help. Pretty sure it's not going to work here, but thanks for your help, guys.

 

I've asked Agent Kith for help. 

Share this post


Link to post
Share on other sites
5 minutes ago, BioBrian said:

(All solved, bless him).

Whatcha do?

 

Share this post


Link to post
Share on other sites


FYI; I used the isolate CPU core feature in SO and it currently doesn’t work properly; I get an error saying there is no activity occuring in the isolated core. I don’t know if this is for everything, I used JRMC 23.

 

He said he’s going to fix it in the next release.

Edited by realysm42

Share this post


Link to post
Share on other sites
3 hours ago, realysm42 said:

FYI; I used the isolate CPU core feature in SO and it currently doesn’t work properly; I get an error saying there is no activity occuring in the isolated core. I don’t know if this is for everything, I used JRMC 23.

 

He said he’s going to fix it in the next release.

Can you ssh in?

Share this post


Link to post
Share on other sites

When activating CPUset in Snakeoil, if you get the error message say no processes running in user, firstly refresh the page and they might appear. That said, I also get zero processes for Roon Bridge but one for Roon Server. Don't have JRiver to test. Works fine for LMS/Squeezelite and as I recall also for MPD.

Share this post


Link to post
Share on other sites
4 hours ago, rmpfyf said:

Can you ssh in?

@rmpfyf you seem willing to teach us some ssh commands. I'm keen 😀.

 

I'm comfortable sending ssh commands to my Snakeoil server from my Mac via Terminal but don't know many useful commands and I'm a linux novice; at best.

 

I can display TOP and get it to show last used cpu core but wouldn't know how to assign a process to a CPU core.

 

Better still, I would like to try turning some USB hubs/ports off but not sure it is possible with the USB hubs used in my mobo. In fact none of the mobos I've tried had any BIOS setting to turn off USB and Snakeoil doesn't seem to identify them as...hmmm...switchoffable.

 

Cheers,

JD

Share this post


Link to post
Share on other sites


4 minutes ago, JDWest said:

@rmpfyf you seem willing to teach us some ssh commands. I'm keen 😀.

 

I'm comfortable sending ssh commands to my Snakeoil server from my Mac via Terminal but don't know many useful commands and I'm a linux novice; at best.

 

I can display TOP and get it to show last used cpu core but wouldn't know how to assign a process to a CPU core.

 

Better still, I would like to try turning some USB hubs/ports off but not sure it is possible with the USB hubs used in my mobo. In fact none of the mobos I've tried had any BIOS setting to turn off USB and Snakeoil doesn't seem to identify them as...hmmm...switchoffable.

 

Cheers,

JD

I'm keen too. Just need to get my ca server back..

Share this post


Link to post
Share on other sites
On 28/08/2018 at 5:51 PM, rmpfyf said:

Whatcha do?

The old reboot everything at once trick. Maybe foldling the  new power cable too, or thinking about doing a tip run. Linuxlehead!

Share this post


Link to post
Share on other sites

ssh in and let's see what we've got for a CPU; type in lscpu and hit enter. Copy out what you get. Same for lsusb.

 

Then let's see the bootloader config, type in cat /etc/default/grub and hit enter. Copy out what you get here, if it's too long just copy out the line starting with GRUB_CMDLINE_LINUX_DEFAULT

 

Let's check what your timer resolutions are at - copy out the responses from cat /proc/sys/dev/hpet/max-user-freq and cat /sys/class/rtc/rtc0/max_user_freq

 

Let's check to see how the 'power down USB ports' bit is implemented, run sudo find / -type f -name "uhubctl" (this might take a while). Note if it has any positive responses, you'll might get the odd 'permission denied' type statements here and there, and you'll probably need your admin password for that. 

 

Worth seeing how often your PC is updating it's virtual memory stats too if configured, so cat /proc/sys/vm/stat_interval and note the number.

 

Finally let's see what interrupt usage is like; start playing music then run the following:

 

cat /proc/interrupts > Snap1.txt

Wait 30 seconds

cat /proc/interrupts > Snap2.txt

diff Snap1.txt Snap2.txt

 

Copy the output of that. 

 

Right, up to now we're just taking a look at what's what, not making any changes. 

 

I'd caution to expect more of a journey here. Snakeoil is an excellent package (so excellent I'm surprised it's free - there's a ton of work gone into it). Nor is this list by any means definitive around what's possible in this space.

 

I would start journey-ing here. 

Edited by rmpfyf

Share this post


Link to post
Share on other sites
20 hours ago, rmpfyf said:

Can you ssh in?

Yes I can; I use Putty. Thanks for the info I’ll have a look tonight and report back.

 

Top man.

 

To your point about it being free; I stress people can donate and they should!

 

One person made this program for us to enjoy, he’s responsive, takes the time to look after the users and he asks nothing for it - it doesn’t mean we shouldn’t give.

Edited by realysm42

Share this post


Link to post
Share on other sites
2 hours ago, realysm42 said:

One person made this program for us to enjoy, he’s responsive, takes the time to look after the users and he asks nothing for it - it doesn’t mean we shouldn’t give.

Very true, and a good suggestion.

Share this post


Link to post
Share on other sites

Ok had a quick chance to try the above

 

I am still using a usb stick to run the operating system. I have an ssd but havent done it yet.

Have included snakeoil settings at the bottom.

Keen to see what you make of all this

 

 

so@so-desktop:~$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 54
Model name:            Intel(R) Atom(TM) CPU N2800   @ 1.86GHz
Stepping:              1
CPU MHz:               1862.104
BogoMIPS:              3724.20
L1d cache:             24K
L1i cache:             32K
L2 cache:              512K
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm arat dtherm
so@so-desktop:~$

 

so@so-desktop:~$ lsusb
Bus 002 Device 003: ID 20b1:2023 XMOS Ltd
Bus 002 Device 002: ID 0424:2412 Standard Microsystems Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 0781:5597 SanDisk Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 045e:0745 Microsoft Corp. Nano Transceiver v1.0 for Bluetooth
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 

so@so-desktop:~$ cat /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="text clocksource=hpet 3 biosdevname=0 net.ifnames=0"
GRUB_CMDLINE_LINUX="text"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
GRUB_INIT_TUNE="480 440 1"
 

so@so-desktop:~$  cat /proc/sys/dev/hpet/max-user-freq
64

 

so@so-desktop:~$ cat /sys/class/rtc/rtc0/max_user_freq
64

 

so@so-desktop:~$ sudo find / -type f -name "uhubctl"
[sudo] password for so:
/usr/local/bin/uhubctl

 

so@so-desktop:~$ cat /proc/sys/vm/stat_interval
1

 

so@so-desktop:~$ diff Snap1.txt Snap2.txt
9c9
<  17:        155    3454727   IO-APIC  17-fasteoi   ehci_hcd:usb2, ohci_hcd:usb                               3
---
>  17:        155    3562641   IO-APIC  17-fasteoi   ehci_hcd:usb2, ohci_hcd:usb                               3
11,12c11,12
<  23:       8313      31228   IO-APIC  23-fasteoi   ehci_hcd:usb1, uhci_hcd:usb                               4
<  24:         49     397723   PCI-MSI 1048576-edge      eth0
---
>  23:       8313      31277   IO-APIC  23-fasteoi   ehci_hcd:usb1, uhci_hcd:usb                               4
>  24:         49     409826   PCI-MSI 1048576-edge      eth0
14c14
< LOC:     214164     207368   Local timer interrupts
---
> LOC:     219827     212896   Local timer interrupts
19c19
< RES:      27803      20539   Rescheduling interrupts
---
> RES:      27839      20539   Rescheduling interrupts
 

image.thumb.png.897846b53a3bf6d36335b3a67ad3e9f7.png

 

 

image.thumb.png.1d02b30a68c84c102de042106d60ed87.png


 

Share this post


Link to post
Share on other sites

Open the Snakeoil tab in your browser again and force reload the page. That should tidy up the text.

On Mac:  Command + Shift + R

On PC (not sure) Ctrl + Shift + R  or  Ctrl + F5

Share this post


Link to post
Share on other sites

As my setup consists of 2 computers 1 running the "server" part of Roon and the other is the "idealish" running roon bridge  ("renderer"?) conneted via the network. I know there has been discussions regarding second subnet to isolate the connection and also there is a suggestion of connecting the 2 directly via a network cable with the server computer having 2 ethernet ports. which is better?

 

Also I wonder about where is the best place to put the hard drive with the music. If I have it on the renderer doesnt it have to go back to the server? or am I just not understanding how it works.

Share this post


Link to post
Share on other sites

@frednork

 

If I read correctly:

  • You run an Atom with very little cache. A core CPU can improve SQ a lot by virtue of the cache alone.
  • You could lock the CPU down a good bit yet by way of clock speeds and C-states
  • Your grub configuration is set to boot with the High Precision Even Timer (HPET) as your PC clocksource, though snakeoil changes this to the ACPI clocksource. 
  • HPET and TSC clocksource frequency is set low, if you can set this higher things should sound better. 
  • Is there a USB card of sorts in there connected to a DAC with an XMOS interface?
  • Why have a mouse/keyboard on the rendering PC? 
  • You've a few USB devices
  • Your PC is updating VM stats every second. Way too often, causes jitter.
  • uhubctl is installed and can be used to work out what you can and can't shut down for USB, assuming your USB interfaces are supported by uhubctl.
  • Looks like your audio USB interrupts are consigning themselves to one CPU core, which is good, but so are your other USB devices and Ethernet port.

With only two cores there's not a lot you can do about running separate processes on different cores. I'm one for big cache, low speed, at least 4 cores, low voltage parts. 

 

What I would do - which you are free to follow completely at your own risk; 

 

Lock down that CPU

If your BIOS allows it, limit it to minimum speed (prolly 800MHz) only. You can confirm success with lscpu at any time. If it allows C-states no less than C3, do that too. You are welcome to try a C0-only C-state, Atoms are low enough power for it to possibly work. 

 

Change the grub command line

First make a backup, i.e. sudo cp /etc/default/grub /etc/default/grub.backup

Then edit it - sudo nano /etc/default/grub - if there's no nano install, do so with sudo apt-get install nano

Change GRUB_CMDLINE_LINUX_DEFAULT="text clocksource=hpet 3 biosdevname=0 net.ifnames=0"

To GRUB_CMDLINE_LINUX_DEFAULT="text 3 biosdevname=0 net.ifnames=0 isolcpus=1 processor.max.cstate=3 nosoftlockup"

Write that, exit nano, then make it effective with sudo update-grub. This will do the following:

  • Run as much as possible on CPU 0, leaving CPU 1 'isolated' for things you explicitly want to run on it - with only two limited-performance cores this may be a negative effect, but worth a try, and you can always change back
  • Make your PC a little more unstable by not checking to see if a CPU is hung
  • Limit C-states to 3 (not really sure this makes much of a difference on an Atom)
  • Stop the PC booting with the HPET timer set

If you're unsure you can try one at a time and listen critically. "processor.max.cstate=0" would limit C-states altogether (the CPU would never shut down any part of itself, which cuts latency a lot, which decreases jitter a lot). 

 

Up the clocksource frequencies

echo "8192" | sudo tee --append /proc/sys/dev/hpet/max-user-freq
echo "4095" | sudo tee --append /sys/class/rtc/rtc0/max_user_freq

 

The numbers in quotations are what works for me, being the maximum I can input there. Maximums depend on hardware, yours may vary. You'll be able to verify these with commands in my last post, and you can do this whilst music is playing and hear the result (you'll need a high-fidelity rig). 

 

Switch the clocksource

Try echo "tsc" | sudo tee --append /sys/devices/system/clocksource/clocksource0/current_clocksource. You can change that with hpet or acpi_pm, again whilst music is playing, though you will need to set higher resolutions first. (I'm sure you can do both in Snakeoil, though verify from the command line that it works). tsc is about as low-latency as it gets but latency isn't the only thing going. 

 

Drop the VM updating

sudo sysctl -w vm.stat_interval=3600 should shut it up. 

 

Pin the USB audio interrupt to your spare CPU

Assuming it's IRQ 17 your audio interface sits on, it'd be echo "1" | sudo tee --append /proc/irq/17/smp_affinity_list. If you've nailed it and your rig is jitter-sensitive and of sufficient fidelity you should hear an audible difference on executing that command, do it whilst you play music. 

 

Limit what your USB has to do

Pull out the Microsoft interface and access it over web interface (also - a Bluetooth radio next to an audio PC is no good). Then yes, move to the SSD (powered externally) to run your OS. 

 

Power down USB not in use

It'd be sudo uhubctl that'll show you a list of your ports and what's powered. The hubs will be listed as 1-1, 2-1, etc, with their ports as 1, 2, 3, 4... and so on. To try to power things down you'll run something like (e.g. to power down ports 1, 2 and 4 on hub 1-1 you'd type):


sudo uhubctl -a 0 -p 124 -l 1-1

Repeat for as many hubs and ports as you have. If it can't find the file, try sudo /usr/local/bin/uhubctl -a 0 -p 124 -l 1-1

 

Ideally you would try to move the music player to a spare CPU core, though I have the player and the USB interrupt on separate cores. It's difficult to do this with two cores only. 

 

If you like any of these changes it's possible to write them up into a nice little script your PC runs whenever it boots (the grub changes are persistent, though). 

 

BTW on Ethernet you'd run a separate subnet (can be point-to-point or through a router) with as high an MTU as your network can manage. Between two PCs you can probably get jumbo frames (MTU >= 9000) with ease - just means less packets, which means less interrupt requests, which means Ethernet distracts your CPU less, which means less jitter. Again, think you can set this in SnakeOil (like a lot here) though I would always suggest validating your intended changes stuck from the terminal. If you wanted to be super trick you'd isolate these by running a fibre connection linking two PCs (with s/h parts it's probably cheaper than isolators, and better). 

 

My 2c, hope others chip in. 

Edited by rmpfyf

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...