AMD Ryzen 1700 and power sleep failure

I had bought all the parts for a new system at the end of 2017, and was mostly happy with it. The motherboard was an AS Rock Taichi and the CPU was an AMD Ryzen 1700. I bought the highest MHz AMD Ryzen I could get except I avoided the 220 Watts TDP; power draw on this chip is about 65 Watts TDP.

Certainly, I was thrilled with system performance, and very reasonable price. But sleep states were a problem. The system would go so deep into sleep, it would never wake up. I would have to press and hold the power switch to get it back: not good. Once in a while, the box would freeze hard too; usually while scrolling a Facebook page. So I had this sense of unease that I’d made a mistake buying the AS Rock Taichi X370 and trying to run Linux on it.

This last birthday, I bought myself a replacement motherboard: an MSI X470 Gaming Plus. I spent my birthday pulling out the Taichi motherboard and putting in the 470GP.

And my ACPI sleep problems did not go away. Rats!

I’ve taken some vacation time, and looking through the log files, I did find an error message that lead me to some vital information. The AMD Ryzen 1700 has an ACPI sleep state – C6 – which Linux doesn’t play nice with. A patch was offered to the Linux maintainers, but not accepted. I don’t know why, and I’m not sure it matters, either.

But what someone did, is make a Python script that pokes and prods the correct bits in the Ryzen 1700 to have it declare that ACPI sleep state C6 is not available / should not be used.

I haven’t had a sleep state problem with this rig since. 😀

First, I needed this: Github ZenStates. I saved this script as /home/myhomelocation/zenstates.py

Then I needed two bash scripts to run it after system startup:

/etc/init.d/after.local

which contains (and is executable):

#!/bin/sh
/etc/init.d/set_c6_acpi_state_disabled.sh

/etc/init.d/set_c6_acpi_state_disabled.sh

which contains (and is executable):

#!/bin/sh
# ScriptName=set_c6_acpi_state_disabled
/usr/bin/python /home/myhomelocation/zenstates.py --c6-disable

In theory, this could be a single script: after.local could be the script to run the Python script zenstates.py. But what if I find I want more than one script to run after system startup? This way, I just add another line to after.local

This week I talked with my brother, who found a relevant piece of information (while researching something else). Apparently AMD will give me a new CPU that doesn’t have this problem, as a warranty repair. So I guess this is AMD being honorable enough to admit they made a mistake here; that is nice. The caveat is, they cannot trust people to not fry their CPU and use this as an excuse to get a replacement under warranty. So the drill becomes: get an RMA from AMD, remove the Ryzen 1700, ship it (at my cost) to them, they test the CPU to make sure it’s not fried (is otherwise good except for the C6 power state problem), and then they ship a replacement. Total turnaround time is probably one month.

Do I want this, my main system, to be down for a month until the AMD CPU RMA SOP EOP FTW? The warranty on the CPU is three years, and I bought it two and a quarter ago.

I think I’m good, with just a software patch. I’m just happy that r4m0n found and supplied a patch.

Thank you r4m0n. 🙂

Windows "just works" versus Linux "good luck with that"

I’m trying to do some audio transcription, so that I have text to go along with the audio. Transcription is still quite the labor intensive problem, even here a few months away from 2020. Sure, I can get Amazon to do a basic transcription for very little cost (pennies more than dollars); but, the transcription isn’t very good. Part of the problem is that one of the speakers has a thick Southern accent.

Fine, whatever – I’ll just fix it.

Years ago, I was a “programmer” for an NC Drill. “NC” is the acronym for Numerical Control. So this drill just put holes in circuit board material at numerical X Y coordinates. My job was to digitize the artwork (or at least, line up the crosshairs on digitizer with the pads on the artwork, and then tap a foot pedal. As I spun the dials, the X and Y positions would be counted, and when I hit the foot pedal, the current position was recorded. (Actually, it was punched onto a paper tape).

So I learned that foot pedals are a nice way of interfacing with the computer. Especially with your shoes off. 😉

For this transcription work, I need to be editing a document (with my hands), but I’d like to pause and rewind the audio with foot pedals. I bought a somewhat expensive foot pedal from a company in the Pacific Northwest (Made in USA). It works well.

But what to have it do?

At first, I programmed it to do direct keystrokes: Alt-Tab to switch to the last window, Space to pause, Alt-Tab to switch back.

But this has the drawback that the last two windows I’ve used must be the one’s I need, and it’s terribly inflexible. How about picking an un-used set of keys as shortcuts / hotkeys, and attaching scripts? This way, the script can pick the name of the window from the open list, and go right there no matter if it’s been pushed to the back by something else.

Windows, with WinBatch, it just works.

Linux, with xdotools is a nightmare. Someone said xvkbd is the right way to go, to get around the fact that xdotools doesn’t work. Tried the combo, and now one run of one of the scripts kills off the other script from being able to work. I’ve got both, because xdotools does know now to do a “WinActivate” (to use WinBatch terminology), and it doesn’t appear that xvkbd doesn’t do window management. And it wasn’t written for that, either. But xdotools doesn’t know how to send the Space character to the media player, so I’ve got to mash these two together.

The xdotools people say it’s not their fault; most applications block input. Although somehow the xvkbd people are managing it.

I’ve used xdotools at work, and it does great with mouse clicks; so there’s that. But VLC and other Linux media players (many based on VLC) refuse to use a mouse click as “pause” for the video (where YouTube and Facebook don’t have a chip on their shoulder, and just do what is natural for people).

Anyway, I had a deadline to meet, and Windows actually got the job done.