[18:13] <StudioUser92> Eickmeyer Hello again. The system has been running for a week now, and patchance shows 8 xruns
[18:13] <StudioUser92> https://imgur.com/a/DDUjh09
[18:14] <StudioUser92> I opened another application just now and it jumped to 10
[18:15] <StudioUser92> but CPU usage is quite low at around 16%
[18:16] <StudioUser92> Is there something that can be done to make it 0?
[18:18] <StudioUser92> What I mean is... does anyone have some tips on what to look at or adjust to perhaps improve the system?
[18:20] <StudioUser92> besides increasing the buffer that is...
[18:22] <OvenWerks> StudioUser92: 8 xruns in a week is pretty good as these things go. Generally one is looking for 0 xruns while they are recording/performing. You don't say what your setup is though.
[18:23] <OvenWerks> What kind of sound device? what buffer size are you using now, etc.
[18:23] <StudioUser92> Hi... sorry. I've been having a conversation with Eickmeyer, and yes, I should explain better.
[18:24] <StudioUser92> I'm testing out an FM broadcasting software which we have currently running in production on a Windows system. But the Windows system has the buffer set at 720, which is pretty high. But I wanted to set it up on a Linux system because of stability issues as I just mentioned.
[18:25] <OvenWerks> So this is a desktop/rackmount system?
[18:25] <StudioUser92> On the Windows it's currently set at 720/192000. But normally it should be possible to run at 256/192000
[18:26] <OvenWerks> 192000? are you going direct RF out?
[18:26] <StudioUser92> So that's what I'm trying to see if Ubuntu Studio can be more stable and handle the broadcasting
[18:26] <StudioUser92> rackmount
[18:27] <StudioUser92> It's required for FM broadcasting... else it is very bad quality. This is normal for FM broadcasting.
[18:28] <OvenWerks> If you are doing audio out 48k is as much as you need, if you are doing internal FM generation you need higher.
[18:28] <StudioUser92> I'm using a Focusrite Scarlett 4i4 that receives the broadcast from the studio console and sends it back to be transmitted via FM
[18:29] <OvenWerks> so the Scarlet is USB? you you have a USB card just for the audio?
[18:29] <StudioUser92> I'm not an audio specialist, so I can't tell you why it is 192000, but this is what is used in general, else the audio sounds very bad
[18:30] <StudioUser92> I use the built-in usb of the motherboard
[18:30] <StudioUser92> Supermicro X12 with Intel Xeon
[18:30] <OvenWerks> start with a PCIe USB card just for the audio.
[18:30] <StudioUser92> What's the difference?
[18:31] <OvenWerks> If you use on card USB the irq will be shared with all other USB ports including keyboard and mouse.
[18:31] <OvenWerks> sorry if you use onboard...
[18:31] <StudioUser92> ohh IC.. .so moving the mouse or typing might affect it
[18:31] <OvenWerks> If you have a PCIe card the irq can be separate.
[18:32] <OvenWerks> yes moving the mouse can create xruns.
[18:32] <OvenWerks> You will also want to turn any automated updates off
[18:32] <OvenWerks> SW updates should be done when "off air"
[18:34] <OvenWerks> PCs are designed to be "low latency" however, when you look at what companies like Intel mean by "low latency" them mean 30ms ...
[18:34] <OvenWerks> real low latency for live work is closer to 5ms
[18:35] <StudioUser92> will switching the audio settings to Pro Audio have any effect?
[18:35] <OvenWerks> The absolute minimum for any USB device is realistically 2ms and probably cloder to 3ms.
[18:36] <OvenWerks> which audio settings?
[18:38] <OvenWerks> I expect you will already be using a jack server from your remarks.
[18:40] <StudioUser92> I'm using the default system
[18:40] <StudioUser92> Ubuntu Studio 23.10
[18:42] <OvenWerks> That would be pipewire on top of alsa. but pipewire is albe to look like two different audio servers depending on the software accessing it.
[18:42] <OvenWerks> (my typing is really bad to day)
[18:43] <OvenWerks> So it would depend on which broadcasting sw you are using.
[18:43] <StudioUser92> In 23.10, you can go to sound settings and each device you have an option to choose Pro Audio
[18:44] <OvenWerks> That pro audio... all that does is switch the device from fl,fr, to input 1, 2, 3 etc.
[18:44] <StudioUser92> https://imgur.com/a/58fDiM3
[18:45] <StudioUser92> I see
[18:45] <OvenWerks> it does not change the audio processing except for things like 4 channels and up. 
[18:46] <OvenWerks> Most profesional audio devices are designed to be used as all mono inputs and outputs with the sw deciding which pairs to be used for a sterio pair
[18:46] <OvenWerks> It is more a labeling thing.
[18:47] <StudioUser92> Got it
[18:48] <OvenWerks> Setting up a PC for low latency audio is not trivial. There is no recipe that "just works". It is an overall system tuning that varies from system to system even if both use the same cpu.
[18:50] <OvenWerks> Some things to look for:
[18:51] <OvenWerks> CPU governor should be set to performance, Intel Boost should be turned off, Any cron task that does large data transfers via network, like Software updates should be turned off
[18:52] <OvenWerks> The audio device you are using should use it's own irq, That irq driver should have it's priority elevated above other irqs
[18:54] <StudioUser92> This is great. I'm gonna do some research
[18:55] <StudioUser92> I just pulled the motherboard diagram to see how USB is setup
[18:55] <OvenWerks> Audio SW should have the ability to freeze memory (wrong term but the right term escapes my memory just now) so that the kernel will never swap it out. (check the jackd site for some of this)
[18:56] <StudioUser92> https://imgur.com/a/58fDiM3
[18:56] <OvenWerks> A lot of the USB routing on MB that are within about 10 years old is done by sw.
[18:59] <OvenWerks> I found that no matter which USB plug I use, they all use the same irq. I was able to change a MB setting that at least split it into two by forcing an older driver to be used. But I have an older i5 with 4cores and 4 threads.
[18:59] <OvenWerks> Oh, that reminds me. using two threads per core used to cause xruns.
[19:00] <OvenWerks> I think (but am not sure) the kernel handles that a bit better now.
[19:01] <OvenWerks> As my machine is single thread percore already, I can't test 2 threads per core
[19:01] <OvenWerks> So turning hyperthreading off (if you can) _may_ help.
[19:02] <OvenWerks> The new high speed/lowspeed cpu are not something I have fiddled with personally.
[19:04] <sakrecoer> hello! Just installed 23.04 and excited to see how firewire works with pipewir OTB!
[19:04] <sakrecoer> no!
[19:04] <sakrecoer> i meant 23.10
[19:05] <OvenWerks> I do not use USB audio cards, excpet some (very) cheap usb mic/headphone dongles for testing. I use either a pci ice1712 based card or a firewire device.
[19:05] <OvenWerks> sakrecoer: at what latency?
[19:05] <sakrecoer> let's find out!
[19:05] <sakrecoer> i also run pci ice1712 based card
[19:05] <OvenWerks> sakrecoer: I mean, is it using the alsa FW stack or does it allow using ffado?
[19:06] <sakrecoer> no wait..
[19:06] <sakrecoer> my firewire card is pcieSOMFIN
[19:06] <sakrecoer> i used to run with ffado... but i see no ubuntusutdio controls
[19:07] <OvenWerks> The alsa fw stack has worked on and off for me at higher latencies for years but has been pretty solid since before 22.04
[19:07] <sakrecoer> ah.. i've never managed to run without ffado tbh...
[19:07] <OvenWerks> Yeah controls is back burner in my life right now and does not work right with pipewire.
[19:08] <sakrecoer> oh... does pipewire work with anything else than youtube?
[19:08] <OvenWerks> There are rumours pipewire will support ffado at some point
[19:09] <OvenWerks> pipewire supports a jack graph
[19:09] <sakrecoer> you mean the pretty UI thing?
[19:09] <OvenWerks> pipewire is supposed to be a drop in for pulse and jackd
[19:10] <sakrecoer> <insert xkcd about standard> :D
[19:10] <OvenWerks> I mean a jackd client like Ardour will see pw as if it was jackd.
[19:10] <sakrecoer> i love the promise of pipewire, but i haven't been able to use it for anything else than playback yet
[19:10] <OvenWerks> patchage qjackctl etc will se all the devices in their graph
[19:11] <OvenWerks> It has worked for me for about a year anyway
[19:11] <sakrecoer> ok... well.. let's see how it goes anyways
[19:11] <sakrecoer> in april i did this: https://ubuntustudio.org/switching-audio-setup/
[19:11] <sakrecoer> that was fine...
[19:14] <OvenWerks> PW has been improving steadily. I have not really worked with it for lower latencies as this machine still has the LTS... and jack  ;)
[19:14] <sakrecoer> what's wrong with jack anyways?
[19:14] <sakrecoer> :D
[19:16] <OvenWerks> Basically my audiofire 12 sounds much better than the Delta 66 and so to get low latency I need to use ffado. I can then set jackd as low as 16/2
[19:16] <sakrecoer> wihu!! beautiful at 1024
[19:17] <sakrecoer> moving down to 256 buffer...
[19:18] <sakrecoer> sound is good, but absolutely nothing happend to the MAD latency
[19:18] <OvenWerks> How did you try to switch latency?
[19:18] <sakrecoer> still an improvement over shitty sound + mad latency
[19:18] <sakrecoer> Patchance thing?
[19:18] <OvenWerks> That would not work
[19:18] <sakrecoer> halved the buffer
[19:19] <sakrecoer> OvenWerks: how would the right way be?
[19:19] <OvenWerks> You need to do a pw call to set the bauffer size now.
[19:19] <sakrecoer> a cli command?
[19:20] <OvenWerks> it is a pw-* command
[19:20] <OvenWerks> pw-cli? maybe
 hahhaha
