Debugging audio artifacts caused by... a serial port?
1–10 of 33 posts
Re: Debugging audio artifacts caused by... a serial port?
#2After a major migration, we faced a strange audio issue that led us on a deep dive through our infrastructure.
The culprit? Not the audio code—but a hidden interaction with AWS’s virtual serial ports.
We wrote about our journey discovering the artifacts and finding a clean fix!
Re: Debugging audio artifacts caused by... a serial port?
#3At Recall.ai, we built a 10,000-node cluster, processing over 1TB/sec of raw video in real-time. After a major migration, we faced a strange audio issue that led us on a deep dive through our infrastructure. The culprit? Not the audio code—but a hidden interaction with AWS’s virtual serial ports. We wrote about our journey discovering the artifacts and finding a clean fix!
Re: Debugging audio artifacts caused by... a serial port?
#4Re: Debugging audio artifacts caused by... a serial port?
#5Wild af
Re: Debugging audio artifacts caused by... a serial port?
#6The first result for "8250 too much work for irq4" is this: https://unix.stackexchange.com/questions/387600/understandin... (2017)
The problem is that the UART hardware that is emulated by various brands of virtual machine behaves impossibly, sending characters at an impossibly fast line speed. To the kernel, this is indistinguishable from faulty real UART hardware that is continually raising an interrupt for an empty output buffer/full input buffer. (Such faulty real hardwares exist, and you will find embedded Linux people also discussing this problem here and there.) The kernel pushes the data out/pulls the data in, and the UART is immediately raising an interrupt saying that it is ready for more.
So, is this seven year old problem still a problem, or is the virtual serial port driver actually unable to keep up with the stream of text?
Re: Debugging audio artifacts caused by... a serial port?
#7You shouldn’t have to try to reproduce this in a test environment - your infrastructure should allow profiling in live for cases like this. And it should be solved with profiling, not guesswork and bisecting
Re: Debugging audio artifacts caused by... a serial port?
#8I'm curious why this is even an issue. I don't understand why an actual interrupt would get tripped for virtual serial port writes, and I don't understand why a virtual serial port (i.e. logging) gets swamped by what seems like a moderate stream of data. The first result for "8250 too much work for irq4" is this: https://unix.stackexchange.com/questions/387600/understandin... (2017) The problem is that the UART hardw…
If you're running in a VM, how do you know the difference between a virtual interrupt and a actual interrupt? Either way, you're handling an interrupt.
If I understand the issue, it's not that the virtual serial port is swamped really. It seems like the issue is that the virtual serial port is firing its empty/ready interrupt so often (probably after every byte written to the port?) that the driver thinks the interrupt is broken, so then it falls back to polling for readiness. The driver polling rate seems like it's not high enough to keep up with the logging, so then logging blocks.
Probably, it'd be better for the virtual serial port to limit the number of irqs it will send. Limiting the number of interrupts is a key benefit of the 16550 over earlier UART chips; it does this by having a 16 byte buffer and sending interrupts only when the buffer is empty/below a threshold (for outgoing) or full/above a threshold (for incoming). Getting an interrupt for each outbound byte is too many interrupts if you're logging a lot of junk on the serial console (which I'm guessing happens; modern software is full of junky logs IMHO).
Probably the right thing to do would be for virtual machine hosts to over virtio consoles as well as virtual serial ports, and for virtual machine guests to prefer to use a virtualio console rather than a serial port for logging. But it's probably possible to adjust the serial driver options as well. Virtio console could be much more efficient, as it allows transfers larger than a single byte at a time.
Re: Debugging audio artifacts caused by... a serial port?
#9 serial8250: too much work for irq4
do people not look at syslog anymore? It's one of the first things I do on unexplainable problems - check for OOM's, thermal throttling, BUGs, etc... Sure, it's not the most common problem, but the check is fast and easy.Re: Debugging audio artifacts caused by... a serial port?
#10The more we abstract things, treat servers like cattle, and lose low level knowledge, the more things like this will happen You shouldn’t have to try to reproduce this in a test environment - your infrastructure should allow profiling in live for cases like this. And it should be solved with profiling, not guesswork and bisecting
That's not how you live in AI age. Move fast and break things; YOLO; K8S all the things; etc..
(/s in case it's not clear)