ring icon indicating copy to clipboard operation
ring copied to clipboard

Speech garbled when talking to Ring devices

Open Dave-8080 opened this issue 2 years ago • 17 comments

Bug Report

Describe the Bug

Speech garbled when talking to Ring devices. I have homebridge running natively on a Synology DS920+. The only plugins. installed are Homebridge TPLink Smarthome and Homebridge Ring. Video streaming and alerts work fine. I can also listen on my iPhone to both the Ring gen 1 doorbell and Wired Stickup camera. However, when I speak to the Ring device from my iPhone, the speech that comes out of both devices is unintelligible. This problem does not occur with the Ring app for iOS.

To Reproduce

Steps to reproduce the behavior:

  • Start Homebridge
  • Attempt to ... speak to Ring doorbell
  • See error

Expected behavior

A person listening to the doorbells speaker can understand me

Screenshots/Logs

If applicable, add screenshots and log output to help explain your problem.

Additional context

This issue does not occur with the official Ring app on iOS

Homebridge Ring Config

Post homebridge-ring platform config without sensitive information

    "bridge": {
        "name": "Homebridge 3A53",
        "username": "- sensitive info -,
        "port": 51408,
        "pin": "101-16-089",
        "advertiser": "bonjour-hap"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "TplinkSmarthome",
            "addCustomCharacteristics": false,
            "deviceTypes": [
                "plug",
                "bulb"
            ],
            "_bridge": {
                "username": "0E:AC:DB:1A:50:E3",
                "port": 50680
            },
            "platform": "TplinkSmarthome"
        },
        {
            "refreshToken": - sensitive info -
            "hideDoorbellSwitch": true,
            "avoidSnapshotBatteryDrain": true,
            "beamDurationSeconds": 59,
            "cameraStatusPollingSeconds": 10,
            "locationModePollingSeconds": 0,
            "_bridge": {
                "username": "- sensitive info -",
                "port": 46498
            },
            "platform": "Ring"
        }
    ]
}

HIGHLIGHT THIS TEXT AND POST CONFIG HERE
DO NOT INCLUDE YOUR REFRESH TOKEN OR EMAIL/PASSWORD (replace them with xxx)

Environment

  • OS: Synology DSM 7
  • Node.js: [e.g. 12.14.1] v16.15.1
  • NPM: [e.g 6.13.4] 8.11.0
  • homebridge-ring: 11.0.6
  • homebridge: 4.48.1
  • hoobs: N/A

Dave-8080 avatar Jul 07 '22 23:07 Dave-8080

When I was able to get the live stream working a few months ago, I was also seeing issue, but assumed it was something to do with my particular setup. This is just a guess, but it may be due to mismatched sample rates/bit rates/encoding between what ring is providing/expecting and what the plugin is converting between. Might be something worth looking into, though I doubt amazon/ring post what their default values are for those kinds of things.

rfiorentino1 avatar Jul 09 '22 04:07 rfiorentino1

Thanks for looking into it, and your awesome plugin.

On Jul 9, 2022, at 1:00 AM, rfiorentino1 @.***> wrote:

When I was able to get the live stream working a few months ago, I was also seeing issue, but assumed it was something to do with my particular setup. This is just a guess, but it may be due to mismatched sample rates/bit rates/encoding between what ring is providing/expecting and what the plugin is converting between. Might be something worth looking into, though I doubt amazon/ring post what their default values are for those kinds of things.

— Reply to this email directly, view it on GitHub https://github.com/dgreif/ring/issues/984#issuecomment-1179480112, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ64EOAK5JVEFCH37O7EDC3VTEBNPANCNFSM527DWKFQ. You are receiving this because you authored the thread.

Dave-8080 avatar Jul 09 '22 12:07 Dave-8080

I also have the same issue. Discussed here: https://github.com/dgreif/ring/discussions/966 Looks like the return audio is being converted from AAC to Opus. Could be something related to the conversion?

rawrmcrawrrawr avatar Jul 09 '22 16:07 rawrmcrawrrawr

Interesting. Thank you for connecting these 2 issues, and sharing the log, that actually was really helpful. From an audio perspective, I do think the issue is in the conversion between Mac and the lib opus encoder. The plugin is currently taking a mono 16K stream, and converting it to a stereo 48K stream, which I don't thin the doorbell can handle. I would try keeping the rates the same, so 16K mono both ways, and see what happens/if it improves audio and reliability. A good place to start may be line 285 of the output arguments calling the lib Opus library, which seems to be creating a 48K stream :)

rfiorentino1 avatar Jul 09 '22 20:07 rfiorentino1

It's very likely that there is something wrong with the audio conversion in this case. I fixed a similar issue (#930) recently, where some cameras were still using PCMU instead of opus. It's very possible that the Ring Doorbell Pro is using a different bit rate or something along those lines.

@Dave-8080 is your doorbell located such that you would feel comfortable sharing it with me for a few days to debug? If so, please send a Ring invite to [email protected]. Hopefully access to it will give me some insight into what it's expecting for stream settings.

dgreif avatar Jul 10 '22 18:07 dgreif

I’m updating the doorbell to a Ring video doorbell 2020 because of battery drain. If the issue is still Ty, I’ll be glad to share it.

On Jul 10, 2022, at 2:09 PM, Dusty Greif @.***> wrote:

 It's very likely that there is something wrong with the audio conversion in this case. I fixed a similar issue (#930) recently, where some cameras were still using PCMU instead of opus. It's very possible that the Ring Doorbell Pro is using a different bit rate or something along those lines.

@Dave-8080 is your doorbell located such that you would feel comfortable sharing it with me for a few days to debug? If so, please send a Ring invite to @.*** Hopefully access to it will give me some insight into what it's expecting for stream settings.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

Dave-8080 avatar Jul 10 '22 18:07 Dave-8080

If it would be helpful, I do have a 2021 ring video doorbell pro that I'd be happy to share an invite to for debugging

rfiorentino1 avatar Jul 10 '22 19:07 rfiorentino1

@rfiorentino1 is yours exhibiting the same garbled audio when using 2-way, or does it just not stream at all?

dgreif avatar Jul 10 '22 20:07 dgreif

The last few times that I've actually been able to stream audio/video, the return audio from my phone to the camera was very garbled/pitched down like the above post describes. I currently can't get live streams to work, hence #985 but last working one was probably about a month ago, after the update that closed #930 I'm about to try downgrading to version 9.24 to see if I at least get streaming back, I'm curious after reading through the comments in #930. I'll report back :)

rfiorentino1 avatar Jul 10 '22 20:07 rfiorentino1

Interestingly 9.24.0 works flawlessly for me every time. The audio seems to be a little less clearer generally, as far as frequency goes, than the newer versions of the plug-in, but the streaming part works every time

rfiorentino1 avatar Jul 10 '22 20:07 rfiorentino1

FWIW I have the same issue and I am happy to help test if required.

lawb avatar Jul 14 '22 10:07 lawb

@dgreif I can also provide access to my Ring Doorbell Pro to help with this issue if needed.

rawrmcrawrrawr avatar Jul 14 '22 17:07 rawrmcrawrrawr

@Dave-8080 thanks for sharing the camera. I tested it with homebridge and it appears that the audio goes through, but the voice is distorted. I was able to recreate this problem on my end with my own cameras, so feel free to remove my access. Can you confirm that you are able to actually hear your words, but that they sound distorted when using homebridge 2-way audio?

dgreif avatar Jul 16 '22 23:07 dgreif

Yes, that describes it.

On Jul 16, 2022, at 7:45 PM, Dusty Greif @.***> wrote:

@Dave-8080 https://github.com/Dave-8080 thanks for sharing the camera. I tested it with homebridge and it appears that the audio goes through, but the voice is distorted. I was able to recreate this problem on my end with my own cameras, so feel free to remove my access. Can you confirm that you are able to actually hear your words, but that they sound distorted when using homebridge 2-way audio?

— Reply to this email directly, view it on GitHub https://github.com/dgreif/ring/issues/984#issuecomment-1186339533, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ64EOGFJZQW6S4HEGBOL7LVUNCRJANCNFSM527DWKFQ. You are receiving this because you were mentioned.

Dave-8080 avatar Jul 16 '22 23:07 Dave-8080

I've been running version 9.24.0 of this plug-in for the last few weeks because that's the last stable version for me for whatever reason. However, I fixed a troublesome Apple TV today, which was causing issues with a homebridge doorlock, and decided to update Ring again to the latest version, to see if it worked and also to confirm this garbled audio issue. When running on 11.0.7, I now seem to get streaming with video/audio about 60% of the time, but still not nearly as consistent as 9.24.0 which streams consistently every single time. I do however still have the garbled audio issue with 11.0.7, glad you were able to replicate it with other cameras on your end. not sure if access to my doorbell is still helpful, but it's there if you need it. Thank you so much for looking into all of this

rfiorentino1 avatar Jul 17 '22 04:07 rfiorentino1

Thanks for the info. I think you can both revoke my access at this point since I'm able to replicate with my own cameras. I haven't identified a fix yet, and have a busy couple weeks coming up. Thanks for your patience while I get this sorted out!

dgreif avatar Jul 17 '22 16:07 dgreif

Just dropping in to confirm this issue on my ring devices. Ive tested doorbell2 and stick-up cams.

Jocala avatar Sep 21 '22 16:09 Jocala

Same issue here on ring doorbell 3 plus, stick up cam (3rd gen) and video doorbell 2

aounakram avatar Oct 06 '22 20:10 aounakram

Same issue here on Ring Peephole cam

jeph avatar Nov 07 '22 19:11 jeph

I have just added my new Ring Video Doorbel Pro 2 (firmware: 10.0.18) via your plugin and it almost works great :)

I also have the same sound-bug. Me speaking thru Homekit to the doorbell makes mu voice sound al scrambled up. When I try this via the original Ring app, my voice is Cristal clear.

I use Homebridge version 1.6.0 I use Ring plugin version 11.6.0

Maybe there's an audio setting of some kind I've missed or is this bug still active?

Many thanks for your hard work making this dream of many..... real 🙏🏻

Hope to hear from you soon.

Yorlinq avatar Dec 04 '22 09:12 Yorlinq

I still haven't tracked down what is causing this bug. I believe it is present for all users and camera models

dgreif avatar Dec 04 '22 22:12 dgreif

@tsightler was able to track down some better config options for 2-way audio in #1299. It seems to be much better now, so I'm going to close this issue.

These changes will be available in v12 of the plugin.

dgreif avatar Aug 20 '23 18:08 dgreif