• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

xenobrain

Recruit
57 Badges
Jun 25, 2010
2
7
  • Europa Universalis III Complete
  • Heir to the Throne
  • Tyranny - Bastards Wound
  • Cities: Skylines Deluxe Edition
  • Pillars of Eternity
  • Magicka 2
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • BATTLETECH
  • Surviving Mars
  • Tyranny - Tales from the Tiers
  • War of the Roses
  • Age of Wonders III
  • Age of Wonders
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • BATTLETECH: Flashpoint
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Crusader Kings III
  • Knights of Pen and Paper +1 Edition
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III
  • Impire
  • Europa Universalis III Complete
  • Cities: Skylines
  • Leviathan: Warships
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars II
  • Teleglitch: Die More Edition
  • Victoria 2
  • Warlock: Master of the Arcane
Short summary of your issue Stutting performance

Game Version 1.0.2

What OS are you playing on?
Linux

What platform are you using?
Steam

Do you have mods enabled? No

Have you tried verifying your game files (Steam only)?
Yes

How much "pain" is this causing you?
10

Please explain the issue you experienced in the most condensed way possible
Half second stutters every two seconds, including in menu. No difference fullscreen or windowed mode. No difference in performance settings.

Please explain how to reproduce the issue
Launch the game

Is there anything else you think could help us identify/replicate the issue?
System:
Arch Linux 64-bit. Intel Core i9-9900k. Nvidia Geforce RTX 2080Ti w/ proprietary drivers. KDE Plasma desktop. All software up to date as of 9/1/2020.
 

Attachments

  • lshw.txt
    28 KB · Views: 0
  • 6
  • 1Like
Reactions:
Upvote 0

salted-fry

Recruit
43 Badges
Oct 16, 2014
8
14
  • Crusader Kings II
  • Cities: Skylines Deluxe Edition
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria: Revolutions
  • Magicka
  • Cities in Motion 2
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • BATTLETECH
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Crusader Kings III
  • Hearts of Iron IV: Expansion Pass
  • Prison Architect
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Magicka 2
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Cities: Skylines
  • Victoria 2
  • Europa Universalis IV
WORKAROUND: (warning: this is super hacky)
Remove your access to /dev/input. On my machine, I was able to do this by doing sudo chmod o-rx /dev/input/, thereby denying CK3 the permissions to read that directory.

