mrw wrote: 
> Trying this. Sometimes I think it's a bit better, and then the problem
> emerges. So I'm not convinced that it is the cause. It was a wild idea,
> really.
> 
> The "pre-roll" (first 10 seconds ? or so) is always bad, even on stock
> firmware.
> 
> Happy to help with a "bisect", or similar, if that would help.

After reviewing several of the other decoders, I think I've tracked down
the "pre-roll" issue with the AAC decoder.

I was not "pulling" enough decoded audio sample to the output buffer for
each decoded aac frame, so the output buffer was underrunning.  Also
took the opportunity to rearrange the buffer copy based on the number of
channels to check for stereo first instead of mono.  As 2 channel stereo
is the most likely value, not 1 channel mono.

With the latest changes here's the log from playing the 'problematic
stream posted by staresy'
(https://forums.slimdevices.com/showthread.php?113479-Announce-Community-Firmware-for-Squeezebox-Radio-Touch-Controller-and-LMS-8&p=1009636&viewfull=1#post1009636).


Code:
--------------------
    Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - decode_start:705 
decode_start                                                                   
  Feb 25 08:25:46 squeezeplay: INFO   audio.decode - decode_start_handler:281 
init decoder aac                                                       
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - 
decode_output_set_track_gain:520 Track gain 65536                               
                
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - 
decode_output_set_track_gain:524 Track clip range 7fffffff 80000000             
                
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - 
decode_set_track_polarity_inversion:529 Polarity inversion 0                    
                
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - 
decode_set_output_channels:537 Output channels left 0, right 0                  
 
  Feb 25 08:25:46 squeezeplay: INFO   audio.decode - Playback.lua:477 connect 
192.168.100.22:9000 GET /stream.mp3?player=00:04:20:xx:xx:xx HTTP/1.0^M
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - stream_connectL:506 
streambuf connect 192.168.100.22:9000                                       
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - Playback.lua:1262 stopping 
local pause timer                                                    
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - Playback.lua:1192 gainL, 
gainR: 333 333                                                                  
           
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - Playback.lua:397 resume 
decoder, 28672 bytes buffered, decode threshold 2048                    
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - decode_resume_decoder:580 
decode_resume_decoder                                                 
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - 
decode_resume_decoder_handler:122 resume_decoder decode state: 1 audio state 1  
                
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - debug_fullness:112 
fullness: 28672 / 900416 | 0.91% / 25.52%                                    
  Feb 25 08:25:46 squeezeplay: DEBUG  audio.decode - decode_output_samples:280 
first buffer sample_rate=44100                                        
  Feb 25 08:25:46 squeezeplay: INFO   audio.decode - Playback.lua:448 
4.3%/27.7%                                                                     
  Feb 25 08:25:47 squeezeplay: INFO   audio.decode - Playback.lua:448 
22.5%/27.5%                                                                    
  Feb 25 08:25:48 squeezeplay: DEBUG  audio.decode - Playback.lua:381 status 
TRACK STARTED (elapsed: 2)                                              
  Feb 25 08:25:50 squeezeplay: INFO   audio.decode - Playback.lua:448 
48.7%/25.4%                                                                    
  Feb 25 08:25:54 squeezeplay: INFO   audio.decode - Playback.lua:448 
61.8%/44.9%                                                                    
  Feb 25 08:25:55 squeezeplay: INFO   audio.decode - Playback.lua:448 
82.4%/44.5%                                                                    
  Feb 25 08:25:56 squeezeplay: INFO   audio.decode - Playback.lua:448 
99.9%/44.8%                                                                    
  Feb 25 08:25:57 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/47.2%                                                                   
  Feb 25 08:25:58 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/49.5%                                                                   
  Feb 25 08:25:59 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/51.9%                                                                   
  Feb 25 08:26:00 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/54.7%                                                                   
  Feb 25 08:26:01 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/57.3%                                                                   
  Feb 25 08:26:02 squeezeplay: INFO   audio.decode - Playback.lua:448 
99.9%/60.2%                                                                    
  Feb 25 08:26:03 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/62.7%                                                                   
  Feb 25 08:26:04 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/65.3%                                                                   
  Feb 25 08:26:05 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/68.0%                                                                   
  Feb 25 08:26:07 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/70.3%                                                                   
  Feb 25 08:26:08 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/73.1%                                                                   
  Feb 25 08:26:09 squeezeplay: INFO   audio.decode - Playback.lua:448 
99.9%/75.4%                                                                    
  Feb 25 08:26:10 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/78.1%                                                                   
  Feb 25 08:26:11 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/80.4%                                                                   
  Feb 25 08:26:12 squeezeplay: INFO   audio.decode - Playback.lua:448 
99.9%/83.5%                                                  
  Feb 25 08:26:13 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/86.5%                                                 
  Feb 25 08:26:14 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/88.4%                                                 
  Feb 25 08:26:15 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/90.7%                                                 
  Feb 25 08:26:16 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/93.1%                                                 
  Feb 25 08:26:17 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/96.1%                                                 
  Feb 25 08:26:18 squeezeplay: INFO   audio.decode - Playback.lua:448 
99.9%/98.4%                                
  Feb 25 08:26:19 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/98.5%                                       
  Feb 25 08:26:20 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/98.5%                                       
  Feb 25 08:26:21 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/98.4%                                       
  Feb 25 08:26:22 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/97.1%                     
  Feb 25 08:26:23 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/97.7%  
  Feb 25 08:26:24 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/97.8%          
  Feb 25 08:26:25 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/97.8%                                       
  Feb 25 08:26:27 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/98.7%               
  Feb 25 08:26:28 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/98.6%          
  Feb 25 08:26:29 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/98.6%
  Feb 25 08:26:30 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/97.9%               
  Feb 25 08:26:31 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/97.5%
  Feb 25 08:26:32 squeezeplay: INFO   audio.decode - Playback.lua:448 
99.9%/97.8%               
  Feb 25 08:26:33 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/97.8%   
  Feb 25 08:26:34 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/97.4%
  Feb 25 08:26:35 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/98.2%               
  Feb 25 08:26:36 squeezeplay: INFO   audio.decode - Playback.lua:448 
100.0%/98.4%
--------------------


Previously the decode and output buffers would hardly ever fill above
1-2%.

I'd be interested to know if the changes make a difference for others. 
It would be good to know if Tidal aac playback is better as well, but I
don't have an account.

I've uploaded a 'jive binary replacement'
(https://sourceforge.net/projects/lmsclients/files/squeezeos/baby-jive-aac-stutterfix-8.0.1r16835.tar.gz/download)
with the changes.
The binary also includes support for the new Mono Output Channel Mode
added to LMS 8.2, which for the radio is really only useful when using
the line out/headphone jack. I just needed to confirm that the downmix
changes didn't impact performance on the radio.

The tarfile also includes the patches applied to the binary as I've not
committed them yet.



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
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to