• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

HLM, an open source homebrew Genelec GLM solution for volume control and more

robca

Member
Joined
Apr 13, 2021
Messages
52
Likes
60
Location
Seattle, WA
Just to be clear before starting: this is not meant as GLM replacement for room/speaker optimization. This is a limited function solution for volume control and a bit more. Also, this is an independent, open-source community project. It is not affiliated with, authorized, funded, or endorsed by Genelec Oy.

I own a pair of 8320A and a GLM interface but I always found it annoying have to use a $500 unit just for volume control. And remote volume control from a mobile device is impossible. I'm also planning to buy a new pair of Genelec speakers, and I see no reason to buy a second GLM to control volume in a separate room.

I'm an electronics engineer and Genelec speakers use a RS485 bus to communicate. How hard could it be to control the speakers directly? A bit harder than I expected, but not impossibly so.

I opened my GLM, connected a few probes to the RS 485 chip (an ADM 483) so that I could also capture the direction of a packet (from/to hub). I fired up my trusty oscilloscope and logic analyzer and after a few measurements and a custom pulseview protocol parser, I could figure out the physical protocol (9N2 @296 kbps, a non-standard speed). The GLM hardware is pretty simple, an STM32F407, a good quality ADC, a 24L01 wireless chip, and a RS485 interface. I captured a few logs with pulseview and my rickety stack of protocol decoders, feeding the data into a couple of LLMs. I was doing targeted operations (like changing volume 5 times, muting 3 times, etc, so the volume change or mute commands were easy to identify), and the LLMs did their magic. I could have decoded by hand, but it would have been much harder. LLMs are really good at parsing long streams of data. They made a few mistakes, but nothing I couldn't fix over time. I plan to write a primer on how to use LLMs to decode a protocol

GLM.jpg


The GLM protocol uses a non-standard 9-bit transmission at a non-standard speed, so that limited the choice of processors. But the STM32 family fully supports it, and STM32 boards are cheap and easy to find. Once I had a device that could reliably read the RS485 stream, I wrote a simple protocol dump, and with a few more sessions of LLM-aided investigation, I had a fully documented protocol.

For the 8320A, that is. I know that higher end speakers use more inputs, 96 kbps DSP (instead of 48 kHz like mine). So, if you want to donate an 8351 or similar speaker, I'm here :)

More details, full specs, schematics, and code available here: https://github.com/robcazzaro/hlm (over time I'll add a wiki with more details)

Please use this thread to ask questions, discuss features, report problems and banter in general. For a bug report or a real feature request, please open an issue in github. I can't promise anything, but I'll do my best to support anyone daring enough to build a device

One of the first things I plan to do (after I enjoy the newly gifted 83x1 speakers you will send me, that is :)) is to create a Home Assistant integration. I figured out a way to implement the unsupported 9-bit serial protocol on the ESP32 processors, explicitly for Home Assistant. And figure out an enclosure. Today it's more of a rat's nest of wires than anything else

stm32f407_integrated.jpg


I2C_Encoder.jpg
 
Last edited:
Very nice work!

I wrote the Python module gelnc 5 years ago, but shortly after some life events prevented me from working further on it. However a few weeks ago I picked up this work too, and worked on something very similar, an ESPHome module controlling Genelec SAM monitors, also directly over RS-485 this time:

https://github.com/markbergsma/espgensam

There are a lot of similarities between our projects, it's nice to read about the process you went through!. The peculiar Genelec 9-bit multidrop protocol was a bit to figure out to get to work on the ESP32, and I too ended up with a solution based on the ESP32's RMT support. I have based my solution on the M5Stack Atom S3 Lite + RS-485 base for now:

espgensam.jpg


Because espgensam is based on ESPHome, it has Home Assistant integration as well. It does the basics, turning on/off the speakers, volume control, mute, source selection (analog/AES3), etc.

Screenshot 2026-09-19 at 11.20.44.png


I've been using this with my Genelec SAM 8330s and 7350 subwoofer for the past few weeks, and it has been working quite well. I've also been playing with a (separate) ESPHome project using a rotary dial (based on the M5Stack Dial) to control it - although any other Home Assistant media player controller should work as well.

Cheers!
 
Amazing work, thanks for sharing it with us!
 
I wrote the Python module gelnc 5 years ago, but shortly after some life events prevented me from working further on it. However a few weeks ago I picked up this work too, and worked on something very similar, an ESPHome module controlling Genelec SAM monitors, also directly over RS-485 this time:

https://github.com/markbergsma/espgensam

There are a lot of similarities between our projects, it's nice to read about the process you went through!. The peculiar Genelec 9-bit multidrop protocol was a bit to figure out to get to work on the ESP32, and I too ended up with a solution based on the ESP32's RMT support. I have based my solution on the M5Stack Atom S3 Lite + RS-485 base for now:
How interesting. Nothing for 5 years, then two independent projects for embedded controllers. I'm glad we went in slightly different directions so that we covered a lot more ground. I did focus more on the stand alone solution thinking about ESPHome later, you did the opposite. How interesting that you went the effort to coexist with GLM, when my focus was to replace it

I did also code a RTM receive solution but switched to the serial hack with framing error to make it work on all the ESP32 processors. On the C6, for example, there's no DMA and RMT can only reliably receive short packets. On longer packets, I get truncations and errors (might be my limitation, but I tried everything)

I see also that you determined a 282 kbps rate. I'm relatively sure the rate is very close to 296 kbps, measured both with a decent scope and a logic analyzer at 400 MHz. You can see the timing in the images folder in my github. I wonder if our GLMs have such a high variability

Thanks for sharing!
 
I love my Genelec volume control!

But good work reverse engineering this.
 
How interesting. Nothing for 5 years, then two independent projects for embedded controllers. I'm glad we went in slightly different directions so that we covered a lot more ground. I did focus more on the stand alone solution thinking about ESPHome later, you did the opposite. How interesting that you went the effort to coexist with GLM, when my focus was to replace it
Yes, what a coincidence! When I started looking at it again recently, I was like, "surely someone must have sorted out RS-485 by now!" - but it didn't appear to be the case. ;)

To be clear: espgensam does not want nor need the GLM network adapter or the GLM software running on its bus, but it tolerates it. When it detects their activity it goes in read-only, sniffing mode only. This was mainly implemented to facilitate my sniffing the bus. ;) Full cooperation is probably not feasible, as GLM is not expecting that at all.

I did also code a RTM receive solution but switched to the serial hack with framing error to make it work on all the ESP32 processors. On the C6, for example, there's no DMA and RMT can only reliably receive short packets. On longer packets, I get truncations and errors (might be my limitation, but I tried everything)

I see also that you determined a 282 kbps rate. I'm relatively sure the rate is very close to 296 kbps, measured both with a decent scope and a logic analyzer at 400 MHz. You can see the timing in the images folder in my github. I wonder if our GLMs have such a high variability

Yes, you could be right. I'll experiment with your values as well soon and report back. My process was: I thought I measured an ~4 us pulse on my oscilloscope, and initially played around with a Waveshare RS485-to-Ethernet adapter. At exactly 250kbps I was getting valid data back, or so I thought. But a lof of things didn't make sense, and I couldn't figure out the CRC algorithm. I was silently dropping one of the bits (3rd or 4th if I remember) due to timing misalignment, and when I finally confirmed it was 9-bit multidrop, settled on 9/8 * 250 kbps = 281250. That immediately worked very well.

However, I'm having some challenges with the RS485 signal quality and slow rise times with the M5Stack RS485 Base, I suspect due to the slow auto-direction circuit that it and practically all standard RS485 dev boards seem to be using. It works well enough in practice, but I'm having a low percentage of CRC issues, and it bugs me a little bit. It wouldn't be difficult to custom build a proper transceiver circuit with an ADM483 or similar to match exactly what Genelec are doing - but I'm hoping to find a simple ready-to-go hardware solution using a common dev board / RS485 module that people can just use plug-and-play. (That's also the main reason I hadn't shared my project here yet.)

Thanks for sharing!
Sure, let's compare notes. ;)
 
