Case value already specified dsdt как исправить ошибку

Hi everyone, I've recently acquired a Asus PN50 with AMD APU 4500U and I would like to collaborate with the the forum with the single purpose of having a stable LE image for everyone that make the same choice I did!! My setup: Asus PN50: Mini PC…


    • #19

    Do you expect that the audio passthrough issues on Intel (e.g. NUC11PAHi)

    The audio passthrough issue has been reported to Intel driver people but no one’s in a hurry to fix it.

    May I ask you which machine you own yourself or plan to purchase?

    I own an Asrock J4105B-ITX (Gemini Lake) board. I plan to upgrade it at some point to a Tiger Lake based mini-ITX board (most likely Celeron 6305 or Pentium Gold 7505) when they are available.

    • Official Post
    • #20

    Current work-in-progress HDR code from lrusak’s git repo (which I use for my LE builds) does not work on AMD. No idea when or if it will ever work.

    But the biggest concern should be AMD’s linux GPU driver quality, which is kinda crap. I encountered some nasty issues when testing LE on Athlon 200GE APU with Vega graphics.

    The audio passthrough issues on Intel are nothing compared to general crappiness of AMD drivers.

    You are using the wrong branch :) I’ve used HDR on my AMD vega-m. It’s very much WIP though. AMD drivers also don’t expose the colorimetry property yet so there is no way to flag bt2020 to the monitor (this is apparently going to be implemented this year though).

    Also, the AMD drivers (IMO) are some of the best.

    • #21

    Can a machine ever be too fast? ;)

    Once you can play everything at 4k60, the best platform then becomes the one which is most power efficient. IMHO.

    • #22

    You are using the wrong branch

    I used this one. Is it the right one? HDR worked on Gemini Lake and (reportedly) on Tiger Lake. Didn’t work on Athlon 200GE.

    Also, the AMD drivers (IMO) are some of the best.

    Ok, but I can make a list of weird issues that are exclusive to AMD and not present on Intel.

    Like this issue for example which I reported to AMD almost a year ago and it is still not fixed.

    • Official Post
    • #23

    Once you can play everything at 4k60, the best platform then becomes the one which is most power efficient. IMHO.

    the Intel NUC7CJYH was the perfect platform IMO as it can do 4k60 with native HDMI 2.0 and it has a TDP of 10w.

    • #24

    Once you can play everything at 4k60, the best platform then becomes the one which is most power efficient. IMHO.

    Partially yes. But I also understand where Deezle is coming from. There is a difference running Kodi with just plain estuary w/ a tiny video library vs my Aeon Nox with alot of eye candy and a massive library to boot. SBC’s like Vero 4k+ (which actually does everything playerwise i need) and others are not significantly faster except probably the I/O which helps a bit then when I was using a Zotac MAG more then 10 years ago. Its very noticeable while using the actual GUI compared to the more expensive x86 NUC’s. Just need the software/drivers to finally get with the times because HW that was released about 3.5 years ago is capable of it. And thats just the GUI not to mention other possibilities like Deezle wanting to use it as a pic viewer and his SBC getting choked up.


    the Intel NUC7CJYH was the perfect platform IMO as it can do 4k60 with native HDMI 2.0 and it has a TDP of 10w.

    Agreed. Its old enough that its price is a great value these days compared to newer NUCs. I have a ODROID H2+ which is very similar. I just can’t use it d/t the audio issue for now.

    • #25

    Partially yes. But I also understand where Deezle is coming from. There is a difference running Kodi with just plain estuary w/ a tiny video library vs my Aeon Nox with alot of eye candy and a massive library to boot. SBC’s like Vero 4k+ (which actually does everything playerwise i need) and others are not significantly faster except probably the I/O which helps a bit then when I was using a Zotac MAG more then 10 years ago. Its very noticeable while using the actual GUI compared to the more expensive x86 NUC’s. Just need the software/drivers to finally get with the times because HW that was released about 3.5 years ago is capable of it. And thats just the GUI not to mention other possibilities like Deezle wanting to use it as a pic viewer and his SBC getting choked up

    I just see a bit more benefit these days upgrading back end hardware (network, NAS etc) rather than trying to load up everything on a front end device, as an example look at how well the Netflix app works on your average Smart TV, there’s not a lot of front end processing power required, because all the heavy lifting is done at the back end.

    I still like Kodi, it’s great for what it is don’t get me wrong, but there’s a lot of other UI’s out there that get by just fine on potato SoC’s too, and running x86 as a HTPC has always felt like too much overkill to me.

    • #26

    Well I had some time to work on the PN50 today.
    I got stuck trying to setup my ir remote.

    ir-keytable returns No devices found

    and in dmesg it shows

    [ 3.338380] ite_cir: Auto-detected model: ITE8708 CIR transceiver
    [ 3.338382] ite_cir: Using model: ITE8708 CIR transceiver
    [ 3.338385] ite-cir 00:02: IR PNP Port not valid!

    Using LibreELEC (community): nightly-20210313-c5d7822

    Any ideas?

    PS Just saw 10.0 Beta 1 has been released. dmesg output is the same

    • #27

    I know my answer is not what you have asked for: But have you ever considered using a Flirc?

    In case you don‘t know what a Flirc is:

    A Flirc is a small USB plug which translates signals from any IR remote into keyboard presses. Makes it pretty easy to create a working keyboard.xml and the best is you don‘t have to hassle with ir-keytables. ;)

    • #28

    I have also tried following the same methodology described in
    📡 Getting the Fintek IR receiver to work with Linux | @GregNau – Apps and Blog

    &

    modprobe -r ite-cir
    echo "auto" > "/sys/bus/acpi/devices/ITE8708:00/physical_node/resources"
    modprobe ite-cir

    After this, dmesg output remains the same:

    [  997.359200] ite_cir: Auto-detected model: ITE8708 CIR transceiver
    [  997.359203] ite_cir: Using model: ITE8708 CIR transceiver
    [  997.359207] ite-cir 00:02: IR PNP Port not valid!

    and ir-keytable still returns No devices found.

    1. There is one more direction to look at, that is this mail thread I found, regarding the PN50 specifically:

    ITE8708 on ASUS PN50 uses a 16 byte io region — Linux media
    Sadly, this mail thread never resolved to something, as far as I can tell. I am not sure, but I think it indicates the cir module in the PN50 is somewhat different than what the driver expects.

    2. The /sys/bus/acpi/devices/ITE8708:00/physical_node/resources has the following contents:

    state = active
    io 0x280-0x28f
    irq 10
    dma disabled

    However, /proc/interrupts doesn’t show IRQ 10 as being used:

    pn50:~ # cat /proc/interrupts
                CPU0       CPU1       CPU2       CPU3
       0:         38          0          0          0  IR-IO-APIC    2-edge      timer
       8:          0          0          1          0  IR-IO-APIC    8-edge      rtc0
       9:          0          1          0          0  IR-IO-APIC    9-fasteoi   acpi
      11:          0          0          0          0  IR-IO-APIC   11-edge      AMDI0010:01
      25:          0          0          0          0   PCI-MSI 4096-edge      AMD-Vi
      26:          0          0          0          0  IR-PCI-MSI 20480-edge      PCIe PME
      27:          0          0          0          0  IR-PCI-MSI 34816-edge      PCIe PME
      28:          0          0          0          0  IR-PCI-MSI 36864-edge      PCIe PME

    • #29

    Success

    [    4.677490] ite_cir: Auto-detected model: ITE8708 CIR transceiver
    [    4.677492] ite_cir: Using model: ITE8708 CIR transceiver
    [    4.677492] ite_cir: TX-capable: 1
    [    4.677493] ite_cir: Sample period (ns): 8680
    [    4.677493] ite_cir: TX carrier frequency (Hz): 38000
    [    4.677494] ite_cir: TX duty cycle (%): 33
    [    4.677494] ite_cir: RX low carrier frequency (Hz): 0
    [    4.677494] ite_cir: RX high carrier frequency (Hz): 0
    [    4.758949] rc rc0: lirc_dev: driver ite-cir registered at minor = 0, raw IR receiver, raw IR transmitter
    [    4.759098] ite_cir: driver has been successfully loaded

    I am attaching the kernel patch I made
    linux-9999-pn50.patch.txt

    It was that email thread I posted earlier
    ITE8708 on ASUS PN50 uses a 16 byte io region — Linux media
    where the answer was hiding, but it took a lot of effort from my part.
    First time building LibreELEC, first time writing a patch and so on.

    ir-keytable now works correctly :D

    I’ll need some help pushing this, at least as a patch to libreelec project, and possibly to the linux drivers. Can anyone help with this? pinging chewitt

    As far as I can tell after digging through dozens of forums/posts/reddits this is the first publicly documented instance of the IR module in the PN50 actually working

    • Official Post
    • #30

    If you’d like to learn sending something upstream I’m always happy to coach on the process — it’s not that hard and we can review to spot the normal ettiquette mistakes before you send the patch. If not, I’d deferr to HiassofT who will understand what the change does — I don’t code :)

    • #31

    I was thinking of a double approach:

    1. Do a pull request on the LibreELEC github, with the above patch, so that it hopefuly becomes a part of the future stable LE 10.0

    That way I can soon go back to using nightlies to further test the PN50 (at least until the next beta), instead of having to compile my own builds.

    2. In addition, try to push this upstream to the appropriate linux mailing list, so that it becomes a part of the kernel drivers at some point, and possibly also backported (if that’s an option). I’m not really sure how long that’s going to take.

    So for 1 I guess I’ll do a PR on github. Does that sound good?

    And for 2 I’ll start by dropping an email on the linux-media list

    • #32

    Start with 2, and also send the email to Sean Young (he’s the IR remote maintainer). When he acceptet your patch create a PR for LibreELEC, ideally with a link to the linux media patchwork URL.

    so long,

    Hias

    • #33

    beredim Your change will fail on any motherboard reporting the correct 8 byte register length.

    To implement the discussed fix change ‘!=’ to ‘<‘ in this line.

    • #34

    Yes, I see what you mean.

    According to that email thread it’s the motherboard that is reporting the wrong register length of 16 in the ACPI tables

    (while the device is still supposed to have an register length of 8 )
    So by changing the register length to 16 in the driver, I am borking every other motherboard with correct ACPI tables, and possibly the PN50 in case a BIOS update fixes the value in the future.

    I’ll try your approach.

    * It’s a mystery to me how this ended up being an issue. It seems ASUS has been using the same ITE8708 since ages ago.

    • #35

    This thread has provided me many ideas on how to tackle my problem with my new PN62S, which appears to be the Intel version of the PN50. Looking for info on the ITE8708 led me here. While I still have not solved my issue yet, in appreciation of the work done so far, I thought I could share some of what I’ve tried/learned over the last week, which may trigger someone else’s solution to their problem.

    When I received my PN62S, the first thing I did before I even installed an OS was updated to the latest BIOS. I’m ultimately using this as a MythTV frontend, but started with a 20.04 Xubuntu minimal install to see what worked, and what didn’t. I’ve updated the kernel to a 5.10. IR is one of the reasons I chose this unit. I use FLIRC on my main machine, but for something this tiny, I wanted to try and keep it more elegant. So when it wanted to play rough, I accepted the challenge.

    I downloaded and installed Windows 10 on an old drive just to see if things truly worked, and they did. Without installing anything extra, a Microsoft remote «just worked». I confirmed my address space as 8 bytes (0x0680 — 0x0687) and IRQ (10) requirements from this side. Oh, and the Windows driver? From 2006 according to it’s properties! So all of this is pointing me to your length issue as being an ASUS issue. Sure, a patch to ite-cir may work around it, but ultimately I think a BIOS update would be the proper solution (I’ll get to that shortly).

    So inspired by your conversation, I thought maybe updating the driver with your corrections might solve my issue. I’ve tried the length correction, the != correction, and both together with no change. Which didn’t entirely surprise me because my problem seems to start at a lower level. The kernel seems to be aware enough that the device exists, but nothing in dmesg even hints at an attempt to load the driver. If I could get as far as your dmesg output, I’m sure the patch would solve my issue.

    [email protected]:~$ lsmod | grep cir
    ite_cir                28672  0
    rc_core                61440  3 ite_cir,cec
    
    [email protected]:~$ sudo ls -l /sys/bus/acpi/devices/ITE8708:00/physical_node/
    total 0
    -r--r--r-- 1 root root 4096 Apr 28 19:47 ari_enabled
    -rw-r--r-- 1 root root 4096 Apr 28 19:47 broken_parity_status
    -r--r--r-- 1 root root 4096 Apr 28 19:47 class
    -rw-r--r-- 1 root root  256 Apr 28 19:47 config
    -r--r--r-- 1 root root 4096 Apr 28 19:47 consistent_dma_mask_bits
    -rw-r--r-- 1 root root 4096 Apr 28 19:47 d3cold_allowed
    -r--r--r-- 1 root root 4096 Apr 28 19:47 device
    -r--r--r-- 1 root root 4096 Apr 28 19:47 dma_mask_bits
    lrwxrwxrwx 1 root root    0 Apr 28 19:47 driver -> ../../../bus/pci/drivers/skl_uncore
    -rw-r--r-- 1 root root 4096 Apr 28 19:47 driver_override
    -rw-r--r-- 1 root root 4096 Apr 28 19:47 enable
    lrwxrwxrwx 1 root root    0 Apr 28 19:47 firmware_node -> ../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/ITE8708:00
    -r--r--r-- 1 root root 4096 Apr 28 19:47 index
    -r--r--r-- 1 root root 4096 Apr 28 19:47 irq
    -r--r--r-- 1 root root 4096 Apr 28 19:47 label
    drwxr-xr-x 2 root root    0 Apr 28 19:47 link
    -r--r--r-- 1 root root 4096 Apr 28 19:47 local_cpulist
    -r--r--r-- 1 root root 4096 Apr 28 19:47 local_cpus
    -r--r--r-- 1 root root 4096 Apr 28 19:47 modalias
    -rw-r--r-- 1 root root 4096 Apr 28 19:47 msi_bus
    -rw-r--r-- 1 root root 4096 Apr 28 19:47 numa_node
    drwxr-xr-x 2 root root    0 Apr 28 19:47 power
    --w--w---- 1 root root 4096 Apr 28 19:47 remove
    --w------- 1 root root 4096 Apr 28 19:47 rescan
    -r--r--r-- 1 root root 4096 Apr 28 19:47 resource
    -r--r--r-- 1 root root 4096 Apr 28 19:47 revision
    lrwxrwxrwx 1 root root    0 Apr 28 19:47 subsystem -> ../../../bus/pci
    -r--r--r-- 1 root root 4096 Apr 28 19:47 subsystem_device
    -r--r--r-- 1 root root 4096 Apr 28 19:47 subsystem_vendor
    -rw-r--r-- 1 root root 4096 Apr 28 19:47 uevent
    -r--r--r-- 1 root root 4096 Apr 28 19:47 vendor

    Display More

    What became key to me here is that in the relevant /sys/bus/acpi folder for this device is that I have no resources file (resource is something completely different). I also think because the BIOS marks that memory area as motherboard resources, it gets picked up by another driver when ite-cir doesn’t grab it. So the lack of resources led me to investigate ACPI in the BIOS, thinking that it wasn’t providing me the right information.

    So lately I’ve been learning about ACPI and more specifically the DSDT table provided in the BIOS. And this is where it might lead to a fix for your length issue. Deep in this table (over 64k lines!), from my BIOS, is the definition for this device. I’d be interested to compare this against the definition in a PN50 ( :idea: After this I’m going to download the PN50 and see if there’s anyway I can find the DSDT table in it!)

          Device (CR00)
          {
              Name (_ADR, Zero)  // _ADR: Address
              Name (VBAN, 0x0680)
              Name (VIRQ, 0x0A)
              Name (UIDN, Zero)
              Name (_HID, EisaId ("ITE8708"))  // _HID: Hardware ID
              Method (_UID, 0, NotSerialized)  // _UID: Unique ID
              {
                  Return (UIDN) /* _SB_.PCI0.CR00.UIDN */
              }
    
              Method (_STA, 0, Serialized)  // _STA: Status
              {
                  If ((CIRE == Zero))
                  {
                      Return (Zero)
                  }
                  Return (0x0F)
              }
    
              Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
              {
                  Name (BUF0, ResourceTemplate ()
                  {
                      IO (Decode16,
                          0x0000,             // Range Minimum
                          0x0000,             // Range Maximum
                          0x01,               // Alignment
                          0x08,               // Length
                          _Y10)
                      IRQNoFlags (_Y11)
                          {}
                      DMA (Compatibility, NotBusMaster, Transfer8, )
                          {}
                  })
                  CreateWordField (BUF0, _SB.PCI0.CR00._CRS._Y10._MIN, IOPL)  // _MIN: Minimum Base Address
                  CreateWordField (BUF0, _SB.PCI0.CR00._CRS._Y10._MAX, IOPH)  // _MAX: Maximum Base Address
                  CreateWordField (BUF0, _SB.PCI0.CR00._CRS._Y11._INT, IRQ)  // _INT: Interrupts
                  IOPL = VBAN /* _SB_.PCI0.CR00.VBAN */
                  IOPH = VBAN /* _SB_.PCI0.CR00.VBAN */
                  IRQ = (One << VIRQ) /* _SB_.PCI0.CR00.VIRQ */
                  Return (BUF0) /* _SB_.PCI0.CR00._CRS.BUF0 */
              }
          }

    Display More

    My length is defined as 0x08. If you were to check your DSDT table (see below for useful links), would it say that, or would it say 0x10? If this was the case, then I think this should be pointed out somehow to ASUS. An updated BIOS with a fix to this table could make the problem go away if this is the root cause.

    Now in addition to finding this info, I’ve also learned that in addition to disassembling this and other ACPI tables, they can be modified and recompiled. Once recompiled, depending on your kernel build (and many may be built for this … mine was, out of the box), the recompiled table can be loaded at boot time to be used instead of the one provided by the BIOS. It can be built into the kernel too apparently, but that’s a lot more work.

    I’ve tested this process with a couple things, like preventing the address from being reserved by the motherboard, in case that was preventing the right driver from grabbing it, and making sure the _STA method returned 0x0F, regardless of the BIOS setting for enabling CIR (CIRE). None of these fixed my problem, but showed me that a fix might be possible to implement.

    If there is more interest in my pursuit, I can go into more detail, but I feel like I have probably already dragged on long enough for now. I’ve got a lot more to learn, but I’ll leave you with some of the links (I’ve got a lot of open tabs right now!) I’ve found useful around working with ACPI:

    Overriding a DSDT | 01.org

    Learned something potentially important about version number in this one:

    ACPI AML debug and override ACPI tables using initrd — Programmer Sought

    DSDT — ArchWiki

    Getting my customized DSDT loaded in Xubuntu:

    boot — Including a custom ACPI DSDT with (K)Ubuntu 18.04 (RC1) — Ask Ubuntu

    • #36

    So shortly after my last post, I found one of my open tabs contained this: ITE8708 on ASUS PN50 uses a 16 byte io region — Linux media

    which seems to confirm what I was saying about the length in the PN50 DSDT table being 0x10, instead of 0x08. So, as an alternative to using the ite-cir patch (not trying to discredit the work done on that … just giving another option), I’ll walk through how I would approach this ACPI table.

    Before you start this process though, check the following:

    cat /boot/config-$(uname -r) | grep ACPI_TABLE_UPGRADE
    CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y
    CONFIG_ACPI_TABLE_UPGRADE=y

    If your kernel has this configuration, it will allow the loading of an updated ACPI table from a file (DSDT in this case). If not already present, you can build a kernel that can, but that goes against this being a «quick» fix. If it doesn’t have this config, then the rest of this post won’t be relevant.

    Now, retrieve the DSDT table. I’ve made a new folder to try and keep the clutter down. (Can I ask a favour here … could someone attach their DSDT file for a PN50 here? I’d like to compare it against my PN62S to see if I can figure out why the kernel really doesn’t like my CIR. Thanks)

    mkdir acpi
    cd acpi
    sudo cp /sys/firmware/acpi/tables/DSDT ./
    sudo chown j:j DSDT       // or be prepared to use sudo more often

    Now you need iasl, the ACPI Source Language compiler/decompiler. I was initially able to install a package (acpica-tools) on my system which contains this, but the version available in that package found errors during the ACPI compilation process. So I built the latest version from GitHub — acpica/acpica: The ACPI Component Architecture (ACPICA) project provides an open-source operating system-independent implementation of the Advanced Configuration and Power Interface specification (ACPI). For detailed project information and downloads, go to https://www.acpica.org. For ACPICA contributor and source code licensing information, go to and it didn’t have a problem compiling a new ACPI table ?( Once you have it installed, use it to disassemble the current DSDT table.

    [email protected]:~/acpi$ iasl DSDT 
    
    Intel ACPI Component Architecture
    ASL+ Optimizing Compiler/Disassembler version 20210331
    Copyright (c) 2000 - 2021 Intel Corporation
    
    File appears to be binary: found 95539 non-ASCII characters, disassembling
    Binary file appears to be a valid ACPI table, disassembling
    Input file DSDT, Length 0x449FF (281087) bytes
    ACPI: DSDT 0x0000000000000000 0449FF (v02 ALASKA A M I    01072009 INTL 20160527)
    Pass 1 parse of [DSDT]
    Pass 2 parse of [DSDT]
    Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
    
    Parsing completed
     Warning - Emitting ASL code "External (CIRE)"
               This is a conflicting declaration with some other declaration within the ASL code.
               This external declaration may need to be deleted in order to recompile the dsl file.
    
     Warning - Emitting ASL code "External (COME)"
               This is a conflicting declaration with some other declaration within the ASL code.
               This external declaration may need to be deleted in order to recompile the dsl file.
    
     Warning - Emitting ASL code "External (ESPC)"
               This is a conflicting declaration with some other declaration within the ASL code.
               This external declaration may need to be deleted in order to recompile the dsl file.
    
     Warning - Emitting ASL code "External (PSON)"
               This is a conflicting declaration with some other declaration within the ASL code.
               This external declaration may need to be deleted in order to recompile the dsl file.
    
    Disassembly completed
    ASL Output:    DSDT.dsl - 2051852 bytes

    Display More

    There’s now a text file, DSDT.dsl, in the current folder, which is the source code for the DSDT table. This is the file that will be edited later to change the length reported to the kernel. I slightly overstated the file size last time, but my file is 62,293 lines.

    I think there’s a lot of clutter in this file. I suspect there’s a lot of code in here meant for other machines, new code without looking for old code, etc., which possibly accounts for a lot of these errors. «Case» in point … if I try to recompile what I just decompiled, without making any changes, it finds errors (using the -ve option only displays errors, otherwise they’re hard to find among the 209 warnings and 536 remarks!). Several times there are Case statements for the same value.

    [email protected]:~/acpi$ iasl -ve DSDT.dsl
    
    Intel ACPI Component Architecture
    ASL+ Optimizing Compiler/Disassembler version 20210331
    Copyright (c) 2000 - 2021 Intel Corporation
    
    
    DSDT.dsl  61533:                     Case (0x03)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61489:                     Case (0x03)
    
    
    DSDT.dsl  61537:                     Case (0x03)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61489:                     Case (0x03)
    
    
    DSDT.dsl  61541:                     Case (0x30)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61497:                     Case (0x30)
    
    
    DSDT.dsl  61569:                     Case (0x78)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61561:                     Case (0x78)
    
    
    DSDT.dsl  61577:                     Case (0xA0)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61573:                     Case (0xA0)
    
    
    DSDT.dsl  61639:                     Case (0x03)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61606:                     Case (0x03)
    
    
    DSDT.dsl  61642:                     Case (0x03)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61606:                     Case (0x03)
    
    
    DSDT.dsl  61645:                     Case (0x30)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61612:                     Case (0x30)
    
    
    DSDT.dsl  61666:                     Case (0x78)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61660:                     Case (0x78)
    
    
    DSDT.dsl  61672:                     Case (0xA0)
    Error    6022 - Case value already specified ^
    
    
    Original Case value below:
    DSDT.dsl  61669:                     Case (0xA0)
    
    
    ASL Input:     DSDT.dsl - 2051852 bytes  29862 keywords  62295 source lines
    
    
    Compilation failed. 10 Errors, 209 Warnings, 536 Remarks
    No AML files were generated due to compiler error(s)

    Display More

    Editing the file and removing the redundant Case statements solves this problem. That gave me a file that would compile:

    [email protected]:~/acpi$ iasl -ve DSDT.dsl
    
    Intel ACPI Component Architecture
    ASL+ Optimizing Compiler/Disassembler version 20210331
    Copyright (c) 2000 - 2021 Intel Corporation
    
    
    ASL Input:     DSDT.dsl - 2050902 bytes  29847 keywords  62260 source lines
    AML Output:    DSDT.aml -  280440 bytes  24941 opcodes    4906 named objects
    
    
    Compilation successful. 0 Errors, 209 Warnings, 536 Remarks, 618 Optimizations

    Display More

    The DSDT.aml file is technically the new DSDT table that can be loaded by the kernel, although this one doesn’t have any changes in it yet.

    So go back to the editor and make the necessary changes. I haven’t tried leaving the version as-is, but from what I’ve read it needs to be larger than the hardware version for this to work. So changing mine from 0x01072009 to 0x0107200A has worked in the past. Obviously, you will need to choose your value accordingly. This is located at the very start of the file (line 21).

    /*
    * Intel ACPI Component Architecture
    * AML/ASL+ Disassembler version 20210331 (64-bit version)
    * Copyright (c) 2000 - 2021 Intel Corporation
    *
    * Disassembling to symbolic ASL+ operators
    *
    * Disassembly of DSDT, Thu Apr 29 15:14:50 2021
    *
    * Original Table Header:
    *     Signature        "DSDT"
    *     Length           0x000449FF (281087)
    *     Revision         0x02
    *     Checksum         0xDD
    *     OEM ID           "ALASKA"
    *     OEM Table ID     "A M I "
    *     OEM Revision     0x01072009 (17244169)
    *     Compiler ID      "INTL"
    *     Compiler Version 0x20160527 (538314023)
    */
    DefinitionBlock ("", "DSDT", 2, "ALASKA", "A M I ", 0x01072009)

    Display More

    If you search for ITE8708, the device we’re after, you should be led to it’s definition in the file. Change the value on line 31 to 0x08.

    Device (CR00)
    {
        Name (_ADR, Zero)  // _ADR: Address
        Name (VBAN, 0x0680)
        Name (VIRQ, 0x0A)
        Name (UIDN, Zero)
        Name (_HID, EisaId ("ITE8708"))  // _HID: Hardware ID
        Method (_UID, 0, NotSerialized)  // _UID: Unique ID
        {
            Return (UIDN) /* _SB_.PCI0.CR00.UIDN */
        }
    
        Method (_STA, 0, Serialized)  // _STA: Status
        {
            If ((CIRE == Zero))
            {
                Return (Zero)
            }
    
            Return (0x0F)
        }
    
        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
        {
            Name (BUF0, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0000,             // Range Minimum
                    0x0000,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    _Y10)
                IRQNoFlags (_Y11)
                    {}
                DMA (Compatibility, NotBusMaster, Transfer8, )
                    {}
            })
            CreateWordField (BUF0, _SB.PCI0.CR00._CRS._Y10._MIN, IOPL)  // _MIN: Minimum Base Address
            CreateWordField (BUF0, _SB.PCI0.CR00._CRS._Y10._MAX, IOPH)  // _MAX: Maximum Base Address
            CreateWordField (BUF0, _SB.PCI0.CR00._CRS._Y11._INT, IRQ)  // _INT: Interrupts
            IOPL = VBAN /* _SB_.PCI0.CR00.VBAN */
            IOPH = VBAN /* _SB_.PCI0.CR00.VBAN */
            IRQ = (One << VIRQ) /* _SB_.PCI0.CR00.VIRQ */
            Return (BUF0) /* _SB_.PCI0.CR00._CRS.BUF0 */
        }
    }

    Display More

    Save the file and recompile it (iasl -ve DSDT.dsl). There shouldn’t be any errors. Now the DSDT.aml file should contain the correct information to report to the kernel when loaded. Move this file to the /boot folder.

    Now the boot loader should be able to access the revised DSDT as the machine starts. Without getting into the various ways that boot loaders work (because I need to brush up on that myself), I have only interrupted my GRUB loader and manually added the acpi statement to the end:

    initrd /boot/initrd.img-5.10.0-1023-oem
    acpi   /boot/DSDT.aml

    The advantage of being able to load an .aml file is that if the config of the boot loader is such that the necessary statement is added automatically, upgrading a kernel shouldn’t require any changes related to this. And if a BIOS update resolves the issue, then removing this from the boot process is all that it takes to clean up.

    After booting, I can find evidence of the new table in dmesg. My new version number is present.

    [email protected]:~$ dmesg | grep DSDT
    [    0.010373] ACPI: DSDT 0x0000000028A7C000 044778 (v02 ALASKA A M I    0107200A INTL 20210331)
    [    0.259601] ACPI: _SB_.PCI0.LPCB.EC0_: Boot DSDT EC used to handle transactions
    [    0.318901] ACPI: _SB_.PCI0.LPCB.EC0_: Boot DSDT EC initialization complete

    Hope someone can find this useful. I’ve tried to be detailed enough, so it may look long, but once it’s been done a couple times, I can make a change in a few minutes without rebuilding a driver or kernel, and reverting even quicker.


Technical background

DSDT — Differentiated System Description Table — is the biggest and most complex ACPI table. The minimal length is 36 bytes, in reality it is about 20 kb or even more. This table describes devices and methods for accessing them. These methods can contain arithmetic and logical expressions, representing a program written in a C-like programming language. Correcting this table means you need to have some sort of programming knowledge. Clover offers an option to automatically apply corrections, however it is important to understand that an artificial intelligence was not created yet and that the automatic method is far from being complete. It is better to do the corrections manually.
Why does it need to be fixed at all? DSDT patching was created with the intention to fix device HPET — High Precision Events Timer. The point is that OS X includes a kext named AppleIntelCPUPowerManagement for power management control (SpeedStep), which — by all means — needs interrupts IRQ 0 and 8. Otherwise it will create a kernel panic. This kext can either be removed or blocker, however you can alternatively correct the DSDT to ensure a normal behaviour of this kext.

Nr. 1 : This is a necessity. Does Mac OS X really need HPET? Not really, but BIOS vendors tend to be slow and they just started writing the correct parameters. Usually a DSDT will still need to be corrected.

Nr. 2 : A DSDT contains certain dependencies on the operating system like Windows 98, Windows 2001, Windows 2006 or Linux. Mac OS X uses identifier Darwin, which usually is missing. Even if it is not, it was created for FreeBSD. Mac OS X makes great use of the ACPI system and uses a DSDT to its maximum, as does Windows 2001; but not Linux, Windows 98 and not Windows 2006. It is always correct to mask the system as Windows 2001. Even if you find Darwin in your DSDT, mask it as Windows2001.
New computers have ACPI more like Windows 2009. For this case Clover has a fix FixDarwin7
Many BIOS variants can use the variable OSYS = 0x07D2, but not 0x07D6, 0x07D9 or 0x2410 as written into a real Mac’s DSDT.