After making this change, my computer seems to be a whole lot happier. (I still only get like 30FPS, but that's probably just because my machine is a bucket of rust these days)

This may break other stuff; in particular, I think it will probably break gamepad input in other games, if you care about that. If so, you should be able to restore to previous state by doing doing sudo chmod o+rx /dev/input/. You can also probably just reboot to restore it - I don't think this will persist across reboots.
 
  • 5Like
Reactions:

f00z

Private
55 Badges
Dec 17, 2018
10
5
  • Stellaris: Lithoids
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Federations
  • Crusader Kings III
  • Cities: Skylines - Green Cities
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Prison Architect
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Cities: Skylines - Snowfall
  • Europa Universalis IV
  • Stellaris: Necroids
  • The Showdown Effect
  • Warlock: Master of the Arcane
  • Cities: Skylines
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Magicka
  • Europa Universalis IV: Res Publica
  • Stellaris - Path to Destruction bundle
WORKAROUND: (warning: this is super hacky)
Remove your access to /dev/input. On my machine, I was able to do this by doing sudo chmod o-rx /dev/input/, thereby denying CK3 the permissions to read that directory.

After making this change, my computer seems to be a whole lot happier. (I still only get like 30FPS, but that's probably just because my machine is a bucket of rust these days)

This may break other stuff; in particular, I think it will probably break gamepad input in other games, if you care about that. If so, you should be able to restore to previous state by doing doing sudo chmod o+rx /dev/input/. You can also probably just reboot to restore it - I don't think this will persist across reboots.

lol was just thinking of the implications of limiting access since the timing of the "fails" seemed minimal on the non-existent device paths it hit. Hoping the devs have enough to run with and fix the root cause. Thanks again for the leg work and workaround in the meantime!
 

BrunoFilipe

Corporal
30 Badges
Nov 24, 2014
28
6
  • Crusader Kings II: Charlemagne
  • Stellaris
  • Sword of the Stars
  • Europa Universalis IV: Res Publica
  • Magicka
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Crusader Kings III
  • Europa Universalis IV
  • Prison Architect
  • Shadowrun Returns
  • Age of Wonders III
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Cities: Skylines - After Dark
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Warlock 2: The Exiled
I'll be waiting a few days for a hotfix before refunding this one but I really expected to be able to play at release. Guess I shouldn't had high expectations considering how Paradox treats Linux.
 
  • 2
  • 1Like
Reactions:

nikolayber3

Recruit
58 Badges
Aug 13, 2020
3
3
  • Stellaris: Digital Anniversary Edition
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Pre-order
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Knights of Honor
  • Europa Universalis IV: Third Rome
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cradle of Civilization
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Crusader Kings III
  • For the Motherland
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Cities: Skylines
WORKAROUND: (warning: this is super hacky)
Remove your access to /dev/input. On my machine, I was able to do this by doing sudo chmod o-rx /dev/input/, thereby denying CK3 the permissions to read that directory.

After making this change, my computer seems to be a whole lot happier. (I still only get like 30FPS, but that's probably just because my machine is a bucket of rust these days)

This may break other stuff; in particular, I think it will probably break gamepad input in other games, if you care about that. If so, you should be able to restore to previous state by doing doing sudo chmod o+rx /dev/input/. You can also probably just reboot to restore it - I don't think this will persist across reboots.
Can you explain where do I do this? If I use this command in ck3 console it says "unknown command", if I use it in CMD, is sasys "no command starts with sudo". Help a computer noob to fix the game
 
  • 1
Reactions:

LuPoNe

First Lieutenant
95 Badges
Jun 15, 2017
217
133
  • Age of Wonders: Planetfall - Revelations
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Necroids
  • BATTLETECH: Flashpoint
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Knights of Pen and Paper 2
  • BATTLETECH
  • Crusader Kings III: Royal Edition
  • Pillars of Eternity
  • Surviving Mars
  • BATTLETECH: Heavy Metal
  • Cities: Skylines - Campus
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Knights of Pen and Paper +1 Edition
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Shadowrun: Hong Kong
  • Crusader Kings III
  • Europa Universalis 4: Emperor
  • Surviving Mars: Digital Deluxe Edition
  • BATTLETECH - Digital Deluxe Edition
  • Stellaris: Federations
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Conclave
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
Can you explain where do I do this? If I use this command in ck3 console it says "unknown command", if I use it in CMD, is sasys "no command starts with sudo". Help a computer noob to fix the game

1) you should be on Linux
2) you should input these commands in the Linux terminal, not the CK3 console :)
 

dex_sda

Recruit
30 Badges
Mar 19, 2020
2
2
  • Crusader Kings II: Way of Life
  • Crusader Kings III
  • Stellaris: Federations
  • Crusader Kings II: Holy Fury
  • Stellaris: Megacorp
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Stellaris: Apocalypse
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Magicka 2
  • Pillars of Eternity
  • Crusader Kings II
  • Europa Universalis III: Collection
  • Teleglitch: Die More Edition
  • Semper Fi
  • Magicka
  • Heir to the Throne
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Divine Wind
  • Europa Universalis III
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
I can confirm that I am having the exact same issue, and limiting access to /dev/input/ directory solves it instantly, as in, I can see the framerate dip every few seconds, then execute the command and have it lock at 144fps (the max on my display) as expected.
 
  • 2Like
Reactions:

Sturmreiter

Recruit
68 Badges
Nov 20, 2016
6
0
  • Cities: Skylines - After Dark
  • Hearts of Iron III
  • Hearts of Iron IV: La Resistance
  • Crusader Kings II: Conclave
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Ancient Relics
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Distant Stars
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Cradle of Civilization
  • Cities: Skylines - Parklife
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife Pre-Order
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Stellaris: Federations
  • Cities: Skylines - Campus
  • Surviving Mars: First Colony Edition
  • Stellaris: Lithoids
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Victoria 2
  • Europa Universalis IV: Dharma
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Stellaris: Megacorp
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II: The Republic
I can also confirm that the workaround worked for me as well. I haven't noticed any problems with anything else on my system, although I don't use gamepads normally so that probably doesn't mean much. Thank you for finding a solution, I would have had to play on Windows otherwise.
 

ElricleNecro

Recruit
115 Badges
May 27, 2016
4
2
  • Europa Universalis 4: Emperor
  • Age of Wonders III
  • Imperator: Rome - Magna Graecia
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Necroids
  • Europa Universalis IV
  • Stellaris: Federations
  • Ancient Space
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Crusader Kings III
  • Cities in Motion 2
  • Victoria 2
  • Cities: Skylines
  • Age of Wonders
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Way of Life
  • Crusader Kings II: The Old Gods
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • BATTLETECH: Season pass
  • Crusader Kings II: Rajas of India
  • Mount & Blade: Warband
  • Crusader Kings II: The Republic
  • Cities: Skylines - Parklife
  • Magicka 2: Ice, Death and Fury
  • Stellaris: Apocalypse
  • Europa Universalis IV: El Dorado
  • Europa Universalis III
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Jade Dragon
  • Stellaris: Lithoids
  • BATTLETECH: Heavy Metal
  • Hearts of Iron IV: Cadet
  • Prison Architect
  • Cities: Skylines - Campus
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Sunset Invasion
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Dharma
The workaround worked for me. Interesting to note : it also work for Imperator Rome (the problem is the same it seems).

In case of, I link my lshw.txt.
 

Attachments

  • lshw.txt
    25 KB · Views: 0

Cederstronk

QA Director
Paradox Staff
QA
Aug 20, 2020
131
46
Hey everyone,

Thank you so much for your lshw.txts and for uploading a video of the stuttering - this really helps our team as we've not been able to reproduce it fully on our end at this moment. Also, thanks for sharing the workarounds so that people can enjoy the game while we're trying to resolve the issue on our end.

We've logged this issue on our bug database and will continue to monitor the issue - I'll not lock the thread though, in case there's further developments with the workaround-troubleshooting.

Thanks again everyone,
Cederstronk
 
  • 6Like
Reactions:

Nellodee

Recruit
62 Badges
Sep 3, 2020
1
8
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Third Rome
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Stellaris: Necroids
  • Knights of Pen and Paper +1 Edition
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Cities in Motion
  • Magicka
  • Europa Universalis IV: Res Publica
  • Teleglitch: Die More Edition
  • Warlock: Master of the Arcane
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Mount & Blade: Warband
  • Pillars of Eternity
  • Magicka 2
I've been having this issue as well and Euphorya's workaround works well for me.

It looks like the source of the slow /dev/input iteration is IsJoystick in SDL (see below). If SDL_USE_LIBUDEV is disabled this fallback implementation (which polls the /dev/input tree every 3 seconds) gets used over just checking for any available evdev events while detecting joystick devices. Maybe all that is needed to fix this is to build SDL with SDL_USE_LIBUDEV enabled?

Thanks for Linux support, hopefully this helps you narrow down a fix.