Last edited:
However, I'm having some challenges with the RS485 signal quality and slow rise times with the M5Stack RS485 Base, I suspect due to the slow auto-direction circuit that it and practically all standard RS485 dev boards seem to be using. It wouldn't be difficult to custom build a proper transceiver circuit with an ADM483 or similar to match exactly what Genelec are doing - but I'm hoping to find a simple ready-to-go hardware solution using a common dev board / RS485 module that people can just use plug-and-play. (That's also the main reason I hadn't shared my project here yet.)
Didn't realize that the M5stack RS485 had such a weird circuit and no proper DE/RE control (at least in the schematic I found). For what is worth, any MAX485 module works very reliably, with very fast transition between send and receive (code controlled). But, yeah, my solution requires a few solder joints, and that is going to be a real problem for many. Yours is much cleaner that way.

I wonder if something like this works better https://www.waveshare.com/esp32-s3-rs485-can.htm . Lots of documentation, and around $25 on Amazon https://www.amazon.com/s?k=esp32+rs485&channelId=500&clpRedir=Y&plpRedirect=mhFallback. It also uses a S3, requiring no code changes. The schematic shows direct DE/RE control https://files.waveshare.com/wiki/ESP32-S3-RS485-CAN/ESP32-S3-RS485-CAN-Schematic.pdf

It's built like a tank and does have an enclosure. The RS485 input doesn't expose GND, but I found that not using the GND on pin 8 is safer (no ground loops if you power the board from the same computer where GLM is connected) and works equally well. If your code exposed an option to directly control DE/RE from ESPHome, one could use both boards (I see you have customizable RX/TX in the yaml but not DE/RE given the MStack design
 
Didn't realize that the M5stack RS485 had such a weird circuit and no proper DE/RE control (at least in the schematic I found). For what is worth, any MAX485 module works very reliably, with very fast transition between send and receive (code controlled). But, yeah, my solution requires a few solder joints, and that is going to be a real problem for many. Yours is much cleaner that way.

I wonder if something like this works better https://www.waveshare.com/esp32-s3-rs485-can.htm . Lots of documentation, and around $25 on Amazon https://www.amazon.com/s?k=esp32+rs485&channelId=500&clpRedir=Y&plpRedirect=mhFallback. It also uses a S3, requiring no code changes. The schematic shows direct DE/RE control https://files.waveshare.com/wiki/ESP32-S3-RS485-CAN/ESP32-S3-RS485-CAN-Schematic.pdf

It's built like a tank and does have an enclosure. The RS485 input doesn't expose GND, but I found that not using the GND on pin 8 is safer (no ground loops if you power the board from the same computer where GLM is connected) and works equally well. If your code exposed an option to directly control DE/RE from ESPHome, one could use both boards (I see you have customizable RX/TX in the yaml but not DE/RE given the MStack design
Oh, great idea, thank you. I had (initially) looked at all kinds of Waveshare RS485-to-TCP solutions (like the one I also started with), but I couldn't find any that supported both 9-bit multidrop mode, and the > 280 kbps speeds needed here, to use as a serial proxy for a separate Home Assistant integration. But of course, if I can simply flash my ESPHome module onto its ESP32-S3 instead, and it does direct DE/RE, that's not an issue! Adding DE/RE support is not difficult, I just hadn't found easy-to-use hardware yet for it. I was about to start breadboarding something, with the caveat (for others) you mentioned...
 
I just asked Claude to analyze the protocol across both implementations - since both have been reverse engineered entirely independently of each other, that nicely cross-validates many findings, but also highlights a few differences:

https://github.com/markbergsma/espgensam/blob/main/docs/glm-protocol-comparison.md

Useful!
Oooh, I like it!

Super helpful, thanks for sharing. I just updated the protocol specs with your findings https://github.com/robcazzaro/hlm/tree/main/docs. I hope it was ok, I credited and linked your project.

I'd like to maintain a single version of the protocol specs, updated as needed and documented as much as possible. Let me know if you prefer to host those in your repository instead.
 
Oooh, I like it!

Super helpful, thanks for sharing. I just updated the protocol specs with your findings https://github.com/robcazzaro/hlm/tree/main/docs. I hope it was ok, I credited and linked your project.

I'd like to maintain a single version of the protocol specs, updated as needed and documented as much as possible. Let me know if you prefer to host those in your repository instead.
Of course, let's use your protocol spec doc to document all protocol findings going forward. It was already a good basis to start from. :)

In the mean time I've let Claude run an experiment on the baud rate as it suggested, and it's pretty conclusively 288,000 bps, or, 6x 48kHz. That makes total sense too, with the DSP running at that clock rate. See the updated doc in my repo for details.

I'm now first going to see if I can eliminate those CRC errors completely, probably with better hardware with DE/RE control too (which I've ordered, thanks!). After that, I'll implement additional DSP features, and your doc/implementation will save quite a bit of time on that.
 
I can live with 288 kbps :) it's well within the margin of error of my measurements, and at least is a nice multiple of a reasonable frequency, with reasonable factors. Originally, I guessed 296 kbps based on my measurements, but I wasn't really sure and it's such a goofy number for Genelec to pick (weird factors, not a reasonable multiple of any usual binary number). I'll update the specs soon. Thanks for settling this
 
So cool to see this dialogue and collaboration emerging in real-time here! Thank you both for your work!
Yep!

I trust that he will pass on that 83x1 that someone will be sending him, after he is "done testing it".:D:p
 
Excellent work! I know Genelec top management and have urged them to open the GLM volume control via an open API a year ago and showed them the reverse engineering examples at the time. Will try again with these.
Considering that these are unsanctioned efforts and reverse engineering is a bit of a grey area in many countries, I'd appreciate if you didn't.

If Genelec wanted to open their devices, they had plenty of opportunities. Keep in mind that they could decide to encrypt the traffic, and at that point none of this will work.

At this point, we can do everything, and there's no value in an official Genelec solution. Calling their attention to this is a net negative with no upside.
 
Excellent work! I know Genelec top management and have urged them to open the GLM volume control via an open API a year ago and showed them the reverse engineering examples at the time. Will try again with these.
I agree with Rob, there's not really any point any more now. Though I think Genelec will probably (soon) be aware anyway, there are Genelec employees active on this forum and on the subreddit.

I like Genelec as a company, I love their products, and I don't intend to harm them. My main use case has been to fully integrate my SAM speakers into my home cinema and home automation setup, and have a very user friendly and automated way of controlling them where possible. Stuff like having the monitors do room volume control (as the last stage in my digital audio pipeline), automated on/off (ISS can be too slow), switching some settings (like GLM groups) -- and being able to do that in a different place from where my GLM kit is hooked up.

The GLM software offers /some/ options for that, but they are pretty clunky, and require GLM running on a Windows or MacOS machine, which I simply don't have in this setup. The standalone mode works, but is a bit too limited here. Honestly, if Genelec had just made that a little bit more accessible with the GLM adapter for this use case, I don't even think I would have started my original genlc effort. Though like Rob said, if I'd deploy another SAM system in a different room, I wouldn't like having to buy yet another GLM kit just for basic control. :)
 
I'm now first going to see if I can eliminate those CRC errors completely, probably with better hardware with DE/RE control too (which I've ordered, thanks!). After that, I'll implement additional DSP features, and your doc/implementation will save quite a bit of time on that.
Over the past week, I've made two larger changes to espgensam: new hardware support, and implementation of GLM's "groups" (presets), along with the underlying DSP features/configuration.

The Waveshare ESP32-S3-RS485-CAN worked out nicely; its explicit DE/RE driver works better for this use case than the M5Stack modules I was using before. It's now the default and (only for now) recommended board for espgensam.

I also added support for GLM's "groups", i.e. calibration/configuration "presets". One can simply point espgensam at an existing GLM configuration file (.sam file), and it will parse and use those groups and calibration settings from it. (Alternatively, they can be manually configure in YAML as well.) Any EQ bands, level attenuation, delay, bass crossover frequency or input setting per speaker is now supported and configured. I also did a few acoustic measurements with a UMIK-1 and REW to check whether the equalization was being applied correctly, and it matched up perfectly.

@robca: The implementation of the DSP features and some additional captures I did for them turned up a few more findings on the protocol, especially around subwoofer settings; perhaps take a look at the (updated) docs for your protocol doc (which has been very helpful, thank you :))
 
Back
Top Bottom