Nr. 3 : The vendor of a motherboard’s and thus the creator of a DSDT, cannot predict the devices you will be using (CPU, video card, etc.). They should be written into the DSDT however! Vice versa, devices like the internal speaker, floppy drive or parallel port should be excluded. Their drivers do not exist and are not even needed. Additionally it is often necessary to add or remove framebuffers/ports to devices like video cards or SATA controllers.
The DSDT is is written into the BIOS and is used by the system in AML binary code. It can be de-/compiled using IASL, which translates binary code into human readable DSL source code. A user will use this path to apply corrections: AML>DSL>edit>DSL>AML — this is the next point.

Nr. 4 : The last part is made impossible because of syntax and logical errors initially present in the OEM DSDT. You will need to correct them, too. Additionally, you can fix other mistakes, which prevent the PC from sleeping or waking up, or add new devices. (It is a bit strange, compiling/decompiling is not a strictly reversible operation and will change the table or even prevent further compiler operations. From my point of view the compiler is not bug-free. Non-conformance to the specification, however, should be considered as a warning, not as an error).

When you reached this step you can instruct Clover to use your modified DSDT by placing it into the directory EFI/CLOVER/OEM/xxx/ACPI/patched or — when the computer’s name is not known yet — into EFI/CLOVER/ACPI/patched. Alternatively the OS can have its own DSDT in the root of the system partition.
Where can you obtain the initial DSDT that needs to be patched? There are different ways involving Windows, Linux or OS X. If you were able to start Clover somehow, you can enter its GUI and press F4. If Clover was installed on a FAT32 partition, then it will be able to save all ORM ACPI tables, including DSDT and FADT. The process can take a while, especially when saving many tables to a USB flash drive. This is especially useful when you have no access to other means of extracting the table set, for example with AIDA64. Also you can save the patched DSDT variant: enter Options in CloverGUI, change the DSDT mask, exit Options and press F5. A DSDT with the specified patches will be saved, which are represented in the file name, for example: DSDT-F597.aml. You can save multiple variants for comparison.
Now you can edit the DSDT and if you are not really comfortable doing this, Clover offers some automatic patches:


DSDT mask



AddDTGP bit(0)

For injecting device properties you can — apart from DeviceProperties — use a variant involving method _DSM (Device Specific Method), which is written into the DSDT table. _DSM is widely used since OS X 10.5. It contains properties for a device and makes use of the method DTGP, which is universal for all devices. This fix simply adds the DTGP method for later use with other fixes. It has no significance on its own.


FixDarwin bit(1)

Provide a set of corrections to DSDT to make your system «Darwin» identified as «Windows 2001» like the most ACPI system. More ACPI devices will work in this mode.


FixDarwin7 bit(16)

Provide a set of corrections to DSDT to make your system «Darwin» identified as «Windows 2009». More ACPI devices will work in this mode. Recommended for IvyBridge and up hardware.


FixShutdown bit(2)

A condition is added to method _PTS: if the argument is 5 (shutdown), then no other actions shall be performed. Many reports confirmed this option to fix shutdown issues with ASUS boards, maybe even with other vendors. Some DSDT tables already contain such a condition and it is advised to turn the fix off in this case.


AddMCHC bit(3)

Added device MCHC to DSDT. For board H61M this is obligatory, else KP.


FixHPET bit(4)

Add IRQ(0, 8, 11) to device HPET. Obligatory for SandyBridge and recommended for others.


FakeLPC bit(5)

Changes the DeviceID of the LPC controller to allow the loading of kext AppleLPC. This fix is necessary when the chipset is not recognised by OS X. However, the list of supported Intel and NForce chipsets is so big that the fix is rarely needed. Verify if AppleLPC is loaded and use this fix, if it is not. Moreover, the kext can unload itself even if the chipset is supported.


FixIPIC bit(6)

Removes the interrupt from device IPIC. Helpful for Power button will work.


FixSBUS bit(7)

Adds an SMBusController to the device tree, which fixes a warning about its absence in the system log. Helps to sleep/wake.


FixDisplay bit(8)

Create device GFX0 if still absent. It is needed for correct Power Management but the device is usually absent in DSDT because it is not a part of the motherboard. Added also device HDAU that is HDMI sound device on the videocard. If we set FakeID in config.plist it will be inserted here. Intel video will be patched separately.


FixIDE bit(9)

10.6.1 introduces a kernel panic related to AppleIntelPIIXATA. There are two options to solve the problem: using a patched kext or patching the DSDT. Probably not needed for recent systems.
Not recommended.


FixSATA bit(10)

Fixes several SATA problems and removes yellow hard drive icons by masking the controller as ICH6. The method is controversial but it can fix the DVD drive and simply replacing the hard drive icons is not enough in this case. An alternative is to patch the kext AppleAHCIPort.kext.
Not recommended.