C:
static void
LINUX_JoystickDetect(void)
{
#if SDL_USE_LIBUDEV
    SDL_UDEV_Poll();
#else
    const Uint32 SDL_JOY_DETECT_INTERVAL_MS = 3000;  /* Update every 3 seconds */
    Uint32 now = SDL_GetTicks();

    if (!last_joy_detect_time || SDL_TICKS_PASSED(now, last_joy_detect_time + SDL_JOY_DETECT_INTERVAL_MS)) {
        struct stat sb;

        /* Opening input devices can generate synchronous device I/O, so avoid it if we can */
        if (stat("/dev/input", &sb) == 0 && sb.st_mtime != last_input_dir_mtime) {
            DIR *folder;
            struct dirent *dent;

            folder = opendir("/dev/input");
            if (folder) {
                while ((dent = readdir(folder))) {
                    int len = SDL_strlen(dent->d_name);
                    if (len > 5 && SDL_strncmp(dent->d_name, "event", 5) == 0) {
                        char path[PATH_MAX];
                        SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", dent->d_name);
                        MaybeAddDevice(path);
                    }
                }

                closedir(folder);
            }

            last_input_dir_mtime = sb.st_mtime;
        }

        last_joy_detect_time = now;
    }
#endif

    HandlePendingRemovals();

    SDL_UpdateSteamControllers();
}

static int
IsJoystick(int fd, char **name_return, SDL_JoystickGUID *guid)
{
    struct input_id inpid;
    Uint16 *guid16 = (Uint16 *)guid->data;
    char *name;
    char product_string[128];

#if !SDL_USE_LIBUDEV
    /* When udev is enabled we only get joystick devices here, so there's no need to test them */
    unsigned long evbit[NBITS(EV_MAX)] = { 0 };
    unsigned long keybit[NBITS(KEY_MAX)] = { 0 };
    unsigned long absbit[NBITS(ABS_MAX)] = { 0 };

    if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) ||
        (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) ||
        (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) {
        return (0);
    }

    if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
          test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit))) {
        return 0;
    }
#endif

    if (ioctl(fd, EVIOCGID, &inpid) < 0) {
        return 0;
    }

    if (ioctl(fd, EVIOCGNAME(sizeof(product_string)), product_string) < 0) {
        return 0;
    }

    name = SDL_CreateJoystickName(inpid.vendor, inpid.product, NULL, product_string);
    if (!name) {
        return 0;
    }

#ifdef SDL_JOYSTICK_HIDAPI
    if (!IsVirtualJoystick(inpid.vendor, inpid.product, inpid.version, name) &&
        HIDAPI_IsDevicePresent(inpid.vendor, inpid.product, inpid.version, name)) {
        /* The HIDAPI driver is taking care of this device */
        SDL_free(name);
        return 0;
    }
#endif

    FixupDeviceInfoForMapping(fd, &inpid);

#ifdef DEBUG_JOYSTICK
    printf("Joystick: %s, bustype = %d, vendor = 0x%.4x, product = 0x%.4x, version = %d\n", name, inpid.bustype, inpid.vendor, inpid.product, inpid.version);
#endif

    SDL_memset(guid->data, 0, sizeof(guid->data));

    /* We only need 16 bits for each of these; space them out to fill 128. */
    /* Byteswap so devices get same GUID on little/big endian platforms. */
    *guid16++ = SDL_SwapLE16(inpid.bustype);
    *guid16++ = 0;

    if (inpid.vendor && inpid.product) {
        *guid16++ = SDL_SwapLE16(inpid.vendor);
        *guid16++ = 0;
        *guid16++ = SDL_SwapLE16(inpid.product);
        *guid16++ = 0;
        *guid16++ = SDL_SwapLE16(inpid.version);
        *guid16++ = 0;
    } else {
        SDL_strlcpy((char*)guid16, name, sizeof(guid->data) - 4);
    }

    if (SDL_ShouldIgnoreJoystick(name, *guid)) {
        SDL_free(name);
        return 0;
    }
    *name_return = name;
    return 1;
}
 
  • 8Like
Reactions:

kekekeks

Recruit
28 Badges
Nov 10, 2016
3
5
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Magicka
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Pre-order
  • Crusader Kings II
  • Crusader Kings III
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Shadowrun: Dragonfall
  • Europa Universalis IV: Golden Century
  • Prison Architect
  • Stellaris
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Age of Wonders III
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Common Sense
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV
Solved with this AppArmor profile that denies access to /dev/input/** specifically for CK3

/etc/apparmor.d/custom.ck3.202 :
Code:
# vim:syntax=apparmor

#include <tunables/global>


"/path/to/your/steam/steamapps/common/Crusader Kings III/binaries/ck3" {

  deny /dev/input rw,

  deny /dev/input/** rw,

  capability,

  network,

  mount,

  remount,

  umount,

  pivot_root,

  ptrace,

  signal,

  dbus,

  unix,

  file,

  deny /dev/input rw,

  deny /dev/input/** rw,

}

apply with
Bash:
sudo apparmor_parser -r /etc/apparmor.d/custom.ck3.202
 
  • 5Like
Reactions:

mrcool830

Private
75 Badges
Feb 4, 2010
19
11
  • Magicka 2 - Signup Campaign
  • Magicka
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Pre-order
  • Crusader Kings II
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Rights of Man
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Sons of Abraham
  • Cities in Motion 2
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Knights of Pen and Paper +1 Edition
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Hearts of Iron III: Their Finest Hour
  • Europa Universalis IV: Art of War
  • Hearts of Iron III
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Victoria 2
  • Europa Universalis IV
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Conclave
  • Cities: Skylines
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
I've been having this issue as well and Euphorya's workaround works well for me.

It looks like the source of the slow /dev/input iteration is IsJoystick in SDL (see below). If SDL_USE_LIBUDEV is disabled this fallback implementation (which polls the /dev/input tree every 3 seconds) gets used over just checking for any available evdev events while detecting joystick devices. Maybe all that is needed to fix this is to build SDL with SDL_USE_LIBUDEV enabled?

Thanks for Linux support, hopefully this helps you narrow down a fix.

C:
static void
LINUX_JoystickDetect(void)
{
#if SDL_USE_LIBUDEV
    SDL_UDEV_Poll();
#else
    const Uint32 SDL_JOY_DETECT_INTERVAL_MS = 3000;  /* Update every 3 seconds */
    Uint32 now = SDL_GetTicks();

    if (!last_joy_detect_time || SDL_TICKS_PASSED(now, last_joy_detect_time + SDL_JOY_DETECT_INTERVAL_MS)) {
        struct stat sb;

        /* Opening input devices can generate synchronous device I/O, so avoid it if we can */
        if (stat("/dev/input", &sb) == 0 && sb.st_mtime != last_input_dir_mtime) {
            DIR *folder;
            struct dirent *dent;

            folder = opendir("/dev/input");
            if (folder) {
                while ((dent = readdir(folder))) {
                    int len = SDL_strlen(dent->d_name);
                    if (len > 5 && SDL_strncmp(dent->d_name, "event", 5) == 0) {
                        char path[PATH_MAX];
                        SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", dent->d_name);
                        MaybeAddDevice(path);
                    }
                }

                closedir(folder);
            }

            last_input_dir_mtime = sb.st_mtime;
        }

        last_joy_detect_time = now;
    }
#endif

    HandlePendingRemovals();

    SDL_UpdateSteamControllers();
}

static int
IsJoystick(int fd, char **name_return, SDL_JoystickGUID *guid)
{
    struct input_id inpid;
    Uint16 *guid16 = (Uint16 *)guid->data;
    char *name;
    char product_string[128];

#if !SDL_USE_LIBUDEV
    /* When udev is enabled we only get joystick devices here, so there's no need to test them */
    unsigned long evbit[NBITS(EV_MAX)] = { 0 };
    unsigned long keybit[NBITS(KEY_MAX)] = { 0 };
    unsigned long absbit[NBITS(ABS_MAX)] = { 0 };

    if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) ||
        (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) ||
        (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) {
        return (0);
    }

    if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
          test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit))) {
        return 0;
    }
#endif

    if (ioctl(fd, EVIOCGID, &inpid) < 0) {
        return 0;
    }

    if (ioctl(fd, EVIOCGNAME(sizeof(product_string)), product_string) < 0) {
        return 0;
    }

    name = SDL_CreateJoystickName(inpid.vendor, inpid.product, NULL, product_string);
    if (!name) {
        return 0;
    }

#ifdef SDL_JOYSTICK_HIDAPI
    if (!IsVirtualJoystick(inpid.vendor, inpid.product, inpid.version, name) &&
        HIDAPI_IsDevicePresent(inpid.vendor, inpid.product, inpid.version, name)) {
        /* The HIDAPI driver is taking care of this device */
        SDL_free(name);
        return 0;
    }
#endif

    FixupDeviceInfoForMapping(fd, &inpid);

#ifdef DEBUG_JOYSTICK
    printf("Joystick: %s, bustype = %d, vendor = 0x%.4x, product = 0x%.4x, version = %d\n", name, inpid.bustype, inpid.vendor, inpid.product, inpid.version);
#endif

    SDL_memset(guid->data, 0, sizeof(guid->data));

    /* We only need 16 bits for each of these; space them out to fill 128. */
    /* Byteswap so devices get same GUID on little/big endian platforms. */
    *guid16++ = SDL_SwapLE16(inpid.bustype);
    *guid16++ = 0;

    if (inpid.vendor && inpid.product) {
        *guid16++ = SDL_SwapLE16(inpid.vendor);
        *guid16++ = 0;
        *guid16++ = SDL_SwapLE16(inpid.product);
        *guid16++ = 0;
        *guid16++ = SDL_SwapLE16(inpid.version);
        *guid16++ = 0;
    } else {
        SDL_strlcpy((char*)guid16, name, sizeof(guid->data) - 4);
    }

    if (SDL_ShouldIgnoreJoystick(name, *guid)) {
        SDL_free(name);
        return 0;
    }
    *name_return = name;
    return 1;
}
From looking at the ck3 binary and patching it for this issue specifically, I can confirm LINUX_JoystickDetect (can be found through the /dev/input string ref) is the function it was getting stuck inside. If I put a ret instruction at the start of it, the game runs just fine.
 
  • 1Like
Reactions:

Morholt

Recruit
101 Badges
Oct 9, 2009
8
2
  • Victoria 2: A House Divided
  • Leviathan: Warships
  • Cities in Motion
  • Majesty 2 Collection
  • March of the Eagles
  • Hearts of Iron IV: Field Marshal
  • Europa Universalis IV: Res Publica
  • Rome Gold
  • Europa Universalis IV: Mare Nostrum
  • The Showdown Effect
  • Victoria 2
  • Magicka
  • Victoria 2: Heart of Darkness
  • Warlock 2: The Exiled
  • Europa Universalis IV: Cossacks
  • Cities: Skylines Deluxe Edition
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Snowfall
  • Pillars of Eternity
  • Cities: Skylines - After Dark
  • Deus Vult
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Sword of Islam
  • Heir to the Throne
  • Darkest Hour
  • Dungeonland
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: El Dorado
  • 500k Club
  • War of the Roses
  • Europa Universalis IV
Same problem, also affects main menu and loading screens. Attached two sample screen captures to show the problem. Running Manjaro Linux.
 

Attachments

  • ck3stutter.zip
    3,4 MB · Views: 0
  • lshw.txt
    16,7 KB · Views: 0
  • 1Like
Reactions:

LuPoNe

First Lieutenant
95 Badges
Jun 15, 2017
217
133
  • Age of Wonders: Planetfall - Revelations
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Necroids
  • BATTLETECH: Flashpoint
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Knights of Pen and Paper 2
  • BATTLETECH
  • Crusader Kings III: Royal Edition
  • Pillars of Eternity
  • Surviving Mars
  • BATTLETECH: Heavy Metal
  • Cities: Skylines - Campus
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Knights of Pen and Paper +1 Edition
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Shadowrun: Hong Kong
  • Crusader Kings III
  • Europa Universalis 4: Emperor
  • Surviving Mars: Digital Deluxe Edition
  • BATTLETECH - Digital Deluxe Edition
  • Stellaris: Federations
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Conclave
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
I have been playing the whole weekend on my laptop to try and reproduce the issue, but I haven't noticed any stuttering (unless it's so quick I didn't recall it happening) while running my portable Linux SSD with Manjaro (latest updates), with KDE Plasma and latest NVidia hybrid drivers (NVidia/Intel) installed from the Manjaro repositories.

The laptop is an MSI P65 Creator 9SE (it has Windows on its default drives as it's the daily driver for work).

I'll try to post my lshw.txt as soon as possible and I'd like to try and reproduce the issue possibly (I had this thread open when I first ran the game to have the commands at hand in case of stuttering).
 
  • 1Like
Reactions:

Chairman Noob

Second Lieutenant
56 Badges
Nov 22, 2006
163
173
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - After Dark
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron III
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Crusader Kings II
  • Europa Universalis IV: Res Publica
  • Semper Fi
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
Did you check with strace wether it tries to do stuff in /dev/input/* all the time but gets "Access denied" or similar on all of them? That's what it does for me. Apparently if the game doesn't have access to these files (because they've been manually restricted and/or the user isn't in the input group) the check won't noticeably affect performance.
 

LuPoNe

First Lieutenant
95 Badges
Jun 15, 2017
217
133
  • Age of Wonders: Planetfall - Revelations
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Necroids
  • BATTLETECH: Flashpoint
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Knights of Pen and Paper 2
  • BATTLETECH
  • Crusader Kings III: Royal Edition
  • Pillars of Eternity
  • Surviving Mars
  • BATTLETECH: Heavy Metal
  • Cities: Skylines - Campus
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Knights of Pen and Paper +1 Edition
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Shadowrun: Hong Kong
  • Crusader Kings III
  • Europa Universalis 4: Emperor
  • Surviving Mars: Digital Deluxe Edition
  • BATTLETECH - Digital Deluxe Edition
  • Stellaris: Federations
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Conclave
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
Did you check with strace wether it tries to do stuff in /dev/input/* all the time but gets "Access denied" or similar on all of them? That's what it does for me. Apparently if the game doesn't have access to these files (because they've been manually restricted and/or the user isn't in the input group) the check won't noticeably affect performance.

I've just started again to entertain myself in Linux, so I wouldn't know how to keep an eye for that / how to check that (I really would like to help however I can, given my newfound love for Linux in general)
 

LuPoNe

First Lieutenant
95 Badges
Jun 15, 2017
217
133
  • Age of Wonders: Planetfall - Revelations
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Necroids
  • BATTLETECH: Flashpoint
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Knights of Pen and Paper 2
  • BATTLETECH
  • Crusader Kings III: Royal Edition
  • Pillars of Eternity
  • Surviving Mars
  • BATTLETECH: Heavy Metal
  • Cities: Skylines - Campus
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Knights of Pen and Paper +1 Edition
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Shadowrun: Hong Kong
  • Crusader Kings III
  • Europa Universalis 4: Emperor
  • Surviving Mars: Digital Deluxe Edition
  • BATTLETECH - Digital Deluxe Edition
  • Stellaris: Federations
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Conclave
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
I confirm the issue being present also on my side, although I don't seem to get any performance hit.
I am running both Linux and the game off an external USB-C SSD, and following you can find both the STRACE and LSHW
 

Attachments

  • CK3 strace.txt
    36,7 KB · Views: 0
  • lshw.txt
    29,7 KB · Views: 0