Having difficulty setting up computer for audio

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
Spanner
Established Member
Posts: 76
Joined: Mon Mar 10, 2014 8:18 pm
Been thanked: 2 times

Having difficulty setting up computer for audio

Post by Spanner »

Greetings.

I am having difficulty setting up my machine for audio.

I recently upgraded from ubuntu 14.04 LTS to kubunto 18.04.5 LTS, using a fresh install from scratch.

I having some trouble setting the machine up for audio.

I am not getting any xruns at all.

While recording (anything), I am seeing regular periodioc dropouts as follows:

This is a recording of a 1kHz test tone made using audacity, exported and played by VLC, then recorded in audacity:

[See Attachment] download/file.php?mode=view&id=2419&sid ... 593c1c70fb

During the course of trying to set this machine up,

I installed the liquorix kernel:

Code: Select all


uname -a
... 5.8.0-10.1-liquorix-amd64 #1 ZEN SMP PREEMPT liquorix 5.8-8ubuntu1~bionic (2020-09-17) x86_64 x86_64 x86_64 GNU/Linux

I made all* of the tweaks suggested by raboof (https://github.com/raboof/realtimeconfigquickscan)

*EXCEPT I am stuck now at trying to set performance for the cpu cores' govenor

Code: Select all


$ ./realTimeConfigQuickScan.pl           
== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 5.8.0 kernel - good
(relatime is default since 2.6.30)
cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor: No such file or directory
Checking CPU Governors... CPU 0: '' CPU 1: '' CPU 2: '' CPU 3: ''  - not good
Set CPU Governors to 'performance' with 'cpupower frequency-set -g performance' or 'cpufreq-set -c <cpunr> -g performance' (Debian/Ubuntu)
See also: http://linuxmusicians.com/viewtopic.php?f=27&t=844
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... >= 524288 - good
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
Checking the ability to prioritize processes with chrt... yes - good
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without 'threadirqs' parameter or real-time capabilities found
For more information, see https://wiki.linuxaudio.org/wiki/system_configuration#do_i_really_need_a_real-time_kernel
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
== Other checks ==
Checking filesystem types... ok.
** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
   Find your sound card's IRQ by looking at '/proc/interrupts' and lspci.

When I try to set with 'cpufreq-set -c <cpunr> -g performance' as raboof suggested I get:

Code: Select all


$ sudo cpufreq-set -c 0 -g performance
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?

Does anyone have any suggestions as to where I should best begin to figure out how to resolve this issue?

Thanks for any ideas...



Notes:
This machine and its hardware were working flawlessly for audio back on 14.04 LTS so I think I should be able to make it work
I am thinking maybe I should go back to the lowlatency kernel and begin again
I may not have all of the associated software for the Liquorix kernal but I don't know where to begin to look
There may be something I need to do in BIOS but I don't think so since it worked in 14.04 LTS
I am not sure where the definitions of the govenors live, I looked where I thought they should be but didn't see them
Attachments
Screenshot_20200919_212606.png
Screenshot_20200919_212606.png (88.6 KiB) Viewed 1926 times
User avatar
TAERSH
Established Member
Posts: 455
Joined: Mon Feb 03, 2020 6:48 pm
Has thanked: 27 times
Been thanked: 21 times

Re: Having difficulty setting up computer for audio

Post by TAERSH »

You should tell us some of the specs of your computer like e.g. CPU.
Probably the CPU can't use CPU governor as these lines telling:

Code: Select all

cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor: No such file or directory
I have an AMD Ryzen 5 2600X 6-Core-CPU wich can't use CPU governor either. Therefor I had setup all CPU cores within the BIOS to run without on demand and silent mode always at full speed.
Spanner
Established Member
Posts: 76
Joined: Mon Mar 10, 2014 8:18 pm
Been thanked: 2 times

Re: Having difficulty setting up computer for audio

Post by Spanner »

Thank you for the timely reply, TAERSH. The processor is an AMD Phenom(tm) II X4 965 Processor. It has 4 cores and clocks around 3.4 GHz. It was a high end processor.


Details:

Code: Select all

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 4
model name      : AMD Phenom(tm) II X4 965 Processor
stepping        : 3
microcode       : 0x10000c8
cpu MHz         : 3392.568
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs            : tlb_mmatch fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2
bogomips        : 6785.13
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

.
 .
  .
    <snip>
 .
 .
 .


I think maybe I am looking in the wrong direction as far as the CPU govenors are concerned.

I went back and booted into the 14.04 LTS installation and I see that I don't have the CPU govenors set there, either. I am running a lowlatence kernel there (I didn't note the version).

