/srv/irclogs.ubuntu.com/2023/11/03/#ubuntustudio.txt

StudioUser92Eickmeyer Hello again. The system has been running for a week now, and patchance shows 8 xruns18:13
StudioUser92https://imgur.com/a/DDUjh0918:13
StudioUser92I opened another application just now and it jumped to 1018:14
StudioUser92but CPU usage is quite low at around 16%18:15
StudioUser92Is there something that can be done to make it 0?18:16
StudioUser92What I mean is... does anyone have some tips on what to look at or adjust to perhaps improve the system?18:18
StudioUser92besides increasing the buffer that is...18:20
OvenWerksStudioUser92: 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:22
OvenWerksWhat kind of sound device? what buffer size are you using now, etc.18:23
StudioUser92Hi... sorry. I've been having a conversation with Eickmeyer, and yes, I should explain better.18:23
StudioUser92I'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:24
OvenWerksSo this is a desktop/rackmount system?18:25
StudioUser92On the Windows it's currently set at 720/192000. But normally it should be possible to run at 256/19200018:25
OvenWerks192000? are you going direct RF out?18:26
StudioUser92So that's what I'm trying to see if Ubuntu Studio can be more stable and handle the broadcasting18:26
StudioUser92rackmount18:26
StudioUser92It's required for FM broadcasting... else it is very bad quality. This is normal for FM broadcasting.18:27
OvenWerksIf you are doing audio out 48k is as much as you need, if you are doing internal FM generation you need higher.18:28
StudioUser92I'm using a Focusrite Scarlett 4i4 that receives the broadcast from the studio console and sends it back to be transmitted via FM18:28
OvenWerksso the Scarlet is USB? you you have a USB card just for the audio?18:29
StudioUser92I'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 bad18:29
StudioUser92I use the built-in usb of the motherboard18:30
StudioUser92Supermicro X12 with Intel Xeon18:30
OvenWerksstart with a PCIe USB card just for the audio.18:30
StudioUser92What's the difference?18:30
OvenWerksIf you use on card USB the irq will be shared with all other USB ports including keyboard and mouse.18:31
OvenWerkssorry if you use onboard...18:31
StudioUser92ohh IC.. .so moving the mouse or typing might affect it18:31
OvenWerksIf you have a PCIe card the irq can be separate.18:31
OvenWerksyes moving the mouse can create xruns.18:32
OvenWerksYou will also want to turn any automated updates off18:32
OvenWerksSW updates should be done when "off air"18:32
OvenWerksPCs are designed to be "low latency" however, when you look at what companies like Intel mean by "low latency" them mean 30ms ...18:34
OvenWerksreal low latency for live work is closer to 5ms18:34
StudioUser92will switching the audio settings to Pro Audio have any effect?18:35
OvenWerksThe absolute minimum for any USB device is realistically 2ms and probably cloder to 3ms.18:35
OvenWerkswhich audio settings?18:36
OvenWerksI expect you will already be using a jack server from your remarks.18:38
StudioUser92I'm using the default system18:40
StudioUser92Ubuntu Studio 23.1018:40
OvenWerksThat 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:42
OvenWerksSo it would depend on which broadcasting sw you are using.18:43
StudioUser92In 23.10, you can go to sound settings and each device you have an option to choose Pro Audio18:43
OvenWerksThat pro audio... all that does is switch the device from fl,fr, to input 1, 2, 3 etc.18:44
StudioUser92https://imgur.com/a/58fDiM318:44
StudioUser92I see18:45
OvenWerksit does not change the audio processing except for things like 4 channels and up. 18:45
OvenWerksMost 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 pair18:46
OvenWerksIt is more a labeling thing.18:46
StudioUser92Got it18:47
OvenWerksSetting 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:48
OvenWerksSome things to look for:18:50
OvenWerksCPU 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 off18:51
OvenWerksThe audio device you are using should use it's own irq, That irq driver should have it's priority elevated above other irqs18:52
StudioUser92This is great. I'm gonna do some research18:54
StudioUser92I just pulled the motherboard diagram to see how USB is setup18:55
OvenWerksAudio 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:55
StudioUser92https://imgur.com/a/58fDiM318:56
OvenWerksA lot of the USB routing on MB that are within about 10 years old is done by sw.18:56
OvenWerksI 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
OvenWerksOh, that reminds me. using two threads per core used to cause xruns.18:59
OvenWerksI think (but am not sure) the kernel handles that a bit better now.19:00
OvenWerksAs my machine is single thread percore already, I can't test 2 threads per core19:01
OvenWerksSo turning hyperthreading off (if you can) _may_ help.19:01
OvenWerksThe new high speed/lowspeed cpu are not something I have fiddled with personally.19:02
sakrecoerhello! Just installed 23.04 and excited to see how firewire works with pipewir OTB!19:04
sakrecoerno!19:04
sakrecoeri meant 23.1019:04
OvenWerksI 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
OvenWerkssakrecoer: at what latency?19:05
sakrecoerlet's find out!19:05
sakrecoeri also run pci ice1712 based card19:05
OvenWerkssakrecoer: I mean, is it using the alsa FW stack or does it allow using ffado?19:05
sakrecoerno wait..19:06
sakrecoermy firewire card is pcieSOMFIN19:06
sakrecoeri used to run with ffado... but i see no ubuntusutdio controls19:06
OvenWerksThe alsa fw stack has worked on and off for me at higher latencies for years but has been pretty solid since before 22.0419:07
sakrecoerah.. i've never managed to run without ffado tbh...19:07
OvenWerksYeah controls is back burner in my life right now and does not work right with pipewire.19:07
sakrecoeroh... does pipewire work with anything else than youtube?19:08
OvenWerksThere are rumours pipewire will support ffado at some point19:08
OvenWerkspipewire supports a jack graph19:09
sakrecoeryou mean the pretty UI thing?19:09
OvenWerkspipewire is supposed to be a drop in for pulse and jackd19:09
sakrecoer<insert xkcd about standard> :D19:10
OvenWerksI mean a jackd client like Ardour will see pw as if it was jackd.19:10
sakrecoeri love the promise of pipewire, but i haven't been able to use it for anything else than playback yet19:10
OvenWerkspatchage qjackctl etc will se all the devices in their graph19:10
OvenWerksIt has worked for me for about a year anyway19:11
sakrecoerok... well.. let's see how it goes anyways19:11
sakrecoerin april i did this: https://ubuntustudio.org/switching-audio-setup/19:11
sakrecoerthat was fine...19:11
OvenWerksPW 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
sakrecoerwhat's wrong with jack anyways?19:14
sakrecoer:D19:14
OvenWerksBasically 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/219:16
sakrecoerwihu!! beautiful at 102419:16
sakrecoermoving down to 256 buffer...19:17
sakrecoersound is good, but absolutely nothing happend to the MAD latency19:18
OvenWerksHow did you try to switch latency?19:18
sakrecoerstill an improvement over shitty sound + mad latency19:18
sakrecoerPatchance thing?19:18
OvenWerksThat would not work19:18
sakrecoerhalved the buffer19:18
sakrecoerOvenWerks: how would the right way be?19:19
OvenWerksYou need to do a pw call to set the bauffer size now.19:19
sakrecoera cli command?19:19
OvenWerksit is a pw-* command19:20
OvenWerkspw-cli? maybe19:20
sakrecoer<XKCD> hahhaha19:20
sakrecoeroh bwoy... i mean i don't mind learning things...19:20
OvenWerksYeah... there are some config files too.19:21
sakrecoerbut ehm... what was wrong with jack again?19:21
sakrecoer(sorry)19:21
OvenWerksThe desktop community did not pick up on it and went for PA19:21
OvenWerksEven though writing sw for jack is easier  :P19:22
sakrecoerqjackctl is brilliant! just ugly :D19:22
sakrecoeroh and there is this amazing thing called Ubuntu-studio too! At some point i stopped using qjackctl because it was soooo good19:23
OvenWerksugly... you mean like a tesla?19:23
sakrecoerit had a button to open carla. absolute magic, very unix mindset!19:23
OvenWerksthge problem is that it is close to a complete rewrite at this point19:24
sakrecoer(v_v) i feel you. It was beautiful while it lasted though19:24
OvenWerksIt 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 out19:25
sakrecoerat some point i will find how to set the buffer in pw...19:27
sakrecoerbut a little sad that this implies such a major set back for me19:27
sakrecoer1024 with jack and ffado was totally cool latency19:27
sakrecoerwith pw it's not workable... i have close to a second19:28
sakrecoermaybe 500ms but that's essentially the same19:28
OvenWerksby the time I get to 20ms I can't keep time any more19:28
sakrecoerye19:29
sakrecoeri can get used to 20ms19:29
sakrecoeri don't think my guitarist would...19:29
OvenWerksthat 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:29
sakrecoer(i wouldn't want them to get used to it, imagine stepping on stage after that :D)19:30
OvenWerkskeyboards seem to be easier19:30
sakrecoeri don't know what number is good... but i like it when i don't have to mind it19:30
OvenWerksIf you have to mind it, it is interfering with creating19:31
sakrecoergosh... has anyone written anywhere how to change pw buffer?19:31
sakrecoersearch engines are going bananas? or maybe i'm getting old... probably both19:31
sakrecoerthis can't be it?19:32
sakrecoerhttps://www.reddit.com/r/pipewire/comments/riw1bc/comment/hp0xpsm/19:32
sakrecoeroh .. there's a command there too19:33
* sakrecoer is defo getting old19:33
OvenWerksThere is a whole pw manual19:33
OvenWerks https://docs.pipewire.org/19:34
sakrecoerthat had near 0 effect on latency19:34
sakrecoeri halved it!!!19:34
sakrecoerthing says "clock.force-quantum"... :D19:35
OvenWerkshttps://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JACK#nodelatency19:35
OvenWerksYeah, that19:35
sakrecoerpatchance doesn't seem to care about the frequency set in that command19:36
sakrecoer256/9600 only changed the buffer19:37
sakrecoer(thanks for link OvenWerks)19:37
sakrecoerye... well...19:39
sakrecoeri guess i will have to fetch my portastudio19:39
sakrecoeri'm at 64 and and the latency is not cool19:40
sakrecoersound is ok... let's try 16 :D19:40
OvenWerksI found, testing with the alsa fw stack, that with jackd I could not even start jackd with less than 256ish19:40
sakrecoer16 is still totally off...19:41
sakrecoeri don't think i am using jack...19:41
OvenWerks16 is ok ffado19:41
sakrecoercan i do that ?19:41
sakrecoerbuffer set at 16 works! sound is good. But latency is through the roof19:42
OvenWerksI don't know for sure with 32.10. I have it on my laptop but I don't do audio there19:42
OvenWerkssakrecoer: there is another setting that adds latency by default, I can't remember which one though19:43
sakrecoeri have not been able to change the framrate19:43
sakrecoeror whatever it is called... 48000Hz thing19:43
sakrecoermaybe for that i need to change the config file and systemd it?19:44
OvenWerksI hadn't get that far19:44
sakrecoerthis works: pw-metadata -n settings 0 clock.force-rate 9600019:45
sakrecoerat sixteen it's Xrun paradise19:46
sakrecoerbut ok latency19:46
sakrecoerat 128 sound is ok, but latency hell19:46
sakrecoerborder line...19:46
sakrecoeri could work with this. alone. my singers will get mad at me19:47
sakrecoerlet's see what the ubuntu studio installer has in store for me :)19:48
OvenWerksI don't have to worry about that... I am playing mandolin these days... no amp, mic, pickup because I am load enough without.19:48
sakrecoeri'm still pushing my way through the xaphoon. but i like to record my shit...19:49
sakrecoerubuntu studio installer hung on 100% package refresh 19:50
sakrecoeroh no, it was just waiting for me to acknowledge19:50
sakrecoeroh... but i can no longer zap pw in favour of the faithfull jack/ffado/ubuntustudio winning recepy 19:51
sakrecoeri guess i am officially no longer part of the target audience.... (v_v)19:51
sakrecoerno more backports either?19:54
sakrecoerthat was nice, but i imagine it's a lot of work...19:54
sakrecoerwell... 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!19:56
OvenWerksStudioUser92: 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:20
OvenWerksI suppose this makes for a simpler system but does require more in the way of system resources.20:21

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!