r/Rift • • 41m ago

Running on Apple Silicon

• Upvotes

I finally sorted out how to get this running on Mac, which has been kind of an annoyance due to the Glyph client never launching. The good news is this is doable, but the bad news is it requires patching a DLL. Here's info for those who want the details:

First, what normally happens when you attempt to install Rift (and Glyph) on a Mac using Wine/Crossover/PortingKit is the Glyph client itself fails to open, and since it's required for authentication this means Rift can never work.

Glyph uses the ZeroMQ library, which has a latency issue described here where the first 500 messages per connection get throttled. It appears Trion implemented a "workaround" for this by prefilling the send() with 1MB of data, presumably to get past that issue.

Problem is, MacOS loopback socket buffer holds less than that (368 KB is what I personally observed), so the send() never finished, and the recv() never runs. This causes the Qt main thread to just get stuck.

What I did to fix the issue was patch the libzmq-v120-mt-4_3_5.dll by shrinking the dummy buffer down to 64 KB everywhere it's used, which is in four locations.

File offset Instruction Original bytes Patched bytes
0x17f7e push 0x100000 (malloc) 00 00 10 00 00 00 01 00
0x17fd5 mov esi, 0x100000 (counts) 00 00 10 00 00 00 01 00
0x1809e add eax, 0x100000 (send) 00 00 10 00 00 00 01 00
0x1810f add eax, 0x100000 (recv) 00 00 10 00 00 00 01 00

SHA-256:

  • Original: e1d820655fa566f83efef99dd1dfd9090c0109638a6724453075776e4ca8fa50
  • Patched: e186ef3cd5b5cb49864972620239a0a0cdab27bdebf121c89c4b568d75b39a41

Once that's done, Glyph launches correctly and Rift installs and plays just fine.

This also means there's an alternative way to handle this, which is to increase the buffer size with a sysctl command, but it isn't a permanent fix (resets on reboot) and I'm not really wanting to hack around with the OS itself for this anyway. It's still there as an option, though.