I tested audio in the 14.04 LTS installation, same as I did for the OP (above). There were no similar dropouts or other problems I noticed. As I said in the OP, this installation's audio was working flawlwssly.


I then went back into the 18.04 LTS installation.

At boot time, I looked around in BIOS but didn't change anything.

Then I selected the 5.3.0-53-lowlatency kernel and rebooted. Next, I retested audio in the 18.04 LTS installation. I am still having the same problem as I reported in the OP.

Code: Select all

$ uname -a
... 5.3.0-53-lowlatency #47~18.04.1-Ubuntu SMP PREEMPT Thu May 7 14:12:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
You said:
I have an AMD Ryzen 5 2600X 6-Core-CPU wich can't use CPU governor either. Therefor I had setup all CPU cores within the BIOS to run without on demand and silent mode always at full speed.
Now that I think more about this, I recall that I tweaked the BIOS settings, and I think it was along those lines. It's been years ago and the machine was working flawlessly but I had to upgrade it for other reasons.

I don't think what I am seeing could be due to a hardware issue because I didn't change anything when I did the test mentioned just above in this post.

Do you or does anyone else know of a good resource that might outline the tweaks I may further need to make in BIOS to address this issue?

I am looking on the internet as I type this and if I can figure this out I will update this thread. It might take a while.


In the mean time, does anyone else have any suggestions?


Thanks.
User avatar
TAERSH
Established Member
Posts: 455
Joined: Mon Feb 03, 2020 6:48 pm
Has thanked: 27 times
Been thanked: 21 times

Re: Having difficulty setting up computer for audio

Post by TAERSH »

I just have one suggestion!

Drop Kubuntu!

The KDE desktop is heavily resource hungry. I would try Ubuntu Studio 18.04 instead.
Ubuntu Studio should already have a real time kernel or low latency kernel and it should be also LTS as Ubuntu 18.04 is.

Or perhaps, if you can use German desktop and Operating System try my ArtStudio32 which is pretty much setup as an Audio, Graphics and Video Studio. It is a remaster of a Woof-CE build based on Ubuntu Bionic Beaver 18.04. I'm using my own Woof-CE build of Ubuntu Bionic Beaver 18.04 in 64bit, but the 32bit version is pretty much equal to my 64bit version.

ArtStudio32 Download
ArtStudio32 Forum
TygerTung
Established Member
Posts: 65
Joined: Sun Dec 22, 2019 11:12 pm
Location: Christchurch, New Zealand
Been thanked: 11 times

Re: Having difficulty setting up computer for audio

Post by TygerTung »

Are you sure that your project sample rate is running at the same sample rate as your sound card? This caused periodic dropouts for me when one was at 44.1 KHz and one was a 48 KHz.
Spanner
Established Member
Posts: 76
Joined: Mon Mar 10, 2014 8:18 pm
Been thanked: 2 times

Re: Having difficulty setting up computer for audio

Post by Spanner »

Audio interface and computer itself as well as all attendant software are both set at and running at 48kHz.

Also, note that rebooting the machine into the earlier installation with no change to physical connections results in flawless performance.

I still haven't figured this out. I'd rather not abandon kubuntu or try another distribution with this machine.

I have a backup machine I can do that with. I just don't have the time to do it at the moment.

Thanks for your help.

Any other suggestions?
User avatar
LAM
Established Member
Posts: 992
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 140 times
Been thanked: 348 times

Re: Having difficulty setting up computer for audio

Post by LAM »

1. Try booting with a stock kernel, no liquorix or lowlatency, and see if there are differences.
2. Try to record with Audacity using ALSA, not Jack.

in mix, nobody can hear your screen

User avatar
sysrqer
Established Member
Posts: 2519
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 319 times
Been thanked: 148 times
Contact:

Re: Having difficulty setting up computer for audio

Post by sysrqer »

Check if Cool & Quiet is enabled in the bios, I read that enabling that can lead to governors not being usable.

Can you post the output of

Code: Select all

systemctl list-unit-files --type=service | grep enabled
Post Reply