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

Audio cuts out on Wyze Cam v3 (T31AL) #353

Open
shamlord opened this issue Dec 6, 2024 · 11 comments
Open

Audio cuts out on Wyze Cam v3 (T31AL) #353

shamlord opened this issue Dec 6, 2024 · 11 comments

Comments

@shamlord
Copy link

shamlord commented Dec 6, 2024

5 DEC 2024 firmware. Stream testing done with VLC on Windows. Camera connected to WiFi on same network.

Issues:
Audio cuts out depending on codec.
Based on the behavior, I suspect the CPU load is too high or audio related processes priority is too low.

  • AAC: Nearly constant silence - audio will cut in for a few seconds rarely then cut back out.
  • G726: Rarely cuts out
  • PCM: Cuts out slightly less frequently than G726

Audio configuration is inconsistent from the web GUI:

  • Setting the codec to AAC with a 16khz sample rate and then accessing the stream with VLC shows the camera sending a Stereo AAC stream at 32khz.
  • Setting AAC with an 8000 hz sample rate results in a stereo 16khz stream.
  • Setting G726 with a sample rate of 16000 hz results in VLC receiving an 8000 hz G726 stream
    (I think ONVIF may only support a sample rate of 8000 hz for G726)
  • PCM does actually stream at the sample rate it's set to.
@CazYokoyama
Copy link
Contributor

Are you able to change the title to "Audio cuts out on Wyze Cam v3 (T31AL)"? The people other than you read the title and find there is a problem on audio. They have to read your description to find what problem. My suggested title eliminate reading the description to find what problem.

@themactep themactep changed the title Wyze Cam v3 (T31AL) Audio Issues Audio cuts out on Wyze Cam v3 (T31AL) Dec 9, 2024
@gtxaspec
Copy link
Collaborator

gtxaspec commented Jan 4, 2025

please try the latest build as of 01/04 and let us know if it resolves any audio issues.

@shamlord
Copy link
Author

shamlord commented Jan 6, 2025

Testing with firmware:
IMAGE_ID=wyze_c3_t31al_atbm
BUILD_ID="master+a29f523, 2025-01-05 23:52:12 -0500"

In the WebUI, clicked Settings > Streamer > Audio
Codec: AAC. Double clicked Sampling for 16000 hz default, double clicked Bitrate for blank default.
Clicked Save config, Restart streamer
Connect to Main RTSP stream with VLC.
Audio codec is still OPUS, Stereo, 48000 hz 32-bit. Audio quality sounds normal.
Checked prudynt.cfg:

input_enabled = true;
input_high_pass_filter = true;
input_agc_enabled = true;
input_format = "AAC";
input_bitrate = 40;
input_sample_rate = 16000;

Refreshed WebUI web page (browser F5 key), Streamer Audio settings show AAC at 16kHz.
WebUI Tools > Reboot.
Reconnect to main stream with VLC.
Codec now correctly shows AAC, 16000 hz. There is no audio.
VLC Statistics tab shows only video blocks received, and the count increases as the stream continues. Zero audio blocks Decoded, Played, or Lost.
Stopped VLC stream playback.
In the WebUI, clicked Services > Streamer > Audio.
Changed the codec to G726. Double clicked Sampling for 16000 hz default, double clicked Bitrate for blank default.
Clicked Save config. Waited 5 seconds. Clicked Restart Streamer.
Reconnected to main RTSP stream with VLC.
Audio codec is unchanged. AAC, 16kHz. Still no audio blocks received.
Stopped playback in VLC.
In the WebGUI, clicked Tools > Reboot.
In the WebGUI, checked Streamer Audio settings.
Codec reflects G726, 16kHz Sampling, Bitrate 40 kbps.
Reconnected to RTSP main stream with VLC.
VLC reports stream audio codec as G.726 ADPCM, Mono, 8000 hz sample rate, 16-bit.
VLC statistics show audio blocks being received and decoded.
Sound quality is much worse than OPUS. Noise is heard but nothing intelligible.
Allowed VLC stream playback to continue but muted audio.

For my personal reference, listened to G.726 audio samples at: https://vocal.com/audio-examples/itu-speech-coder-audio-examples/
Decided to unmute VLC audio stream again, found that the audio was much improved with no configuration changes by me. Sounds picked up by the camera mic are clear and intelligible. Perhaps the audio quality is poor for a short time after camera boot due to CPU load or RAM usage?
Rebooted camera again via WebUI.
Audio is just noise once again. Waited.
With the system uptime at around 2m 50s, the audio changed drastically, starting out very loud but then decreasing in volume to a reasonable level. Sound was once again intelligible and reasonable quality for G726.
Checked Audio section in prudynt.cfg again.

input_enabled = true;
input_high_pass_filter = true;
input_agc_enabled = false;
input_format = "G726";
input_bitrate = 40;
input_sample_rate = 16000;
input_vol = 120;
input_gain = 30;
input_alc_gain = 7;
input_agc_target_level_dbfs = 30;
input_agc_compression_gain_db = 70;
input_noise_suppression = 3;

CFG accurately reflects WebGUI.

Results:
AAC appears to still be broken.
G.726 is working, but does take up to 3 minutes after boot for audio stream to be intelligible.
Changes to the WebGUI / prudynt.cfg do not take effect when restarting Streamer. Changes only work after a reboot.

@shamlord
Copy link
Author

shamlord commented Jan 6, 2025

After reading back through my testing notes, I decided to retry AAC after giving the camera several minutes to finish starting.

