I implemented the AAC decoder for squeezeplay and later the community
firmware as Logitech never released the code as they used the closed
source fdk-aac library in the official firmware.

I have spent some time investigating this issue but had to setup a local
server that streams AAC 320Kbps at 48KHz as unfortunately the high rate
BBC streams aren't available outside the UK.

What's happening is the aac decoder can't push enough decoded PCM data
to the output buffer at the start of the high rate streams and jive_alsa
throws an underrun error.

So far I have been able to mitigate this problem using this patch to
Playback.lua on the radio. This change stopped the stuttering about 95%
of the time with my test stream.


Code:
--------------------
    --- share/jive/jive/audio/Playback.lua.orig     1969-12-31 
19:00:00.000000000 -0500
  +++ share/jive/jive/audio/Playback.lua  2022-06-20 08:49:07.469506981 -0400
  @@ -908,6 +908,11 @@
  -- Even this may not be enough for files with large comments...
  self.decodeThreshold = self.threshold
  
  +               elseif self.mode == 'a' then
  +                       -- For fdk-aac, we need to let the decoder fill the 
pcm output
  +                       -- buffer, otherwise alsa immediately throws an 
underrun error.
  +                       self.decodeThreshold = 40960
  +
  elseif self.threshold > (254 * 1024) and (self.mode == 'f' or self.mode == 
'p' or self.mode == 'l') then
  -- For lossless (high bit-rate) formats, lets try to get a much bigger chunk 
so that
  -- any server-side delay in streaming caused by playlist updates, etc., do 
not cause undue problems.
  
--------------------


The BBC Sounds Stream throttling interval works around the problem but
might also help find proper fix in the firmware, however the stuttering
doesn't happen with the 96Kbps streams.

Any help would be appreciated.



Ralphy

*1*-Touch, *5*-Classics, *3*-Booms, *2*-UE Radio
'Squeezebox client builds'
(https://sourceforge.net/projects/lmsclients/files/) 'donations'
(https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=LL5P6365KQEXN&lc=CA&item_name=Squeezebox%20client%20builds&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)
always appreciated.
------------------------------------------------------------------------
ralphy's Profile: http://forums.slimdevices.com/member.php?userid=3484
View this thread: http://forums.slimdevices.com/showthread.php?t=113479

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to