[19:20] <sakrecoer> oh bwoy... i mean i don't mind learning things...
[19:21] <OvenWerks> Yeah... there are some config files too.
[19:21] <sakrecoer> but ehm... what was wrong with jack again?
[19:21] <sakrecoer> (sorry)
[19:21] <OvenWerks> The desktop community did not pick up on it and went for PA
[19:22] <OvenWerks> Even though writing sw for jack is easier  :P
[19:22] <sakrecoer> qjackctl is brilliant! just ugly :D
[19:23] <sakrecoer> oh and there is this amazing thing called Ubuntu-studio too! At some point i stopped using qjackctl because it was soooo good
[19:23] <OvenWerks> ugly... you mean like a tesla?
[19:23] <sakrecoer> it had a button to open carla. absolute magic, very unix mindset!
[19:24] <OvenWerks> thge problem is that it is close to a complete rewrite at this point
[19:24] <sakrecoer> (v_v) i feel you. It was beautiful while it lasted though
[19:25] <OvenWerks> It is supposed to be possible to bridge from PW to jack either to show pw ports in jack or to use jackd as the device but I have not yet figured that out
[19:27] <sakrecoer> at some point i will find how to set the buffer in pw...
[19:27] <sakrecoer> but a little sad that this implies such a major set back for me
[19:27] <sakrecoer> 1024 with jack and ffado was totally cool latency
[19:28] <sakrecoer> with pw it's not workable... i have close to a second
[19:28] <sakrecoer> maybe 500ms but that's essentially the same
[19:28] <OvenWerks> by the time I get to 20ms I can't keep time any more
[19:29] <sakrecoer> ye
[19:29] <sakrecoer> i can get used to 20ms
[19:29] <sakrecoer> i don't think my guitarist would...
[19:29] <OvenWerks> that is, if I put a really long cable on my bass and walk away from the stage, by the time I get to 20 to 30 feet away I am off.
[19:30] <sakrecoer> (i wouldn't want them to get used to it, imagine stepping on stage after that :D)
[19:30] <OvenWerks> keyboards seem to be easier
[19:30] <sakrecoer> i don't know what number is good... but i like it when i don't have to mind it
[19:31] <OvenWerks> If you have to mind it, it is interfering with creating
[19:31] <sakrecoer> gosh... has anyone written anywhere how to change pw buffer?
[19:31] <sakrecoer> search engines are going bananas? or maybe i'm getting old... probably both
[19:32] <sakrecoer> this can't be it?
[19:32] <sakrecoer> https://www.reddit.com/r/pipewire/comments/riw1bc/comment/hp0xpsm/
[19:33] <sakrecoer> oh .. there's a command there too
[19:33]  * sakrecoer is defo getting old
[19:33] <OvenWerks> There is a whole pw manual
[19:34] <OvenWerks>  https://docs.pipewire.org/
[19:34] <sakrecoer> that had near 0 effect on latency
[19:34] <sakrecoer> i halved it!!!
[19:35] <sakrecoer> thing says "clock.force-quantum"... :D
[19:35] <OvenWerks> https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JACK#nodelatency
[19:35] <OvenWerks> Yeah, that
[19:36] <sakrecoer> patchance doesn't seem to care about the frequency set in that command
[19:37] <sakrecoer> 256/9600 only changed the buffer
[19:37] <sakrecoer> (thanks for link OvenWerks)
[19:39] <sakrecoer> ye... well...
[19:39] <sakrecoer> i guess i will have to fetch my portastudio
[19:40] <sakrecoer> i'm at 64 and and the latency is not cool
[19:40] <sakrecoer> sound is ok... let's try 16 :D
[19:40] <OvenWerks> I found, testing with the alsa fw stack, that with jackd I could not even start jackd with less than 256ish
[19:41] <sakrecoer> 16 is still totally off...
[19:41] <sakrecoer> i don't think i am using jack...
[19:41] <OvenWerks> 16 is ok ffado
[19:41] <sakrecoer> can i do that ?
[19:42] <sakrecoer> buffer set at 16 works! sound is good. But latency is through the roof
[19:42] <OvenWerks> I don't know for sure with 32.10. I have it on my laptop but I don't do audio there
[19:43] <OvenWerks> sakrecoer: there is another setting that adds latency by default, I can't remember which one though
[19:43] <sakrecoer> i have not been able to change the framrate
[19:43] <sakrecoer> or whatever it is called... 48000Hz thing
[19:44] <sakrecoer> maybe for that i need to change the config file and systemd it?
[19:44] <OvenWerks> I hadn't get that far
[19:45] <sakrecoer> this works: pw-metadata -n settings 0 clock.force-rate 96000
[19:46] <sakrecoer> at sixteen it's Xrun paradise
[19:46] <sakrecoer> but ok latency
[19:46] <sakrecoer> at 128 sound is ok, but latency hell
[19:46] <sakrecoer> border line...
[19:47] <sakrecoer> i could work with this. alone. my singers will get mad at me
[19:48] <sakrecoer> let's see what the ubuntu studio installer has in store for me :)
[19:48] <OvenWerks> I don't have to worry about that... I am playing mandolin these days... no amp, mic, pickup because I am load enough without.
[19:49] <sakrecoer> i'm still pushing my way through the xaphoon. but i like to record my shit...
[19:50] <sakrecoer> ubuntu studio installer hung on 100% package refresh 
[19:50] <sakrecoer> oh no, it was just waiting for me to acknowledge
[19:51] <sakrecoer> oh... but i can no longer zap pw in favour of the faithfull jack/ffado/ubuntustudio winning recepy 
[19:51] <sakrecoer> i guess i am officially no longer part of the target audience.... (v_v)
[19:54] <sakrecoer> no more backports either?
[19:54] <sakrecoer> that was nice, but i imagine it's a lot of work...
[19:56] <sakrecoer> well... guess i'm off to fetch the AW1600 until i find some youthful distrohopping energy! Many thanks for the unbeliveable fish! I will always love you!
[20:20] <OvenWerks> StudioUser92: I am guessing your software encodes stereo as L+R, L-R subcarrier and maybe even SCA subcarrier as well. In that case 192000 makes sense. I am guessing that the same device is used for audio in and encoded audio out.
[20:21] <OvenWerks> I suppose this makes for a simpler system but does require more in the way of system resources.