Claude writing a macOS driver for my obscure HP printer built only for Windows

110 pointsposted 4 hours ago
by porridgeraisin

41 Comments

nullify88

3 hours ago

On a similar experience, I use moonlight on my Android TV to stream video games from my computer in another room. I use my own fork from an unmerged PR which enables me to use an Xbox One Wireless adapter so I can play with my pad wirelessly. These pads have a 3.5mm jack on them which on Windows and Linux enables me to route audio from the game to headphones connected to the pad. Moonlight and the xow driver it bundled, was nowhere near being able to provide this as a feature.

After about 5 hours, feeding it the GIP spec, an export of sniffed usb traffic from Windows, prior art (xone driver for linux), and giving Claude connectivity to my Shield via adb, I had it working. This continuously blows my mind that I dont have to beg a developer on Github to do it for me.

Claude could do it for me for $20.

netruk44

3 hours ago

I have another controller-related anecdote.

I have a Razer Wolverine Xbox controller that has extra back paddle buttons. The controller doesn't expose the paddles directly to PC's over USB. You have to use button remapping on the controller to map them to 'real' Xbox buttons for the PC to see them. But I wanted to use the back paddle buttons on Steam as separate controls.

So I downloaded the latest firmware update off the internet (because what device doesn't have firmware updates these days), installed Ghidra and an MCP server for it, and told Sol to look for how I can expose these extra buttons to a PC host. Maybe we could write a firmware patch?

Turns out the controller already has a special mode to expose those buttons, possibly as a hardware test. But it was enough to write a Linux driver to put the controller into that mode, and a little bit of extra driver code to map the paddles to a Linux controller button, and voila. Paddles working in Steam.

And it only took a few hours to do, too. I spent more time making an open source repository out of the concept than I spent making it work.

rivetrune

an hour ago

What's the repository link? I think it would be fascinating to have a corpus of "hacked" solutions like this. Can't tell you how many times a couch co-op game night got sabotaged by some piece of hardware failing to communicate with another.

netruk44

15 minutes ago

The creatively-named https://github.com/Netruk44/wolverine-v3-pro-linux

The "linux" support is pretty narrow (because I made this for myself). It's restricted to SteamOS. But I'm sure it could be ported easily, the repository contains documentation about the important parts from reverse engineering the firmware.

matheusmoreira

32 minutes ago

> spec, an export of sniffed usb traffic from Windows, prior art

I used to feel proud of the fact I reverse engineered some of my laptop's features using stuff just like this. I suppose that's over.

nullify88

9 minutes ago

I suppose you can still be proud you did it during pre AI times and the gained knowledge by doing it yourself. I won't stop admiring Bunnie for his work on the Xbox or the effort to hack the ps3 crypto.

I don't expect Claude and other hosted AI's to be available so freely and thats when it'll get harder for me to do stuff like that.

jwr

3 hours ago

Freedom -- that's what it is. There are now more and more cases where we don't have to ask for permission.

Unfortunately, as I look around, I see most of the hardware vendors around me as gatekeepers. They prevent me from writing custom code in various ways. Apple restricts access to NFC or their UWB positioning, Supernote Manta does not let me access a bluetooth microphone, the list goes on. Denon at least has an API in their amps/receivers: buggy, but it's there.

ramijames

an hour ago

I think, from a business perspective, they just don't see us at all. We're such a small, inconsequential part of the market that building open, free hardware with code that we can update, change, or alter for our needs is just.. not part of their business use-case.

itchyouch

an hour ago

I hope that with AI, this becomes a far more compelling selling point that consumers demand.

seiferteric

an hour ago

I just fix a long standing bug on my Linux desktop I have had for years and kept meaning to look into to see if I could fix. The issue was I have a sound blaster katana sound bar and it works okay but the volume on the device is not in sync with the volume in Linux. In Windows it stays in sync. I can work around it by each time I boot, I press the button to go to max volume, then lower the volume in Linux to the desired level but it's been an annoyance. I described the issue to codex and within a few minutes it had it fixed by updating the pipewire device profiles to use the volume control it exposes. Honestly amazing since I doubt I would have ever gotten around to figuring this out since I didn't even know what level of the stack the issue was, I thought maybe it was in the driver itself.

brabel

25 minutes ago

You just gave me an idea to fix lots of little annoyances in my old Linux laptop that had been retired because of those! Maybe the old little laptop can still give me a few more years of fun.

pwython

an hour ago

I have actual obscure RGB corner floor lamps with BLE in my office. I had Claude find the BLE protocol and use my Office 365 calendar feed to change their color to red when I'm in a scheduled meeting (event), and back to warm white when the meeting is over, so co-workers know I'm busy without doing "are you busy" sign language through my window. The script is polled every 60 seconds. Tinkering with stuff like this is a lot of fun.

ano-ther

14 minutes ago

I wasn’t so lucky with my attempt for a Windows 11 driver for an old emaguc MT4 MIDI interface. It works on Macs, but no longer on PCs.

Claude worked for a while and then spun itself into a loop of making a mistake, correcting it, then making it again.

That was 9 months ago so perhaps I should try again.

jambalaya8

15 minutes ago

This is very very cool. But now it has me worried about device driver coders being out of work. Why pay for months of low level coding. Grumble.

asveikau

38 minutes ago

I'm pretty sure I've used that exact printer on Linux without issue. Long ago, deep into the pre ai era.

Edit: no, I was thinking of the older p1008.

aniceperson

21 minutes ago

from the screenshot, i believe it took the linux driver and transcribed to the mac kernel.

jorl17

2 hours ago

Recently, I had bizarre situation: I wanted to play a game from my childhood on Windows 11, but, without changing two booleans in the settings, I could not reliably move my in-game cursor. The catch is that to change those values in the settings, I needed to move my in-game cursor. So I was stuck.

After digging around, I found a file that looked like it could be the settings file, but it was not plaintext.

Naturally, I told Claude all the options I knew existed in the settings and told it what I needed it to change.

After about 10 minutes poking around my system and the file, it correctly identified the bits (not bytes!) that corresponded to the two settings, and flipped them on. It. Just. Worked!

(Well, then I found out I actually needed to do quite a lot more than flipping those bits, but I still found it worth sharing).

I have many more experiences similar to these. LLMs are an amazing superpower.

txomon

2 hours ago

I have a similar experience. I'm playing minecraft lately and I have patched already like 5 issues in the server that I would never put together time to trace/debug/understand/fix, including some o(n^3) integration between mods that was lagging the server. Same thing for utilities, managing backups, etc.

jorl17

16 minutes ago

I've said this time and time again but with LLMs I got the joy of being a little kid learning to code and build stuff again. I haven't had such a custom-built setup since my earliest college days, because I had lost the time to tinker and looked for stuff that just worked. Now tinkering is so much easier that I mod the software I use all the time as well.

For example, I needed to change something in a particular function of firefox (which was in and of itself an amazing claude adventure to find that solved a problem I've had for well over 2 years), but only that very specific function.

I didn't want to fork firefox and have to constantly rebuild it just because of this one function. So I setup an LD_PRELOAD (well, not LD_PRELOAD, but the macOS equivalent) trick that injects only my modified function, as well as a full mechanism that traps firefox's auto-update process to reinject/re-arm the LD_PRELOAD trick into newer versions. I've had it going on for 3 months without any issues.

I counted and I have about 18 custom built apps ranging from "full blown swift GUI" to "tiny helper script" that have really changed how I interact with my computers for the better. It's so cool to be living this revolution.

1970-01-01

3 hours ago

Obscure? Sir, the printer is sold on Amazon. It is not obscure.

m4rtink

an hour ago

I've seen this explained as LLMs being well - language models. Driver binaries are just a language understood by the machine executing the binary. While its basically unreadable for normal humans, it is just another language for LLMs & they are able to operate on it, changing the result & translating it (e.g. correlating with specs, logs, docs, etc.).

Given the positive results from what I've heard, this might be actually one are where LLMs could prove useful for once.

swerner

an hour ago

I tried to get Copilot to port the Linux drivers for my HP CP1025 to macOS, but it failed. Even modern Linux can’t print to it any more, I had to put an older distribution on a RasPi and now I’m printing at reduced quality.

It was crazy how the LLM held on to outdated information. It suggested so many things that might have worked on an older macOS but very obviously wouldn’t nowadays. It also tried to port from Linux for a while until it eventually discovered that cups on Linux didn’t support that printer either.

joshmarinacci

2 hours ago

I was able to get Claude to write an embedded Rust driver for an unsupported epaper screen in a couple of hours by providing it with the spec and some existing C drivers. It’s still not as fast as the arduino versions, but it let me make progress in a project that I’d been stuck on for months.

Reverse engineering seems like an AI sweet spot.

ramijames

an hour ago

In general I've been really happy to leverage Claude to quickly build software that only I use. It fits my needs exactly and I don't have to worry so much about how others will use it, if it is generalized enough, if the documentation is up to date, etc.

It's kind of nice.

foodandart

3 hours ago

Nice! I've an ML-1710 that is sitting in a closet that I'd love to get properly working on macOS. I've tried with SPLIX and followed the directions to the letter to install the drivers, but it just doesn't stick, in that I can only manage to get one print queue through the device for each time the computer is turned on. I gave up and repaired a junked Epson and put that into service, but I really prefer the formar printer for making line tenplates.

qarl2

3 hours ago

Yeah. I have a Stratasys J55 3D printer. Industrial and closed.

And now I can print to it via my Mac.

It's a fun time to be alive.

cushychicken

2 hours ago

I love seeing things like this. Is it not kind of a magical thing to see AI make stuff like this reality? This was always possible but not worth a human’s time. Now this guy has a working printer again. That’s pretty doggone neat.

amelius

4 hours ago

Next try writing a printer driver for your iPhone.

kotaKat

3 hours ago

if you shoehorn it into CUPS you might as well just expose CUPS on your home network and use AirPrint via IPD at that point ;)

Razengan

an hour ago

If you see articles from old computing magazines or TV shows in the 1980s (there’s some good rabbit holes on YouTube), the prevailing optimism was that everyone would have a computer in their kitchen and write their own programs for whatever they need to do..

But programming languages and operating system fragmentation didn’t let that really take off

Maybe now that original promise of personal computers can be realized :)

Imagine instead of going to the App Store, just telling ChatGPT etc to make a custom app and run it right away on your phone

thewebguyd

39 minutes ago

That'd be an interesting future for sure but first we need Google to stop their power trip of needing to ID you before you can install an app on your phone, and likewise Apple will never allow that either without paying the Apple tax.

I feel like both Google and Apple see that future, and are now actively working to make sure it can't happen to protect their app store commissions.

finchisko

2 hours ago

I would like to see driver for my samsung printer. Drivers for mac was only for some very old macOS

2dahg

2 hours ago

Performing Stallman's stunt. Cool story bro, but unverified. Guy is marketing AI on X with an "attention is all you need" picture etc.

nerevarthelame

an hour ago

I'm all for being skeptical, but it doesn't take too much digging to find the proof (it's in the original tweet thread): https://github.com/Kuberwastaken/hp-laser-1008a-macos

mariuolo

22 minutes ago

But it's not completely native, it's a wrapper around the original linux driver (or parts thereof) running in a container.

Still better than nothing.

AH36

12 minutes ago

That runs the original HP driver in a Docker container, using two minuscule Python scripts.

Bro is marketing it as a (native) MacOS driver.

leecommamichael

4 hours ago

"HP" "obscure"

Cool nonetheless.

kotaKat

3 hours ago

sliiiiightly obscure in that it seems to use the ULD drivers (or a variant of); HP's "unified linux driver" that talks Samsung's printing language. it's weird.

https://wiki.debian.org/CUPSPrintQueues#hpuld

claude seems to have realized it was one of the samsung printer variants and just shoehorned in a samsung MFP driver to the OS.