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

Choppy audio after updating to iOS 13 #627

Closed
hraza-simublade opened this issue Dec 12, 2019 · 15 comments · Fixed by #640
Closed

Choppy audio after updating to iOS 13 #627

hraza-simublade opened this issue Dec 12, 2019 · 15 comments · Fixed by #640

Comments

@hraza-simublade
Copy link

Describe the bug
I'm running the example iOS app in iOS 13 and streaming with Mux (tried it with Wowza as well) and am having issues with the audio being incredibly choppy. Using different bitrates is not fixing the issue. This was not an issue in iOS 12.

To Reproduce
Steps to reproduce the behavior:

  1. Launch HaishinKit example on device running iOS13
  2. Start stream
  3. Listen to stream playback, it is choppy

Expected behavior
Clear/smooth audio

Desktop (please complete the following information):

  • OS: MacOS
  • XCode 11.2.1

Smartphone (please complete the following information):

  • Device: iPhone X
  • OS: iOS 13.3

Additional context
This problem was not occurring in iOS12.

@nestor82
Copy link

nestor82 commented Dec 13, 2019

I found this bug on only iPhone 11 series. iPhone XS on iOS 13.3 work well, but the steaming by iPhone 11 Pro on iOS 13.3 , sound is very chopping. I tried to change Audiosseion mode, category. but it didn't get well. i tested both recently sdk version and 0.11.9 version, the result was same.

@mkrn
Copy link

mkrn commented Dec 24, 2019

I can confirm the issue on the latest iPhones
this is how the audio sounds (reproduction after conversion to HLS)
https://dwy2ap2fjt6gi.cloudfront.net/b5bcef28-c744-472e-892b-96e1e2589fc4/choppysound.m3u8

@ryo-liveplanet
Copy link

Having this issue as well with iOS13.2 on iPhone 7 Plus. Any workarounds would be appreciated!

@wolfcon
Copy link
Contributor

wolfcon commented Jan 21, 2020

Try this
sampleRate: 48_000

@ryo0ka
Copy link

ryo0ka commented Feb 1, 2020

Try this
sampleRate: 48_000

Not working.

@DaveMurchison83
Copy link

That fixed the issue for me. Audio is much improved by setting sampleRate to 48_000

@shogo4405
Copy link
Owner

HaishinKit has no feature (down|up)Sample rate.

Xcode console log:

2020-09-02 17:01:41.565 [Info] [com.haishinkit.HaishinKit] [AudioConverter.swift:89] inSourceFormat > Optional(__C.AudioStreamBasicDescription(mSampleRate: 48000.0, mFormatID: 1819304813, mFormatFlags: 41, mBytesPerPacket: 4, mFramesPerPacket: 1, mBytesPerFrame: 4, mChannelsPerFrame: 1, mBitsPerChannel: 32, mReserved: 0))

Solution 1. Please set a same value, mSampleRate.

rtmpStream.audioSettings = [
    .sampleRate: sampleRate, 
]

Solution 2. Please unset a sampleRate value.

rtmpStream.audioSettings = [
    .sampleRate: 0, 
]

@ryo-liveplanet
Copy link

@shogo4405 Thanks, the 2nd solution worked. Set .sampleRate to 0.

@mkrn
Copy link

mkrn commented Feb 15, 2020

@ryo-liveplanet 2nd solution didn't work for me.
avAudioSampleRate: Double = 0

On the server-side I'm converting with FFPMEG to
-b:a 48000
-r 30 \

WIth iPhone 11 and latest iOS it still came out choppy.

https://live.eventlive.pro/marinaachernova/test-event-1

It works good with iPhone 8 however.

@shogo4405
Copy link
Owner

I think might be fixed it #640. Please update and try master branch.
Don't forget.

rtmpStream.audioSettings = [
.sampleRate: 0,
]

@MikeDonahue
Copy link

MikeDonahue commented Feb 17, 2020

@shogo4405 Tried master on an iPhone 11, iOS 13.1. Still choppy audio

@mkrn
Copy link

mkrn commented Feb 25, 2020

Any ideas? @shogo4405 Could it be related to different aspect ratios? Anything has changed in iOS APIs for new version phones?

@shogo4405
Copy link
Owner

shogo4405 commented Feb 26, 2020

@mkrn How about master branch?

I want two informations.
print(sampleBuffer)
print(sampleBuffer.numSamples)

@shogo4405
Copy link
Owner

shogo4405 commented Mar 8, 2020

I belived fixed this issue #640.
If not fixed this issue, please open an new issue.

@mkrn
Copy link

mkrn commented Mar 20, 2020

@shogo4405 the master fixes the problem. Thank you very much!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants