8 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?

10 comments

  1. arqalite
    Link
    Trucking along at my partner's personal finance tracking app (more on it in an earlier post). I'm dogfooding the app so I can find and squash bugs when my partner isn't feeling like adding them to...

    Trucking along at my partner's personal finance tracking app (more on it in an earlier post).

    I'm dogfooding the app so I can find and squash bugs when my partner isn't feeling like adding them to the task tracker, and I realized I would never use the Goals page. Maybe adding a toggle to enable/disable it would be a good idea?

    One task that has sat on my kanban since I started the project is adding currency symbols and allowing each user to set them individually per account (but also per goal in the Goals page, alongside other units of measurement, since goals can also be non-financial in nature).

    It's probably time I handled it, so that's the goal this week - add a user settings page to set the global currency, and toggle Goals on/off.

    4 votes
  2. [3]
    lynxy
    Link
    This is probably not going to get much traction, but I need a place to rant. Why does it seem that the communities that surround the collaborative sharing of media always get stuck with one...

    This is probably not going to get much traction, but I need a place to rant.

    Why does it seem that the communities that surround the collaborative sharing of media always get stuck with one monopolising closed-source application that performs the same kind of hostile patterns that the original service that the community is trying to circumvent also performs?


    I've been looking into sourcing the firmware for the Sony Xperia line devices, because I have a Sony Xperia 1 VII which is rooted, and cannot be updated through the normal channels.

    The only real solution, apart from Sony's proprietary companion app, is a closed-source Windows-only .NET GUI application, which I used to be able to run on Linux using mono, but now that I am running a Wayland-based aarch64 device, I have no hope.

    I've spent the past week reverse engineering the Sony firmware endpoints so that I can create a Python script which can fetch any available firmware versions for any of the Sony Xperia line. In order to do so, you need the Hardware Variant ID, the Product Object ID, the Model Object ID, and the SPC (Sony Product Code).

    There exists an endpoint which can fetch a set of hardware variant objects, product objects, and model objects. Using the TAC code, which is the first 8 digits of a device's IMEI, you can navigate this data structure to build a dictionary containing the required IDs- except for the SPC. The SPC is a "secret" value. Each device has a number of hardware variants, for different carriers or localisations, and each hardware variant has a set of valid SPCs.

    There are many ancient discussions on the web about these SPCs- what they are, where they come from, lists of codes for each device, etc- but the most surefire way to get a comprehensive list is to probe (brute-force) the API using a set of valid IDs and a potential SPC pulled iteratively out of a pool. There are a number of hints that reduce this set, or inform you about iteration direction so that you can restrict the number of requests to a more sensible value.

    However- this closed source program must have a list, right? And indeed it does. Not built into the binary, of course, but fetched in AES encrypted form from the developer's domain, decrypted in secret, and referenced.


    What should be open and collaborative has instead been monopolised by a person who, from their online communications, seems to be an ass*.

    And so I've somehow taken it upon myself to, using my open source scripts, fetch all current (and future) versions of the Sony Xperia firmware and archive them in an openly accessible place. I've spun up a domain, set aside a number of terrabytes for storage, and I've decided upon a file structure and compression method which saves me at least a little space (a firmware archive can be some 4.8-5.8GB, and I can get that down to maybe ~3.8GB when compressed as a TAR.XZ archive).

    I'm also debating hosting an open REST API which allows for submitting and fetching a comprehensive set of device SPCs. If I can do anything to eliminate what I see as anti-user behaviour in this space, I will.


    * Does this situation seem familar? If it does, it might be because you've read my previous rant about exactly this same behaviour in the Blu-ray ripping community.

    4 votes
    1. [2]
      first-must-burn
      Link Parent
      This would have to mean that the decryption key is held by the binary, so you should be able to decompile the binary and find the key, unless it's obfuscated in some way. Not knowing much about...

      However- this closed source program must have a list, right? And indeed it does. Not built into the binary, of course, but fetched in AES encrypted form from the developer's domain, decrypted in secret, and referenced.

      This would have to mean that the decryption key is held by the binary, so you should be able to decompile the binary and find the key, unless it's obfuscated in some way. Not knowing much about how to do this in practice, I would think turning an AI loose on the problem would probably be productive, as long as the task doesn't trip the safeguards.

      You might also be able to instrument the memory of the closed source binary and read back the list after it has been decrypted.

      1 vote
      1. lynxy
        Link Parent
        It is! And I have already been approached by another user who has reverse engineered the algorithm by which you can fetch the key from the binary blob (it's wonderfully obfuscated), haha. However,...

        It is! And I have already been approached by another user who has reverse engineered the algorithm by which you can fetch the key from the binary blob (it's wonderfully obfuscated), haha. However, at this point I already have a comprehensive set of SPCs. I've also had another user offer firmware versions from their own Telegram-based archive, which I will need to validate against any versions that I already have that overlap to ensure that they have not been tampered with. It seems like I might end up with quite a comprehensive set of firmware versions for most of the recent (2020+) devices.

        2 votes
  3. text_garden
    Link
    As part of my software groovebox I have implemented an FM synth. Like most FM synths it achieves frequency modulation only as a side effect of modulating the phase of the carrier, by a different...

    As part of my software groovebox I have implemented an FM synth. Like most FM synths it achieves frequency modulation only as a side effect of modulating the phase of the carrier, by a different tone usually running at some multiple frequency of the carrier. Calculating the output waveform given phase counters for the carrier and modulator (m. phase and c. phase) as well as envelopes (m. envelope and c. envelope) looks something like this, for each sample:

    modulator = m. envelope * sin(m. phase)
    output = c. envelope * sin(c. phase + modulator * modulation index)
    

    Most FM synths, including mine, also implement feedback modulation. For every generated sample, you take the output of the previous value of the modulator, multiply it by a feedback factor and add it to the phase of the modulator in the modulator calculation. So:

    modulator = m. envelope * sin(m. phase + feedback factor * modulator)
    output = c. envelope * sin(c. phase + modulator * modulation index)
    

    That gives you an additional axis of control of the timbre. Brass sounds in FM synths typically rely heavily on this for example. The effect can be a bit harsh as you increase the feedback level, though, and the line between harsh noise and a desirable effect can be pretty thin, which isn't ideal for live use. Nevertheless, it's how my feedback loop worked so far.

    A friend of mine is working on a similar project for the Game boy advance (FMS), and I watched one of his videos about that where he described averaging the feedback to get a softer tone. I didn't quite get what he meant but got to experimenting. More interesting to find out for yourself and possibly discover a new technique.

    The result was eventually a one pole low-pass filter in the feedback loop:

    feedback = modulator * (1 - softness) + feedback * softness
    modulator = m. envelope * sin(m. phase + feedback factor * feedback)
    output = c. envelope * sin(c. phase + modulator * modulation index)
    

    When the softness factor is 0 it works as before. As it gets closer to 1, more and more of the previous feedback value is factored in, removing more high frequency content from the feedback signal loop. It's difficult for me to predict the results of something like this so I was happy to hear it sounded great and helps a lot with the feedback chaos problem, and even created a new kind of interesting pitch instability at higher feedback levels with near-1 softness. I couldn't decide on an ideal softness so I just left it exposed as another parameter.

    3 votes
  4. [3]
    skybrian
    Link
    I used a coding agent to build a website that I plan to use instead of GitHub gists. I'm using it mostly as a way to post charts and images. The motivation is that I got tired of using cut and...

    I used a coding agent to build a website that I plan to use instead of GitHub gists. I'm using it mostly as a way to post charts and images. The motivation is that I got tired of using cut and paste to copy HTML from ChatGPT to a gist, so now the AI can do a push instead.

    It's a static website on Netlify, which automatically deploys updates when the git repo changes. I have a preview website in a Linux VM on exe.com and ask the AI to push to GitHub when a new page is ready.

    It's boring technology and an overly-elaborate way to publish five web pages. I wouldn't have bothered if it weren't easy to do with AI.

    Maybe it will evolve into a blog or something.

    2 votes
  5. tomf
    Link
    not very technical, but I used scenedetect and some other stuff to pull the different shots from The Royal Tenenbaums, removed the dupes, then manually went through to pick out the 365 best shots....

    not very technical, but I used scenedetect and some other stuff to pull the different shots from The Royal Tenenbaums, removed the dupes, then manually went through to pick out the 365 best shots. I then pulled them all into one stack in photoshop, cropped the image to a square and aligned each frame as best I could.

    Next up I resized to 400x400 and compressed the shit out of them (15%) and every morning at 1am it updates my user photo on a mastodon instance with the next frame in the film. The total size for the images is 3.8M, average file size ~9K

    It'll take a year, but the gist of the movie is there... ish.

    2 votes
  6. IsildursBane
    Link
    So I have noticed that my Raspberry Pi Zero 2W+ based audio player has recently been struggling to connect to wifi networks and frequently drops the connnection. I tried disabling the network...

    So I have noticed that my Raspberry Pi Zero 2W+ based audio player has recently been struggling to connect to wifi networks and frequently drops the connnection. I tried disabling the network power saving mode, but that did not seem to solve the issue. So, with further research it seems like it is a hardware failure, which is somewhat common for the RPi. So now I am trying to research replacement solutions, to minimize it happening on a new RPi or a different SBC without that issue