# Net Stream hiccups at a regular rate

**URL:** <https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783>\
**Category:** FMOD Engine\
**Created:** [January 25, 2023, 5:29am UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783 "2023-01-25T05:29:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![akleshchev](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@akleshchev](https://qa.fmod.com/u/akleshchev)\
**Post date:** [January 25, 2023, 5:29am UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/1 "2023-01-25T05:29:11Z")

</div>

Hello

FMOD playbacks some net streams with frequent hiccups and pauses.

As an example: [http://radio.plaza.one/mp3](http://radio.plaza.one/mp3) , this plays smooth in chrome, but when played from our application it hiccups and is rather unbearable. To make sure issue is not specific to our application I tried replacing stream from “FMOD SoundSystem\FMOD Studio API Windows\api\core\examples\vs2017\net\_stream.vcxproj” with the link from above and issue is present there as well.

Logs:

```auto
[LOG] SystemI::init : Initialize version=20209 (128289), maxchannels=32, flags=0x00110004
[LOG] SystemI::setOutputInternal : Setting output to 'FMOD WASAPI Output'
[LOG] OutputWASAPI::init : Mix Format (WAVEFORMATEX): wFormatTag=0xFFFE, nChannels=2, nSamplesPerSec=48000, nAvgBytesPerSec=384000, nBlockAlign=8, wBitsPerSample=32, cbSize=22.
[LOG] OutputWASAPI::init : Mix Format (WAVEFORMATEXTENSIBLE): wValidBitsPerSample=32, dwChannelMask=0x00000003, SubFormat=00000003-0000-0010-8000-00AA00389B71.
[LOG] OutputWASAPI::init : Output buffer size: 4096 samples, latency: 0.00ms, period: 10.00ms, DSP buffer: 1024 * 4
[LOG] Thread::initThread : Init FMOD stream thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFB, Stack Size: 98304, Semaphore: No, Sleep Time: 10, Looping: Yes.
[LOG] Thread::initThread : Init FMOD mixer thread. Affinity: 0x4000000000000001, Priority: 0xFFFF7FFA, Stack Size: 81920, Semaphore: No, Sleep Time: 0, Looping: Yes.
[LOG] SystemI::createSound : filename = http://radio.plaza.one/mp3 : mode 02010088
[LOG] SystemI::createSound : FMOD_NONBLOCKING specified. Putting into queue to be opened asynchronously!
[LOG] Thread::initThread : Init FMOD nonblocking thread (0). Affinity: 0x4000000000000003, Priority: 0xFFFF7FFC, Stack Size: 114688, Semaphore: Yes, Sleep Time: 0, Looping: Yes.
[LOG] SystemI::createSound : setdata soundi = 000001A791770C38 : node = 000001A79EBDC5B0
[LOG] SystemI::createSound : add node to async list : head = 000001A7943CBAB8. list count = 0
[LOG] AsyncThread::threadFunc : Starting Asynchronous operation on sound 000001A791770C38
[LOG] SystemI::createSoundInternal : Create name='http://radio.plaza.one/mp3', mode=0x02010088
[LOG] FMOD_OS_Net_Connect : Attempting connection to '[2606:4700:3034::ac43:9a8e]:80'
[LOG] Profile::init : Profiler listening on port: 9264
[ERR] CodecOggVorbis::openInternal : failed to open as ogg
[ERR] CodecMIDI::openInternal : 'HThd' ID check failed [???d]
[LOG] SystemI::createSoundInternal : Stream: name='(null)', format=2, channels=2, frequency=44100, lengthbytes=-1, lengthpcm=-1, pcmblocksize=1152, loopstart=0, loopend=0, mode=0x00000000, channelmask=0x00000000, channelorder=0, peakvolume=0.000000.
[LOG] Thread::initThread : Init FMOD file thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFC, Stack Size: 65536, Semaphore: No, Sleep Time: 10, Looping: Yes.
[LOG] AsyncThread::threadFunc : Finished Asynchronous operation on sound 000001A791770C38
[WRN] DSPI::setChannelFormat : Ignoring channelmask (deprecated).
[LOG] SoundI::release : mp3 (000001A791770C38)
[LOG] SoundI::release : (null) (000001A79469A3E8)
[LOG] Thread::callback : FMOD file thread finished.
[LOG] Codec::release : Free PCM Buffer
[LOG] Thread::callback : FMOD stream thread finished.
[LOG] Thread::callback : FMOD mixer thread finished.
[LOG] Profile::disconnectAll : Profiler disconnecting all clients
[LOG] SystemI::close : Closed.
[LOG] Thread::callback : FMOD nonblocking thread (0) finished.

```

P.S. Our users are complaining about multiple custom stream, but this one appears the most obvious and severely affected by both, frequent hiccups and regular pauses

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 27, 2023, 5:31am UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/2 "2023-01-27T05:31:47Z")

</div>

Hi,

There are a couple of things that can cause hiccups you are experiencing.

As the sound is being streamed from the internet, depending on the speed will dictate how quickly data is supplied to the buffer. These hiccups occur as there is no new data for the buffer to read. A solution may be increasing the size of the buffer when it is created e.g.

```auto
system->setStreamBufferSize(128*1024*4, FMOD_TIMEUNIT_RAWBYTES);

```

([FMOD API | Core API Reference](https://fmod.com/docs/2.02/api/core-api-system.html#system_setstreambuffersize))  
Hope this helps!

---

<div class="post-metadata">

**Author:** ![akleshchev](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@akleshchev](https://qa.fmod.com/u/akleshchev)\
**Post date:** [January 27, 2023, 6:38am UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/3 "2023-01-27T06:38:17Z")

</div>

> [@Connor\_FMOD](#):
>
> `setStreamBufferSize`

Thank you, but this does not affect ‘hickups’, which appear to be momentary deformations of sound once per second (like someone drags a vinyl).

Buffer does somewhat affects pauses (stream being in ‘starving’ state), with buffer `128 * 1024 * 4` pauses happen each 31 second, with `256 * 1024 * 4` buffer pauses happen each 63 seconds. But I suspect that pauses are somehow related to first issue or otherwise are causes by FMOD buffering slower than it plays.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 29, 2023, 10:25pm UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/4 "2023-01-29T22:25:46Z")

</div>

Thanks for the clarification on the hiccups. If you use the [URL](http://live-radio01.mediahubaustralia.com/2TJW/mp3/) provided in the FMOD examples do you still experience the audio distortion?

---

<div class="post-metadata">

**Author:** ![akleshchev](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@akleshchev](https://qa.fmod.com/u/akleshchev)\
**Post date:** [January 30, 2023, 2:14am UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/5 "2023-01-30T02:14:46Z")

</div>

Yes, tried it again, issue still reproduces if I use this url in “FMOD SoundSystem\FMOD Studio API Windows\api\core\examples\vs2017\net\_stream.vcxproj”

P.S. Users reported same problem for:  
[https://stream.nightride.fm/nightride.mp3](https://stream.nightride.fm/nightride.mp3) (personally reproed both pasues and distortions, but distortions here are longer, audio is drastically distorted from how it sounds in chrome)  
[http://server1.chilltrax.com:9000/](http://server1.chilltrax.com:9000/) (wasn’t able to repro distortions, but it does starve roughlty once per minute, QA reproed both)

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 30, 2023, 3:56am UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/7 "2023-01-30T03:56:55Z")

</div>

Thank you for those URL’s.

FMOD expects `icecast streaming servers` to send headers in lowercase but certain streams aren’t. Unfortunately, at this time there is no workaround. I have passed this on to our development team to fix and when we solve the issue I will let you know.

Thank you for bringing this to our attention.

---

<div class="post-metadata">

**Author:** ![akleshchev](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@akleshchev](https://qa.fmod.com/u/akleshchev)\
**Post date:** [February 1, 2023, 7:14pm UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/8 "2023-02-01T19:14:46Z")

</div>

Ok, thank you.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [February 8, 2023, 3:10am UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/9 "2023-02-08T03:10:20Z")

</div>

Hi,

The issue has been fixed and will be available in our next release.

---

<div class="post-metadata">

**Author:** ![akleshchev](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@akleshchev](https://qa.fmod.com/u/akleshchev)\
**Post date:** [February 8, 2023, 11:05pm UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/10 "2023-02-08T23:05:46Z")

</div>

Thank you, will check it, once it is out.

---

<div class="post-metadata">

**Author:** ![akleshchev](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@akleshchev](https://qa.fmod.com/u/akleshchev)\
**Post date:** [March 22, 2023, 5:27pm UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/11 "2023-03-22T17:27:57Z")

</div>

Tried 2.02.13 and streams I tried no longer have distortions.  
Thank you.

Pauses (starvation) are still there at the same interval of ~40 seconds, it might be a network issue but vlc works fine.

P.S. Fo some reason web [docs](https://www.fmod.com/docs/2.02/api/welcome-revision-history.html) do not list this revision despite it being available for download.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [March 22, 2023, 10:19pm UTC](https://qa.fmod.com/t/net-stream-hiccups-at-a-regular-rate/19783/12 "2023-03-22T22:19:48Z")

</div>

Good to hear it is working! The pauses do sound like network latency.

The revision is mentioned in the list as:

- [Core API - Fixed playback issues with certain ice/shoutcast net-streams.](https://www.fmod.com/docs/2.02/api/welcome-revision-history.html#:~:text=Core%20API%20%2D%20Fixed%20playback%20issues%20with%20certain%20ice/shoutcast%20net%2Dstreams)

If you have any more questions, please don’t hesitate to ask.
