blakeblackshear / frigate-hass-integration

Frigate integration for Home Assistant
MIT License
726 stars 114 forks source link

[Question] How to interpret volume level of microphones in camera's? #651

Closed Calimerorulez closed 5 months ago

Calimerorulez commented 6 months ago

Hi,

Just updated to 5.1.0, and I see sound levels of the microphones in the camera's available. They're displayed in HA as negative dB's.

What is the reference value? I know 40 dB is a quiet conversation, and 130 dB is a jet fighter taking off, but how can I interpret the negative values?

Thanks again!

NickM-27 commented 6 months ago

The scale is dBFS

image

meaning the higher (closer to 0) that the number is, the louder the sound is. So speech is likely to be close to -40, but it can depend on variables like the camera microphone, environmental noise filter, etc.

bagobones commented 6 months ago

I came here with the same question and again I think I am more confused than ever.

The scale is dBFS

The unit displayed in Home Assistant is dB, so that likely should be changed.

To be useful how does this relate to the min_volume rms ?

NickM-27 commented 6 months ago

The unit displayed in Home Assistant is dB, so that likely should be changed.

we can only use units that are provided by home assistant. Regardless, it is a decibel just using a different scale.

Like it shows in the image above the scale is basically just inverse. So -100 relates to 0 on the leftmost scale.

This is the conversion https://github.com/blakeblackshear/frigate/blob/e5595ebb2f5c826a00b2d141d163a5ee964ec4b0/frigate/events/audio.py#L239

bagobones commented 6 months ago

This is the conversion

Wait so if raw rms is being used to calculate dBFS, and rms is what the config file uses for min_volume why not provide us with rms instead of dBFS? At the end of the day I don't care what the values unit is, I just need to quickly determine if I need to raise or lower the sensitivity of the sensor and plug into min_volume.

Like it shows in the image above the scale is basically just inverse. So -100 relates to 0 on the leftmost scale.

So can dBFS be mapped / converted to dB if so why not use DB as the end user value? It would make more sense to those that have actual DB meters or use apps on their phones?

NickM-27 commented 6 months ago

why not provide us with rms instead of dBFS?

This is not a unit provided by home assistant sound units.

So can dBFS be mapped / converted to dB if so why not use DB as the end user value? It would make more sense to those that have actual DB meters or use apps on their phones?

Potentially but I'm not sure of the full ramifications or if the units are perfectly comparable.

I expect that the new frigate UI that's currently in progress will provide a better mechanism for tuning audio config so I don't think that's the best use case to steer the home assistant integration towards.

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.