Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speech garbled when talking to Ring devices #984

Closed
Dave-8080 opened this issue Jul 7, 2022 · 22 comments
Closed

Speech garbled when talking to Ring devices #984

Dave-8080 opened this issue Jul 7, 2022 · 22 comments
Labels
bug Something isn't working

Comments

@Dave-8080
Copy link

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 Dave-8080 added the bug Something isn't working label Jul 7, 2022
@rfiorentino1
Copy link

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.

@Dave-8080
Copy link
Author

Dave-8080 commented Jul 9, 2022 via email

@rawrmcrawrrawr
Copy link

I also have the same issue. Discussed here: #966
Looks like the return audio is being converted from AAC to Opus. Could be something related to the conversion?

@rfiorentino1
Copy link

rfiorentino1 commented Jul 9, 2022

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 :)

@dgreif
Copy link
Owner

dgreif commented Jul 10, 2022

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 dustin.greif@gmail.com. Hopefully access to it will give me some insight into what it's expecting for stream settings.

@Dave-8080
Copy link
Author

Dave-8080 commented Jul 10, 2022 via email

@rfiorentino1
Copy link

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

@dgreif
Copy link
Owner

dgreif commented Jul 10, 2022

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

@rfiorentino1
Copy link

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
Copy link

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

@lawb
Copy link

lawb commented Jul 14, 2022

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

@rawrmcrawrrawr
Copy link

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

@dgreif
Copy link
Owner

dgreif commented Jul 16, 2022

@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?

@Dave-8080
Copy link
Author

Dave-8080 commented Jul 16, 2022 via email

@rfiorentino1
Copy link

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

@dgreif
Copy link
Owner

dgreif commented Jul 17, 2022

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 dgreif pinned this issue Aug 27, 2022
@Jocala
Copy link

Jocala commented Sep 21, 2022

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

@aounakram
Copy link

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

@jeph
Copy link

jeph commented Nov 7, 2022

Same issue here on Ring Peephole cam

@Yorlinq
Copy link

Yorlinq commented Dec 4, 2022

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.

@dgreif
Copy link
Owner

dgreif commented Dec 4, 2022

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

@dgreif
Copy link
Owner

dgreif commented Aug 20, 2023

@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 dgreif closed this as completed Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants