TL;DR: with a little bit of reverse engineering magic, I was able to fix the mic disconnects previously reported by some users. As a bonus, I've added a "hold wheel to mute" action in the firmware. If you're brave enough, you may find the link to my GitHub at the bottom. The fix applies to firmware v 1.1.9 (the latest at the time of writing). You'll need to have a Windows machine to run the script.
The story:
While the PodMic USB (just podmic from here on) is a really great mic, it occasionally suffers from stability issues. Sometimes (more often when used as an audio output) the mic will disconnect and reconnect a few seconds later, causing interruptions in both recorded and played audio. The issue seems to impact only a portion of users, mostly on Windows, but it was also reported on Macs with Intel chipsets:
https://www.reddit.com/r/rode/comments/16l17vm/podmic_usb_crahses_once_or_twice_per_day/
https://www.reddit.com/r/rode/comments/1e76895/issues_with_podmic_usb/
https://www.reddit.com/r/rode/comments/1kqq4tk/rode_podmic_usb_randomly_cuts_audio_output_then/
https://www.reddit.com/r/rode/comments/1gfi52t/rode_podmic_usb_randomly_disconnecting/
I turned out to be among the lucky few who have the issue. In my case, disconnects could happen twice in 5 minutes or never happen for hours. That, of course, made the troubleshooting even more horrible. The posts above (along with RODE's tech support) recommended switching cables, hubs and laptops, opening and closing RODE Central, praying to eldritch gods under a rising moon, none of which really helped. To be completely honest, I should mention that RODE generously offered a mic replacement to me and seemingly everyone who contacted them. Unfortunately, that didn't help either: my second unit had the very same issue.
Last week I felt bored and finally decided to try the notorious REA (Reverse Engineer Anything). And, oh my, I had an amusing and productive weekend because of that. In just a couple of evenings me and my dear friend Claude extracted the stock firmware for the podmic (1.1.9), analysed it and ran several tests. As a result, I got a custom firmware upload script in Python along with a patched firmware. The best part: it turns out the chip on the podmic has several free pages of flash memory left, which allowed me to implement the long-awaited "push and hold the wheel to mute the mic" feature. It works like a charm, and you even hear a beep if you use the mic's monitoring output. I'll put some technical details below; feel free to skip to the next part.
Boring stuff:
The following is the result of investigating a closed-source firmware and looking at some photos on the internet. Mistakes are possible. Embedded pron ahead.
The best pictures of the podmic internals I could find on the internet are these https://www.flickr.com/photos/eevblog/albums/72177720335158359/ (courtesy of eevblog and Dave Jones). The mic circuitry features two main parts:
- Nuvoton NAU88L21, the audio codec. The little guy handles the DAC and ADC. In simple words, it's responsible for capturing your charming voice from the capsule and playing it back to your headphones.
- GigaDevice GD32F350 (most likely the GD32F350x8), the microcontroller (MCU). The fella is a stepbrother of the more popular and successful STM32F3/4, featuring the very same Cortex-M4 core along with peripherals similar to those you could find in the STM32F1 series. GD is a control freak sitting on the USB bus and telling everyone what to do. During its free cycles, GD also seems to implement the APHEX sound processing.
Both chips communicate over I2S to transfer sound back and forth, and over I2C, which the MCU uses to fine-tune the codec's clock so it matches the pace at which the host (PC/Mac/whatever else) sends audio over USB. Unfortunately, the latter (the GD32's I2C is implemented similarly to the STM32F1's) is infamously finicky.
Roughly every 4 ms, the GD MCU writes clock correction commands to the codec. The code waits until the transfer is complete or the I2C block reports an error. While it sounds absolutely logical, the harsh world presents us with a different reality: if the I2C interrupt is handled a little too late, the transfer can silently stop without completing or raising an error. Because the transfer routine doesn't have any timeout, the main loop hangs forever. Once that happens, the watchdog timer resets the mic after about 1.5 seconds. The funny part is that the audio stream is handled by interrupts (as it should be), not the main loop, so the audio keeps working right up until the reboot (that's why the sound is cut so abruptly).
My fix raises the priority of the I2C interrupts to the highest in the firmware (as ST's errata recommends). Additionally, it introduces a safety net: if the I2C ever hangs for more than 10 ms, the I2C block is reset and an error is raised. The result is smooth operation: with error reporting enabled, a 10-hour session on the old code logged 149 I2C errors, while the fixed firmware logged 0 errors over 7 hours.
Disclaimer:
Before giving away the link to the repository, I feel I need to state several things:
- none of this work is affiliated with RODE, nor was it reviewed by them
- the repository contains no code from RODE; it only features a tool that will help you extract the firmware from your own copy of RODE Central
- the process of applying the fix involves uploading a modified firmware to your device. On its own, it may void your warranty. While I keep testing the very same firmware on my device and there is a known way to recover the mic if flashing goes wrong, there is still a slight chance you could brick your device. If you are not comfortable with this, you should probably avoid doing that.
The Link:
If you are still here with me after this never-ending wall of text, I humbly present to you the link https://github.com/rumkit/podmicusb-doctor You will find instructions in the readme.md and firmware/readme.md files. I hope you'll find it useful or at least amusing. If you give it a try, I'd love to hear your results in the comments or as a GitHub issue.