• Category Archives Computers
  • PS5 Remote Play on Linux – Chiaki

    Chiaki – a remote-play client for PlayStation consoles.

    Overview

    While playing Undertale on my PS5, I got a bit frustrated at some of the trophies. Spending hours spamming the X button didn’t really feel like fun and rewording gameplay. A brief search later led me to discover a remote-play option called Chiaki for Linux. 10 minutes later I had it up-and-running! Impressive.

    The remote-play session can be controlled by keyboard, or a PS5 controlled can be connected to the PC. In my case, it was just plug-and-play.

    I tweaked the config a bit to use 1080p instead of the default 720p resolution, and to use hardware acceleration. I also added Chiaki to Steam and configured it to open Chiaki using gamemode as otherwise the screensaver was kicking in. Unfortunately the Steam overlay and screenshot facility is not working (yet).

    Worked absolutely brilliantly on my setup – gigabit LAN and a 1080p-based Debian GNU/Linux 12 desktop PC.

    It was then also rather trivial to script spamming the X button using xdotool..

    Issues

    Chiaki 2.2.0 – “Extended DualSense Support” crashes the remote play session, forcing a restart of the PS5 before remote play works again. To be fair, this feature is marked experimental.

    Remote Play of streaming content (eg, PlayStation Plus Premium classic games) shows a black screen, with the streamed content being displayed on the TV. Not sure if the official PlayStation remote play application has the same problem.

    Installation

    Core Installation

    The steps were pretty simple:

    1. Install Chiaki:
      1. apt-get install chiaki
    2. Retrieve account ID (NOT your login or username)
      1. I used a python script provided by the Chiaki developers.
      2. Here’s a reddit post describing an alternative quite convoluted approach (didn’t try it)
      3. And here’s a webpage which retrieves it – by far the easiest method! (This does NOT require you enter any login credentials, but does require your account to be publicly viewable.)
    3. Enter required data
      1. Account ID
      2. Code from the console
        1. Settings -> System -> Remote Play -> Link Device
    4. ?
    5. Profit!

    Optionally:

    • Add it to your Steam library
    • Run it using gamemode
    • Tweak configuration to use hardware acceleration and higher resolution

  • Upgrading Nextcloud 15 to 19 on Debian …

    So my Debian 9 server was still running Nextcloud 15. Meanwhile Nextcloud 20 is out.

    When I looked at performing the (manual) update I actually found a Nextcloud 16 download already in place but it seems I never completed that. Not long afterwards I discovered why – Nextcloud 16 requires PHP 7.3, but Debian 9 only has PHP 7.0 available.

    Long story short, instead of chimera’ing my Debian install I bit the bullet and decided to finally upgrade the server to Debian 10

    Some time later…

    After the server upgrade completed I was able to use the Nextcloud web interface to upgrade to Nextcloud 16.. and 17… and 18… and 19… and 20!

    That’s were the fun stopped, many things were broken in NC20 (apps just showing blank pages), so, having taken a backup between every upgrade, I rolled back to NC19 (incidentally validating that my backups worked).

    Most things worked out of the box. Critically for me, Grauphel did not.

    Long story short, it turns out that on Debian 10, the version of the PHP OAuth package is actually not compatible with the installed version of PHP 7.3! Installing a binary-compatible package from the Debian package snapshots site fixed this.

    Amongst other things I did during the upgrade cycles was:

    • changed the database to 4-byte suppport allowing for more characters in paths and comments.
    • fixed several other minor PHP configuration issues which Nextcloud was warning about.
    • fixed support for Maps (Nextcloud bug in the upgrade scripts left some database columns misconfigured:
      • Column name "oc_maps_address_geo"."object_uri" is NotNull, but has empty string or null as default.
      • The fix was to manually edit the scripts.
    • wrote backup scripts backing up the Nextcloud directory, the database, and, optionally, the data directory.


  • Upgrading Debian 9 to Debian 10

    Triggered by needing to upgrade Nextcloud, I finally bit the bullet and decided to upgrade my virtually-hosted Debian server from Debian 9 “stretch” to Debian 10 “buster”.

    The upgrade, as usual, was fairly trivial:

    apt-get update
    apt-get upgrade
    <edit /etc/apt/sources.conf to point to the new version>
    apt-get update
    apt-get upgrade
    apt-get full-upgrade
    reboot

    There were various configuration files which needed tweaking during and after the upgrade. vimdiff was very useful. I also learned a new screen feature – split-screen! (Ctrl-a – |). Finally a shoutout to etckeeper for maintaining a full history of all edits made in /etc.

    Post-upgrade Issues and Gotchas

    dovecot (imap server)

    A huge issue was that I could no longer access my emails from anywhere.

    Turns out that dovecot was no longer letting me log in. The mail log file had numerous “Can’t load DH parameters” error entries. I had not merged in a required change to the ssl certificate configuration.

    exim4 (mail server)

    The second huge issue was that exim was no longer processing incoming mail. Turns out that spamd wasn’t started after the reboot. Fixed by:

    systemctl start spamassassin.service
    systemctl enable spamassassin.service

    shorewall (firewall)

    Another major gotcha: the shorewall firewalls were not automatically re-enabled, and it took me three days to notice. Yikes! I had left the server on sys-v init instead of systemctl and the upgrade had silently switched over. After restarting the firewall, use systemctl enable to configure it to start on bootup.

    systemctl start shorewall.service
    systemctl enable shorewall.service
    systemctl start shorewall6.service
    systemctl enable shorewall6.service

    bind9 (name server)

    Another item was that bind was no longer starting up – it needed a tweak to the apparmor configuration. Appears that on my server the log files are written to a legacy directory and the new default configuration prevented bind from writing into it and hence failing to start up.

    Miscellaneous

    • I finally removed dovecot spam from syslog by giving it its own logfiles (tweaking fail2ban accordingly).
    • Various PHP options needed tweaking and several new modules needed installing to support Nextcloud (manually installed so no dependency tracking).

    Later Updates

    • Discovered that phpldapadmin was broken. Manually downloaded and installed an updated version from “testing”.

  • Gotcha when testing Unity Objects for null in C#

    Unity has overloaded the ‘==’ operator, specifically, checking objects against “null” might not always do what you expect. More information can be found in this blog post from Unity.

    Specifically, if a Unity Object (as opposed to a C# object) gets destroyed, it will be set to a “fake null” object.  In this case, the following statements are true:

    1
    2
    3
    4
    
        obj == null          // true    obj is null          // false
        (object)obj == null  // false
        obj ?? value         // obj

    Note the different results between lines 1 and  2 & 3.

    If obj truly is null, then the results are as expected:

    1
    2
    3
    4
    
        obj == null          // true
        obj is null          // true
        (object)obj == null  // true
        obj ?? value         // value

    It may be more readable to provide an Extension Method to UnityObject:

        /// <summary>
        /// Extension Method on Unity Objects returning whether the object really is null.
        /// </summary>
        /// Unity overloads the '==' operator so that it returns true on both null references
        /// as well as references to destroyed objects. This function only returns true if
        /// the reference truly is null, and returns false for "fake null" objects.
        public static bool IsTrueNull(this UnityEngine.Object ob)
        {
            return (object)ob == null;
        }