14 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

9 comments

  1. [2]
    ahq
    Link
    Hummingbard development is picking up again after a slow few weeks. There is a live instance running on hummingbard.com and the code is here. I've also written an introductory post about it,...

    Hummingbard development is picking up again after a slow few weeks. There is a live instance running on hummingbard.com and the code is here.

    I've also written an introductory post about it, explaining some of the features, and the underlying Matrix concepts.

    Hummingbard is essentially decentralized communities built on top of Matrix. You can think of it as Mastodon/Lemmy alternative, with social community posts, galleries, blogs and a ton of other stuff. I built Gurlic a while back, which had a half-baked Matrix setup, but I wanted to take it to the next level and build truly decentralized/federated communities. Gurlic will be switching over to being a Hummingbard instance once I've worked out a migration strategy.

    Matrix is exciting - I'm fairly invested into the ecosystem right now, and working on another major Matrix-based project. I'll post about that here when it's ready...

    9 votes
    1. PopeRigby
      Link Parent
      Nice to see you on Tildes. I learned about Hummingbard from TWIM, and jumped on it right away. I'm excited to see where you take it.

      Nice to see you on Tildes. I learned about Hummingbard from TWIM, and jumped on it right away. I'm excited to see where you take it.

      5 votes
  2. psi
    (edited )
    Link
    I've been stuggling with getting 4K performance from Stadia. As to how I managed to get myself into this mess, I received a free Stadia controller from a Youtube Music promotion as well as a few...

    I've been stuggling with getting 4K performance from Stadia. As to how I managed to get myself into this mess, I received a free Stadia controller from a Youtube Music promotion as well as a few months of Stadia Pro from some other promotions. I figured this would be the perfect excuse to give Ys VIII a try.

    For those who don't know (which is probably everybody -- let's be real, who uses Stadia anyway?), 4K support is currently blocked on Linux since 4K streaming requires VP9 hardware decoding. Although this is apparently enabled by default on Windows and Mac, that is not the case on Linux.

    After a bit of googling, the workaround basically amounts to this:

    1. Enable hardware acceleration/VA-API support on Linux
    2. Change some chrome flags
    3. Use a chrome extension (Stadia+ [1]) to force Stadia to use the VP9 decoder and stream at a higher resolution

    1. Enable video acceleration

    Easy: the arch wiki has instructions on how to do this for Intel, Nvidia, and AMD graphics. I use an AMD graphics card, so I followed the respective steps.

    2. Change some Chrome flags

    Here's where things started to get a more complicated. The relevant information here was a bit more scattershot, but between the arch wiki and random forums, I managed to find some flags that I hoped would force VP9 decoding/hardware acceleration. I added the following flags to my ~/.config/chrome-flags.conf file.

    --use-gl=desktop # forces Chrome to launch with VA-API support (if using xorg)
    --ignore-gpu-blocklist # override Chrome's attempt to disable some graphics cards
    --enable-features=VaapiVideoDecoder # forces Chrome to use the V9 decoder
    --disable-gpu-driver-bug-workarounds # sometimes helps
    --enable-gpu-rasterization # not really sure, but it was recommended by the arch wiki article
    --enable-zero-copy # same
    --disable-features=Vulkan # Sometimes causes errors
    

    Next I checked chrome://gpu to see whether hardware acceleration had been enabled. And... nope! In fact, the logs indictated the GPU failed to initialize properly. I spent a couple days on-and-off googling the error and enabling/disabling various combinations of the above flags. I tried skipping this step and seeing whether I could just use the Stadia+ extension anyway, but then my performance was locked at 720p. That was a step in the opposite direction.

    2.5. The breakthrough?

    Eventually, a few lines on the chrome://gpu page caught my eye.

    GPU0	VENDOR=0x10de, DEVICE=0x1e84 *ACTIVE*
    GPU1	VENDOR=0x1002, DEVICE=0x699f 
    

    Wait, I thought, is that the right GPU? After digging up a script to check the vendor/device ids of my graphics cards, I had verified that it was not.

    #!/bin/bash
    shopt -s nullglob
    for g in /sys/kernel/iommu_groups/*; do
        echo "IOMMU Group ${g##*/}:"
        for d in $g/devices/*; do
            echo -e "\t$(lspci -nns ${d##*/})"
        done;
    done;
    
    IOMMU Group 16:
    	01:00.0 VGA compatible controller [0300]: Nvidia Corporation TU104 [GeForce RTX 2070 SUPER] [10de:1e84] (rev a1)
    IOMMU Group 20:
    	02:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] [1002:699f] (rev c7)
    

    You see, I have two graphics cards in my computer: an Nvidia card to pass through to a Windows VM for gaming [2] and an AMD card for my host's desktop manager. Chrome, inexplictably, tried to use the Nvidia card for hardware acceleration despite the Nvidia driver being stubbed by vfio-pci. The intersection between people who care about Stadia on Linux and people who use VFIO must be infinitesimally small, hence my lack of success in finding people who could commiserate with my issues. But once I knew what the problem was, I managed to find at least one other person who struggled as I did [3]. That person submitted a bug report in 2017 that remains unaddressed today. sigh

    But there was at least a hint here: since Chrome knew the vendor/product id of my graphics card, it stood to reason that I would be able to specify to Chrome which card to use. Indeed, there does exist such a flag -- in fact, there exist multiple ones [4]! So I tried using all of them simultaneously.

    --gpu-active-vendor-id=0x1002 
    --gpu-active-device-id=0x699f
    
    --gpu-vendor-id=0x1002 
    --gpu-device-id=0x699f
    
    --gpu-testing-vendor-id=0x1002 
    --gpu-testing-device-id=0x699f
    

    It didn't work. So instead I tried just using the last two, as recommended by the person in the forum post. Again, no dice1.

    3. The chrome extension: the actual breakthrough?

    At this point, I decided to just pass the --disable-gpu flag to Chrome. Unsurprisingly, Chrome now started up a bit faster since it no longer failed to load the Nvidia gpu. I was about to give up at this point when I serendipitously came across a reddit post asking which extension is superior: Stadia+ or Stadia Enhanced [5].

    Stadia Enhanced? I didn't know there was an alternative! So I added the --enable-features=VaapiVideoDecoder flag back to Chrome, installed the extension, and launched the game with the network monitoring tool.

    And... it worked! The game streamed at 4K! Despite what I had read, hardware acceleration wasn't actually needed. In fact, all I really needed was a different extension.

    So now I could finally play Ys VIII! I attempted to connect my Stadia controller to the browser.

    And I attempted again.

    And I attempted again...

    ....

    Final thoughts

    Fuck you Stadia.


    1 Or so I thought? Mysteriously, now it's working! That said, it's not actually needed for 4K Stadia streaming.


    [1] https://chrome.google.com/webstore/detail/stadia%20-extension/bbhmnnecicphphjamhdefpagipoegijd?hl=en
    [2] https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
    [3] https://bbs.archlinux.org/viewtopic.php?id=224654
    [4] https://superuser.com/questions/1319250/how-to-force-chrome-to-use-integrated-gpu-for-decoding
    [5] https://chrome.google.com/webstore/detail/stadia-enhanced/ldeakaihfnkjmelifgmbmjlphdfncbfg?hl=en

    6 votes
  3. acdw
    Link
    I'm learning CL to try and participate in this spring's Lisp Game Jam -- it starts very soon so I'm kind of doing a crash course.

    I'm learning CL to try and participate in this spring's Lisp Game Jam -- it starts very soon so I'm kind of doing a crash course.

    3 votes
  4. [4]
    admicos
    Link
    Set up XMPP for me and family after Signal did the cryptocurrency mess, and from our limited use so far it seems to work well. I'll need to find an iOS client soon though, any advice on that? Also...

    Set up XMPP for me and family after Signal did the cryptocurrency mess, and from our limited use so far it seems to work well.

    I'll need to find an iOS client soon though, any advice on that?

    Also if there's any cool XMPP groups for stuff, let me know!

    ps: Android OEMs, plz stop your unnecessary battery saving crap, thx. Not sure how well notifications will work, and they're kinda important.

    3 votes
    1. [3]
      helloworld
      Link Parent
      I waited with my Moto Z Play patiently for years for a worthy successor. Then I realised it was false hope and I will be compromising every which way, so whyvwaste money. I just went and grabbed a...

      Android OEMs, plz stop your unnecessary battery saving cra

      I waited with my Moto Z Play patiently for years for a worthy successor. Then I realised it was false hope and I will be compromising every which way, so whyvwaste money. I just went and grabbed a Xiaomi, changed as many settings as I could find and called it another couple of years for a phone.

      3 votes
      1. [2]
        admicos
        Link Parent
        Unlock your bootloader and install an AOSP based ROM like LineageOS (assuming you don't use anything requiring SafetyNet). Works way better than any OEM ROM I know of.

        Unlock your bootloader and install an AOSP based ROM like LineageOS (assuming you don't use anything requiring SafetyNet). Works way better than any OEM ROM I know of.

        3 votes
        1. helloworld
          Link Parent
          I would love to. Unfortunately, banking in my country requires safety net. For now, I disabled everything unnecessary via and, disabled notifications for the rest and pretend that my phone is as...

          I would love to. Unfortunately, banking in my country requires safety net. For now, I disabled everything unnecessary via and, disabled notifications for the rest and pretend that my phone is as good as I want :)

          3 votes
  5. m15o
    Link
    After a few months discovering gopher, I went ahead and added support for it on midnight.pub. This makes the pub available on web, gemini and gopher. There’s no real reason why I did it besides to...

    After a few months discovering gopher, I went ahead and added support for it on midnight.pub. This makes the pub available on web, gemini and gopher. There’s no real reason why I did it besides to learn and have fun. Oh and if it makes accessing the content easier that’s great! :)

    2 votes