FixFirewire bit(11)

Add device Firewire into DSDT if absent and if the device really present. Adds the property fwhub to the device.


FixUSB bit(12)

Tries fixing USB the countless USB issues for USB1.0, USB2.0 and USB3.0.


FixLAN bit(13)

Injects the property built-in to the Ethernet card, which is necessary for correct operation. Additionally injects the card’s name for a better looking System Profiler. Also made FakeID for some known substitutions.


FixAirport bit(14)

Same as above for WiFi. Furthermore, the actual device is created and written into DSDT. A DeviceID will automatically written for known cards to enable airport functionality. Not recommended.


FixHDA bit(15)

Corrects sound card properties to enable the native AppleHDA driver. The name is changed from AZAL to HDEF, layout-id and PinConfiguration are injected. Adding HMDI device if absent.


FixRTC

Exclude IRQ(0) from RTC device.


FixTMR

Exclude IRQ(8) from TMR device. This is ancient DOS device and not needed in modern computers. Just wonder it present.


AddIMEI

This device is used for IntelHDxxx graphics. Adding them if very desirable operation. This bit also needed for use FakeID->IMEI. Do nothing for Core 2 systems.


FixIntelGfx

Correct device class for the IGPU from 038000 to display class 030000


FixWAK

adding Return(Package(0)) into method _WAK if absent. This patch is for warning elimination. I don’t know about working influence.


DeleteUnused

There are not used devices like Floppy drive, LPT port and others that will be good to delete from DSDT to not occupy interrupts.


FixADP1

Rename AC0 device to ADP1 device.


AddPNLF

Adding device PNLF is very useful: only with it you may have brightness control. This patch is also influence on good Sleep/Wake of the system.

In my case there are:
DSDT_FIX: AddPNLF
OEM SSDT NvdTable, but _DSM -> ZDSM corrected by Clover. No new _DSM
No additional kexts.

A trick to assign keys to reduce/increase brightness:

  1. Insert temporarily USB keyboard
  2. Control Panel -> Keyboard -> Shotcuts -> Screen (appeared due to USB keyboard)
  3. Assign F1 to Reduce brightness and F2 to Increase. No other combinations!
  4. After removing the USB keyboard assigning will continue working.

FixS3D

Also resolving some Sleep/Wake problems by correcting _S3D methods.


FixACST

Name ACST have different use for Apple and for ASUS. For ASUS it is AC adapter state. For Apple it is a replacement for _CST, c-states table. To not conflict it is needed to rename such names to something else.


FixRegions

Address of some regions in DSDT depends on many factors and may change time to time

OperationRegion (GNVS, SystemMemory, 0xDE6A4E18, 0x01CD)

The presence of floating regions make impossible to use custom DSDT because this region may be shifted and will not correspond to current state. This patch is intended to find all such regions in BIOS and correct them in custom DSDT. So now you can produce your custom DSDT with wrong regions and set this patch.


Choosing the right mask

How can you choose the necessary patches and how do you know which ones are harmless or dangerous? The computer will not be harmed either way. All the changes are stored memory only and will be removed after rebooting.
You can try setting different combinations in CloverGUI and save them by pressing F5 in the Options menu.
To make sure the currently patched DSDT is not creating a conflict, you can change the DSDT name in the menu — DSDT name: BIOS.aml. This file will not be found, Clover will extract the original OEM DSDT from BIOS and apply fixes set in the DSDT mask section. In case the OS did not load successfully, your previously set (working) values will be used.
0xFFFFFFFF enables all fixes and if the OS loads successfully this way, you will know that our efforts were not for nothing. Given the descriptions above you already realised that some fixes are not needed for your system (for example WiFi), they can even make things worse.

You may make patched DSDT once with full mask. Then correct patched DSDT manually. Then use this manually patched DSDT.aml loading but set FixRegions (10000000) only. The mask will be 0x10000000

Attachments

sysinfo logs from while the i2c devices worked and when they stopped working.


(506.84 KB,
application/gzip)

2021-03-22 02:49 UTC,

Austin Kilgore

Details

interrupts and dmesg log


(26.11 KB,
application/gzip)

2021-03-26 20:05 UTC,

Austin Kilgore

Details

acpidump


(652.02 KB,
text/plain)

2021-05-03 22:48 UTC,

Austin Kilgore

Details

facp.dsl


(9.11 KB,
text/x-csrc)

2021-05-03 22:56 UTC,

Austin Kilgore

Details

fwts version


(321.15 KB,
text/plain)

2021-05-03 23:06 UTC,

Austin Kilgore

Details

[PATCH] pinctrl: amd: Fix handling of PIN_CONFIG_BIAS_PULL_UP/_DOWN settings


(3.91 KB,
patch)

2021-05-30 14:10 UTC,

Hans de Goede

Details
| Diff

pins with dsdt overlay


(6.13 KB,
text/plain)

2021-05-30 17:06 UTC,

Austin Kilgore

Details

pins without dsdt overlay (identical)


(6.13 KB,
text/plain)

2021-05-30 17:07 UTC,

Austin Kilgore

Details

gpio with dsdt overlay


(56.20 KB,
text/plain)

2021-05-30 17:59 UTC,

Austin Kilgore

Details

gpio without dsdt overlay (identical)


(56.20 KB,
text/plain)

2021-05-30 18:00 UTC,

Austin Kilgore

Details

gpio with patch


(56.20 KB,
text/plain)

2021-05-30 21:33 UTC,

Austin Kilgore

Details

[PATCH] GPIOLIB/AMD-pinctrl: add some debugging


(1.93 KB,
patch)

2021-05-31 09:51 UTC,

Hans de Goede

Details
| Diff

dsdt files