In the WebGUI, went to Streamer Audio settings.
Set codec to AAC and double clicked the Sampling and Bitrate fields to set them to default (16000 Hz, 40 kbps).
Saved streamer config and then rebooted the camera via WebGUI.
After the reboot, reconnected to the main RTSP stream at about 1 minute of uptime.
VLC now shows audio blocks being received, but no sound. Waited.
At approximately 2 minutes of uptime, I now hear audio, at a much higher quality than G.726.
The AAC stream reported by VLC now shows Stereo, 32000 Hz, 32-bit.
Checked the web GUI. It shows audio codec set to AAC, 16000 Hz, 40 kbps.
Checked prudynt.cfg and found that it matches the WebGUI:

input_enabled = true;
input_high_pass_filter = true;
input_agc_enabled = false;
input_format = "AAC";
input_bitrate = 40;
input_sample_rate = 16000;
input_vol = 120;
input_gain = 30;
input_alc_gain = 7;
input_agc_target_level_dbfs = 30;
input_agc_compression_gain_db = 70;
input_noise_suppression = 3;

In the WebGUI, clicked the Sampling combobox, changed it to a different sample rate and then back to 16000 Hz. Did the same with the Bitrate setting, returning back to 40 Kbps.
Rebooted the camera via the WebGUI.
Waited 2 minutes for the camera to finish booting.
Played main RTSP stream with VLC.
AAC audio is now unusable. Sounds can be heard but they are unintelligible.
VLC still shows the audio stream is AAC Stereo, 32000 Hz sample rate, 32 bit audio,

Result:
AAC function is inconsistent between reboots. When it does work, the encoder does not honor the configured settings in prudynt.cfg.

@gtxaspec
Copy link
Collaborator

gtxaspec commented Jan 6, 2025

thx for the info. i'll do some testing locally as well.

@schmidtch89
Copy link

I notice also an issue with the audio with my two cinnado_d1_t23n.
With one of the last releases the audio stream via RTSP is not functional anymore.
Looks like this issue is not only related to the camera model mentioned in the header.

@gtxaspec
Copy link
Collaborator

some fixes to the streamer coming with audio fixes... stay tuned.

@gtxaspec
Copy link
Collaborator

please try the latest build, there has been updates to the streamer as of todays build.

@gtxaspec
Copy link
Collaborator

@shamlord is this still a problem? let us know!

@schmidtch89
Copy link

Hey @gtxaspec , for my Cinnado D1 audio is working again. But it is not synchronized with the video. There is a delay of approx. one or two seconds.

@shamlord
Copy link
Author

IMAGE_ID=wyze_c3_t31al_atbm
BUILD_ID="master+f4d8d71, 2025-01-19 02:37:03 -0800"
BOOTLOADER=isvp_t31al_sfcnor_ddr128M

Upgraded to the firmware above via partial upgrade using Flash Operations in Web GUI.
Firmware defaults to OPUS, 16000hz, 40kbps in web GUI.
prudynt.cfg audio setting matches web GUI.
Connected to Main stream with VLC.
Audio codec reported by VLC is OPUS, Stereo, 48000hz, 32 bit sample rate

Using Web GUI, changed audio codec to G726, 8000 hz, 40 kbps.
Confirmed change shows in prudynt.cfg.
Clicked Restart Streamer. No change in VLC.
Stopped VLC playback.
Clicked Restart Streamer.
Started VLC stream playback. Audio codec is still OPUS.
Restarted Camera via WebGUI.
Resumed playback of camera stream in VLC at around 1m 30s of uptime.
Little or no audio. Waited.
At 2m 54s of uptime, the audio changed and I could now hear sound.
Automatic gain control initially adjusted the gain up, then back down to a reasonable level.
VLC shows codec is G726, Mono, 8000 hz.
I can hear clear audio (for G726).

In WebGUI, changed audio codec to AAC, 16000hz, 40 kbps.
Clicked Save Config.
Confirmed change is in prudynt.cfg.
Clicked Restart Streamer.
Disconnected and reconnected to stream with VLC.
VLC still reports G726, 8000hz mono.
Rebooted camera in WebGUI.

Reconnected to video stream at 45s of uptime (as soon as the WebGUI came back up).
VLC reports AAC @ 16000 hz, but only 1 audio block was received.
Disconnected and reconnected to stream with VLC.
VLC reports audio codec is still AAC at 16000 hz, but no blocks of audio are being received.
Stopped playback in VLC and waited.
Reconnected to stream at 4m 15s. Still no audio.
VLC started receiving audio blocks at approximately 4m 45s of uptime.
Audio is very clear and intelligible.
Audio codec reported by VLC has change to AAC, at 32000 hz, 32 bit sample rate.
Confirmed Web GUI and prudynt.cfg still show:

input_format = "AAC";
input_bitrate = 40;
input_sample_rate = 16000;

Streaming for 17m continuously, AAC has not yet cut out.
Rebooted camera in web gui.
Did not stop VLC, it displayed an error at disconnect.
VLC automatically reconnected to the stream at approximately 30 seconds of uptime (before WebGUI came back up)
VLC shows it was receiving AAC audio blocks immediately.
Confirmed clear audio at about 1m of uptime.
The codec reported by VLC is Stereo, 32000hz, 32 bit sample rate.
Confirmed Web GUI and prudynt.cfg are still configured to 16000hz AAC.

Conclusion:

  • AAC now works, although the encoder still doesn't respect the settings in prudynt.cfg.
  • AAC and OPUS both stream in stereo at frequency rates other than what is set in prudynt.cfg. The overall stream bitrate would be lower if the audio were mono and the frequency settings were honored. Unless the camera has multiple microphones I'm not aware of. I suspect it may also cut down on the CPU load from the encoder process.
  • I usually enable the camera reboot entry in crontab, but I'll leave it commented out and check on the camera daily to verify stability.
  • Unrelated, but restarting streamer has no apparent use if streamer only applies audio settings at reboot. However, the OSD options seem to update right away without a streamer restart when those settings are adjusted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants