Feature: Audio Support
It would be a nice addition to add audio support to the board and firmware as well. If you have any knowledge about audio processing or ideas how to send audio on the bus, feel free to share your ideas here.
I've been able to enable and disable the audio mode already but now we need to process the data somehow as a first step.
Streaming an audio file via Homeassistant to the bus would be nice as well. Or maybe even live audio streaming.
Resources: https://community.home-assistant.io/t/is-there-a-way-to-stream-audio-from-one-esphome-to-another/581786/17 https://electronics.stackexchange.com/a/692106/580470 https://github.com/pschatzmann/arduino-audio-tools/wiki/External-ADC https://forum.arduino.cc/t/using-operational-amplifiers-in-your-arduino-project/692648/4
I tried ring intercom last year, it worked but the audio quality was very bad with a high frequent beep in the background. Didn't feel comfortable with the cloud connection and sent the device back, but it shows that its possible to build that feature.
Might it be possible to "debug" what the ring intercom does, when enabling audio and reverse engineer it? Especially as it is available pretty cheap right now. But as I have it here already and will get a doorman soon, I might be able to support on this.
Mhh I'm just not sure how to debug it. I will have an oscilloscope in the next days, sooo maybe I'll find out something new (after figuring out how to use that oscilloscope haha).
Let me know when u find out anything new :)
It seems like it's possible to compile libopus for the esp32 (see for example https://github.com/XasWorks/esp-libopus). One could feed it from an ADC, maybe one of these:
https://github.com/pschatzmann/arduino-audio-tools/wiki/External-ADC
The audio stream is somewhat modulated on the DC but I'm not sure, I couldn't measure any AC. It's ~22V DC base and ~1-2V audio on top
We just need a way to extract the data.
Disclaimer: I have no idea what I'm talking about
I think what's need is an op-amp to measure the difference between the audio signal and the 22v baseline, and then amplify it to the range that the ADC wants (usually 5v or so?). See "difference amplifier" here https://forum.arduino.cc/t/using-operational-amplifiers-in-your-arduino-project/692648/4
Although I have no clue how and if even feasible, but it would be great to add video support (2 channels for 2 door systems) as well using ONVIF Profile S (RTSP, also for audio), perhaps even support the Profile A for controlling the door locks. https://www.onvif.org https://www.home-assistant.io/integrations/onvif https://en.wikipedia.org/wiki/Real-Time_Streaming_Protocol
I’ve been experiencing unreliable audio with my indoor station and took a closer look at TCS documentation to understand how the audio system works. While I haven’t solved my issue yet, I think I can contribute some useful observations.
It appears that the audio transmission is analog, because there’s no indication anywhere in docs or marketing material that digital audio is used. I don't know how it's transmitted, but in the simplest case it would be just superimposed on the DC bias and can be isolated with a coupling capacitor and digitized by the ADC of the ESP32. In this case, AC should be measurable, which it unfortunately doesn't seem to be according to https://github.com/AzonInc/Doorman/issues/5#issuecomment-2659248274.
It also seems that the transmission is half-duplex and audio is only transferred in one direction at a time. This implicates that there must be some kind of audio coordination messages on the bus that toggle send and receive modes - has anyone made such observations?
It's also not clear how the direction switching is triggered. It could be simply triggered by an audio level threshold, but I haven't found any reference to such a configuration or threshold value.
To transmit audio from the Doorman to the door station, we’d need a DAC, since the ESP32-S3 doesn’t include one. A possible workaround would be to emulate a DAC using PDM, as described here, though integrating that cleanly into ESPHome might not be straightforward.