(31.63 KB,
application/gzip)

2021-05-31 19:22 UTC,

Austin Kilgore

Details

acpidumps and dmesg logs


(398.92 KB,
application/gzip)

2021-06-05 11:52 UTC,

Austin Kilgore

Details

dsdt.hex used in kernel as override


(371.79 KB,
text/x-csrc)

2021-06-24 20:03 UTC,

Austin Kilgore

Details

Hide non-related HTML attachment


(7 bytes,
text/plain)

2022-11-24 11:52 UTC,

Andy Shevchenko

Details


Add an attachment
(proposed patch, testcase, etc.)

Forex Trader

2005.11.03 11:04

#11  

A mozno i tak:

#define EURUSD 1;
#define GBPUSD 2;
#define USDCHF 3;
#define USDJPY 4;
#define USDCAD 5;
#define AUDUSD 6;
#define EURJPY 7;


int GetCurrencyCode(string currency)
{
if (currency == "EURUSD") return EURUSD;
if (currency == "GBPUSD") return GBPUSD;
if (currency == "USDCHF") return USDCHF;
if (currency == "USDJPY") return USDJPY;
if (currency == "USDCAD") return USDCAD;
if (currency == "AUDUSD") return AUDUSD;
if (currency == "EURJPY") return EURJPY;

return 0;
}

int init()
{
string vl="EURUSD";
}

int start()
{
switch (GetCurrencyCode(vl))
{
case EURUSD: P=EURUSD; break;
case USDCAD: P=USDCAD; break;
case AUDUSD: P=AUDUSD; break;
case EURJPY: P=EURJPY; break;
default: P=0;break;
}
}

Ispolzuite na zdarovje :-)

Forex Trader

2005.11.03 11:53

#12  

A mozno i tak:

Ispolzuite na zdarovje :-)

Не, так не выйдет, здесь проверяется валюта графика, а мне это не к чему,
у меня эксперт на разных валюных парах окна ему не нужны.
Но код хороший, спасибо.

Forex Trader

2005.11.03 11:59

#13  

A mozno i tak:

Ispolzuite na zdarovje :-)

Не, так не выйдет, здесь проверяется валюта графика, а мне это не к чему,
у меня эксперт на разных валюных парах окна ему не нужны.
Но код хороший, спасибо.

Tak eto — konvertacija stringa valiuty na cifru, a eto uze mozno ispolzovat’ v switch->case :-)
Naprimer, GetCurrencyCode(Symbol()) tebe verniot sovpadajus4ij kod valiuty, katorovo kak cifru ispolzuj gde ugodno.

Aleksey Rodionov

2018.12.27 14:55

#14  

 case 1>=1 && 15000<=15000 :Print(A1); break;
 case 2>=2 && 333<=333 :Print(A1); break;

Что за ошибка?

‘&&’ — case value already used   ‘&&’ — значение регистра уже используется

Если одну строчку компилировать, то все нормально

Aliaksandr Hryshyn

2018.12.28 05:05

#15  

Aleksey Rodionov:

Что за ошибка?

‘&&’ — case value already used   ‘&&’ — значение регистра уже используется

Если одну строчку компилировать, то все нормально

У вас две строки абсолютно одинаковые по сути. Вы понимаете что в коде написано? Выражения «1>=1 && 15000<=15000» и «2>=2 && 333<=333» дают true в результате. Должны быть разные значения, что и говорится в ошибке.

Aleksey Rodionov

2018.12.28 05:43

#16  

Aliaksandr Hryshyn:

У вас две строки абсолютно одинаковые по сути. Вы понимаете что в коде написано? Выражения «1>=1 && 15000<=15000» и «2>=2 && 333<=333» дают true в результате. Должны быть разные значения, что и говорится в ошибке.

Да понимаю, но не как специалист. У меня этот код работает через if ,хотел через свитч сделать что бы было компактней.

Aleksey Rodionov

2018.12.28 05:50

#17  

До компьютера добрался. Вот собственно код который хотел переделать в switch

int Rand = MathRand();
if (Rand >= 1 && Rand <= 15000)
{
Print (A1);
}
if (Rand >= 15001 && Rand <= 30000)
{
Print (A2);
}
Igor Makanu

2018.12.28 06:16

#18  

Aleksey Rodionov:

До компьютера добрался. Вот собственно код который хотел переделать в switch

оператор switch работает с константными выражениями, если Вы заранее знаете какие результаты получите в Rand , тогда и пишите в case эти значения:

int Rand=MathRand();
switch(Rand)
  {
   case 1:
   case 2:
   case 3:
   case 4:
   .....
   case 15000:
      Print(A1);
      break;
   case 15001:
   case 15002:
   case 15003:
   case 15004:
   ......
   case 30000:
      Print(A2);
      break;
   default: Print("Rand не попал в диапазон 1-30000");
  }

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20111123-32 [Dec 3 2011]
Copyright (c) 2000 — 2011 Intel Corporation

/Users/newxxxxxxx/Desktop/newdsdt.dsl 289: Store (Local0, Local0)
Error 4066 — Method local variable is not initialized ^ (Local0)

/Users/newxxxxxxx/Desktop/newdsdt.dsl 293: Store (Local0, Local0)
Error 4066 — Method local variable is not initialized ^ (Local0)

/Users/newxxxxxxx/Desktop/newdsdt.dsl 430: 0xFFF00000, // Length
Error 4049 — Length is larger than Min/Max window ^

/Users/newxxxxxxx/Desktop/newdsdt.dsl 3592: Name (_HID, «pnp0c14»)
Error 4132 — Non-hex letters must be upper case ^ (pnp0c14)

ASL Input: /Users/newxxxxxxx/Desktop/newdsdt.dsl — 5605 lines, 200012 bytes, 2732 keywords

Compilation complete. 4 Errors, 0 Warnings, 0 Remarks, 2 Optimizations

Понравилась статья? Поделить с друзьями:
  • Case clause error rabbitmq
  • Cas ошибка клемма 50
  • Cas sw05 error 1
  • Cas sw 05w error 1
  • Cas cl5000j ошибка ацп