Audio not sending shortly after beginning
Describe the bug We've noticed that on some streams audio stops sending shortly after start or not sending at all: http://bit.ly/3PLdgZG
Here's the chart of audio and video packets in the received video on RTMP server:
To Reproduce Steps to reproduce the behavior: This only happens in small % of streams
Expected behavior Audio and video be sent continiously
Screenshots If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
Samsung Galaxy S20 5G Samsung Galaxy S23 Ultra
Additional context Probably non-ideal connection on 4G with interruptions.
Forgot to mention this was com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.2.4 If the problem is fixed in 2.2.8 feel free to close.
Hello,
I will try investigate. I noticed that sometimes (I could reproduce like 1 or 2 times, long time ago, that I remember) AudioEncoder class stop to process frames with no reason (no crash report) but it is really rare and I was no able to reproduce. I'm not sure if AudioEncoder crash without report it or Microphone stop send frames.
I think that internet is not related if you can receive video because in that case audio and video frames should be affected and you should receive both channels but maybe losing few frames.
Do you have anyway to reproduce it easier?
No way to reproduce unfortunately, but I can introduce more logging to catch it. Any ideas where it could happen? Is it possible it happens in some "catch" and microphone restart should be started?
FYI setMicrophoneMode(MicrophoneMode.ASYNC); is used.
I have 2 main suspects:
-
AudioEncoder crash: https://github.com/pedroSG94/RootEncoder/blob/master/encoder/src/main/java/com/pedro/encoder/BaseEncoder.java#L283 https://github.com/pedroSG94/RootEncoder/blob/master/encoder/src/main/java/com/pedro/encoder/BaseEncoder.java#L276 https://github.com/pedroSG94/RootEncoder/blob/master/encoder/src/main/java/com/pedro/encoder/BaseEncoder.java#L265 I added EncoderErrorCallback to listen this errors yerterday
-
Microphone stop generate frames: https://github.com/pedroSG94/RootEncoder/blob/master/encoder/src/main/java/com/pedro/encoder/input/audio/MicrophoneManager.java#L206 Check if this line is executed. I added this log today but in previous versions this method should return null if microphone fail to read.
Let me know if you can detect the error and we can try to solve it.
Can we release a new version if anything was fixed? Having trouble with adding master branch via implementation in gradle /jitpack.
Hello,
Try this gradle:
implementation 'com.github.pedroSG94:RootEncoder:library:0005d02b5b'
This will compile the library in the actual last commit of master