-
-
Notifications
You must be signed in to change notification settings - Fork 607
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 transmission issue during stream #1208
Comments
It sounds like the sampling rate changed in the middle of the audio. Could you please let me know the previous version of HaishinKit that you were using? I understand that there may be cases where the sampling rate changes during the audio due to notifications or opening/closing of the control panel during the live stream. I downloaded your video. Please delete if needed. |
Thank you. Yes, seems to be happening after notification panel opening. I debugged and got the issue seemingly fixed by changing how I create AudioSession:
|
Unfortunately setting it to .voiceChat breaks external microphones functionality. Is there any way to pause recording while app is in notification center... |
I see. It seems like a good idea to maintain a certain sampling rate on the framework side. Implementing a resampler will take some time, but I will give it a try. I would like to test it, so please let me know the product name of the external microphone you are using. |
Interestingly, inline audio microphones (for example, any mic with TRRS cable and lightning adapter) works even in .voiceChat mode. And the problem with notification center occurs with or without microphones. I think the reason is not sampling rate, but because in Notification center video is not captured, there's a sync issue between video and audio. In recording I hear audio like it's fast-forwarded after notification center swipe up. I'm using didBecomeActiveNotification / willResignActiveNotification. And setting self.rtmpStream.paused = true; / self.rtmpStream.paused = false; |
I'm currently testing it, but in my environment, the capture stops even with .voiceChat(iPhone 13 Pro max iOS16.5.1). Does it work on your end? 1.5.4 (main branch)
—— 1.5.3
|
Currently getting this issue on a lot of streams: Tested your #1236 but it makes streaming almost impossible after reconnect on 4g, or non-ideal internet.. |
By the way, local recording is fine, it's a transmission issue clearly |
Does this mean that the issue is not reproducible when opening and closing the control panel? |
No it seems like not control panel related, we fixed control panel by adding delegate methods to sessionWasInterrupted / sessionInterruptionEnded and we do stopPublish / startPublish in those... |
I checked the mp4, it appears that the audio codec is set to stereo. I believe the standard microphone records in mono, so is this using an external microphone?
|
I'm considering the possibility that after reconnection, the Audio header might not be sent properly. I will test and verify this. |
This is a video file as-transmitted, not recoded FYI: |
Happened on a few different phones/tablets 16.6, 16.5 and even 15.6.1 |
Raw FLV can be helpful for analysis. Thank you for providing it.
|
I have sent another one directly on discord where issue appears mid-stream. Thank you |
packets_timestamps.csv |
How was this timestamp dumped? I can't determine its origin because the output varies depending on the method used for dumping. I tried opening and closing the control panel in the sample (UIKit version) to support stereo output(f7e6c41). As a result, I was able to reproduce similar noise to the FLV mentioned in #1208 (comment). |
I found an error in the implementation of the RingBuffer for stereo format, which was causing the audio waveform to be corrupted. I have already fixed it in this pull request: #1255. |
The issue does not occur when the number of samples captured from the microphone is exactly 1024. However, the problem arises when the number of samples is less than 1024 or greater than 1024. In most cases, the microphone captures 1024 samples, but there are instances where it can be less than 1024 due to certain circumstances. Thank you. |
Describe the bug
We've had at least 3 instances of sound changing to be really bad during the stream:
Local device recording is not affected, streaming only!
To Reproduce
Unfortunately we are not sure.. it seems like someone touches the device in both examples.
Expected behavior
The audio should be fine all along
Version
1.4.5
The problem appeared in recent updates
Smartphone info.
Devices:
Apple iPad Pro 11" 3rd Gen (Wi-Fi/Cellular)
iOS 16.5
Apple iPad Pro 11 inch 2nd Gen
iPadOS 16.4.1
Apple iPhone 12 Pro Max
ios 16.4.1
Additional context
No response
Screenshots
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: