Ryzen 7000 Testing

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
With PCI issues resolved, now seems like a good time to reopen the audio discussion.

Let's consider various strategies for tackling this problem before we embark on any particular strategy.

If we agree that obtaining correct FSB and TSC frequencies is the key, then the first few questions are:
  • Should we discount or ignore the frequencies reported by sysctl -a | grep tsc and sysctl -a | grep freq ?
  • Should we discount or ignore the frequencies reported in OpenCore boot log?
  • If we cannot trust the values from both sysctl and OpenCore, how can we still get reliable or usable values from the OS?
  • What parameters would we need to obtain from the OS that will allow us to calculate TSC and FSB frequencies?
The values in sysctl and OpenCore are automatically calculated by OpenCore when booting AFAIK, and setting them manually shouldn't fix anything. IF it's actually related to the TSC or FSB, we need to find a reliable way to calculate it from outside OpenCore and set it manually in the config.plist.
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Could you record a sample coming from the internal audio with and without Speedkeeper?
Sure -- here are two samples from FireFox of the same performance.
 

Attachments

  • Audio Sample with SpeedKeeper.m4a.zip
    213.5 KB · Views: 10
  • Audio Sample without SpeedKeeper.m4a.zip
    138.9 KB · Views: 7

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Sure -- here are two samples from FireFox of the same performance.
If the audio is almost perfect with Speedkeeper, is it still worth it to try fixing it fully?
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
If the audio is almost perfect with Speedkeeper, is it still worth it to try fixing it fully?
There are other subtle issues. Here's one I noticed last night because Night Shift mode is turned on from Sunset to Sunrise:
  • At sunset, the monitor switched to night mode
  • A few minutes later it switched out of night mode
  • Several minutes later (10+ I think) it switched back to night mode
From the SpeedKeeper README on GitHub:
Well, the issue seems to be a relation of clock speed of the CPU and the clock of the OS. When the processor is not busy enough, the clock speed drops, and that makes the OS de-sync with the CPU, sound is very much dependent on timing, and even the clock in the status bar knows to lag behind.

The night shift quirk seems to be one manifestation of this. Admittedly, SpeedKeeper should be able to reduce the incidence of all such issues.

Taking a quick early look at the code, it seems the key is to query MSR 0x64 to obtain P-State information. Maybe we can modify OpenCore to do this? Maybe @Shaneee's experimental version of OpenCore.efi was already attempting something like this?

Another option is to check the Linux source code to see how it calculates TSC and FSB, assuming it does.

Screenshot 2022-11-15 at 12.01.09 PM.png
 
Last edited:

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
There are other subtle issues. Here's one I noticed last night because Night Shift mode is turned on from Sunset to Sunrise:
  • At sunset, the monitor switched to night mode
  • A few minutes later it switched out of night mode
  • Several minutes later (10+ I think) it switched back to night mode
From the SpeedKeeper README on GitHub:


The night shift quirk seems to be one manifestation of this. Admittedly, SpeedKeeper should be able to reduce the incidence of all such issues.

Taking a quick early look at the code, it seems the key is to query MSR 0x64 to obtain P-State information. Maybe we can modify OpenCore to do this? Maybe @Shaneee's experimental version of OpenCore.efi was already attempting something like this?

Another option is to check the Linux source code to see how it calculates TSC and FSB, assuming it does.

View attachment 8321
rdmsr64 reads a 64-bit MSR value, not the 0x64 MSR. I'm assuming that the second one is for APUs, as the first code gets the values from OpenCore.

Maybe we could try setting TSC to somewhere around the base and turbo clock of the CPU?
 

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,186

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
This seems more like an OpenCore related problem, maybe now is the time to make an issue on their bugtracker.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
I found this, not sure how it'd solve the problem but maybe you could give it a try. @CaseySJ

 

hvv_

Member
AMD OS X Member
Joined
Sep 8, 2022
Messages
30
First of all, thank you for all the hard work! @CaseySJ @ExtremeXT @Shaneee I am really impressed! So I just built my AM5 pc with motherboard the ASUS Prime X670E Pro and Ryzen 7950x and also installed MacOS Ventura directly with it. My Audio is perfect because I use an external DAC.

The only thing that does not work yet is my ASUS XG-C100C it has an Aquantia AQC-107 would it be possible to find solutions for this. This would be really amazing.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
First of all, thank you for all the hard work! @CaseySJ @ExtremeXT @Shaneee I am really impressed! So I just built my AM5 pc with motherboard the ASUS Prime X670E Pro and Ryzen 7950x and also installed MacOS Ventura directly with it. My Audio is perfect because I use an external DAC.

The only thing that does not work yet is my ASUS XG-C100C it has an Aquantia AQC-107 would it be possible to find solutions for this. This would be really amazing.
So the audio is fully working without Speedkeeper with an USB DAC?
 

hvv_

Member
AMD OS X Member
Joined
Sep 8, 2022
Messages
30
So the audio is fully working without Speedkeeper with an USB DAC?
Yes, I was really surprised. i haven't tested the built-in audio ports yet i will try this right away
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
First of all, thank you for all the hard work! @CaseySJ @ExtremeXT @Shaneee I am really impressed! So I just built my AM5 pc with motherboard the ASUS Prime X670E Pro and Ryzen 7950x and also installed MacOS Ventura directly with it. My Audio is perfect because I use an external DAC.

The only thing that does not work yet is my ASUS XG-C100C it has an Aquantia AQC-107 would it be possible to find solutions for this. This would be really amazing.
I haven’t had a chance yet to install my Gigabyte GC-AQC113C so please post your IOReg file from IORegistryExplprer —> File —> Save As… This may be a tough problem.
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Yes, I was really surprised. i haven't tested the built-in audio ports yet i will try this right away
We’re all ears! Bad pun, sorry :)
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
@CaseySJ
Could you send an image of the CPU tab in CPU-Z and a hardware report from HWiNFO64 from Windows? Make sure to boot without OpenCore.
 

hvv_

Member
AMD OS X Member
Joined
Sep 8, 2022
Messages
30
I haven’t had a chance yet to install my Gigabyte GC-AQC113C so please post your IOReg file from IORegistryExplprer —> File —> Save As… This may be a tough problem.
Umm I can't give the IOReg right now because my ASUS XG-C100C is in my office. and I'm home.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
The Asus Prime X670E does not have USB audio... it probably works perfectly??

View attachment 8325
I helped an user with ALC897 codec but they still had the issue without Speedkeeper... I'll do more research about it...
 

hvv_

Member
AMD OS X Member
Joined
Sep 8, 2022
Messages
30
Umm just tested my built-in dac and my audio is bad with lots of static clicks without Speedkeeper.

But if I may ask is there a difference between an external dac on a USB port and a built-in dac over the USB protocol?
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Umm just tested my built-in dac and my audio is bad with lots of static clicks without Speedkeeper.

But if I may ask is there a difference between an external dac on a USB port and a built-in dac over the USB protocol?
You mean the internal USB audio? The difference is that your external DAC uses its own timer instead of the CPU's which is not synced to the OS'.

@CaseySJ Could you try adding these kernel patches? They're from the older separate patches (17h/19h). Try them on Monterey as I don't think they will work on Ventura as well. Try with all 3, and if there is no change try with only the first 2.
 

Attachments

  • TSC_PATCHES.plist
    2.4 KB · Views: 4

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
...

@CaseySJ Could you try adding these kernel patches? They're from the older separate patches (17h/19h). Try them on Monterey as I don't think they will work on Ventura as well. Try with all 3, and if there is no change try with only the first 2.
Just tried these patches with Monterey because MaxKernel is 21.99.99. Alas, static is about the same.

Let me grab HWINFO / CPUZ information from Windows next. May take an hour or two.
 
Back
Top Bottom
  AdBlock Detected
Sure, ad-blocking software does a great job at blocking ads, but it also blocks some useful and important features of our website. For the best possible site experience please take a moment to disable your AdBlocker.