RPI1-512 Audio Dropout playing HD multichannel music - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166) +---- Thread: RPI1-512 Audio Dropout playing HD multichannel music (/showthread.php?tid=222061) |
RE: RPI1-512 Audio Dropout playing HD multichannel music - popcornmix - 2015-03-28 (2015-03-28, 19:44)fritsch Wrote: Wait another idea: Can you change SetSilenceTimer() to always return infinite? So that we "never timeout"? Played the 12m track without a dropout. Running again. Nope, got a dropout. Again visualisation pause was visible. Added this commit to disable SetSilenceTimer. Log file (sorry - too big for the normal paste sites). Dropout occurred here (line 138256) Code: 18:13:22 6262.822266 T:1971082320 NOTICE: CActiveAESink::StateMachine CSinkDataProtocol::TIMEOUT S_TOP_CONFIGURED_SILENCE RE: RPI1-512 Audio Dropout playing HD multichannel music - fritsch - 2015-03-28 We need FernetMenta's visualization of the state machine to find out why we end up in this state at all ... RE: RPI1-512 Audio Dropout playing HD multichannel music - FernetMenta - 2015-03-28 If you end up with output of silence, sink was close to run dry. after OutputSamples https://github.com/popcornmix/xbmc/blob/7d694fca055efaef71a29204b6c34c67c7732d84/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp#L326 AE sets a timer to delay / 2. Within that time it expects a new buffer from AE. Actually it should never get into this state because the next buffer should already be queued. AE queues buffers until WaterLevel reaches a threshold of .25 sec. In this case here there should be always 4-5 messages queued for ActiveAESink. For further investigation you can log delay (the link above) and CEngineStats::GetWaterLevel RE: RPI1-512 Audio Dropout playing HD multichannel music - popcornmix - 2015-03-28 Added logging commit. Failed earlier, so can pastebin this log Code: 19:49:51 657.027710 T:1971844176 NOTICE: ---------------- delay: 99 GetWaterLevel:0.050000 RE: RPI1-512 Audio Dropout playing HD multichannel music - FernetMenta - 2015-03-28 you see that water level goes down from 200ms to 0 and then sink outputs silence. next I would add a log to the other end where player adds packets to the stream. RE: RPI1-512 Audio Dropout playing HD multichannel music - popcornmix - 2015-03-29 Added logmessage, and: http://paste.ubuntu.com/10700497/ So, looks like paplayer goes awol causing the stutter. Any suggestions for where to log next? RE: RPI1-512 Audio Dropout playing HD multichannel music - popcornmix - 2015-03-29 Added extra log message. Got: http://paste.ubuntu.com/10700697/ I don't understand this sequence: Code: 12:17:49 59934.957031 T:1971926096 NOTICE: ---------------- delay: 99 GetWaterLevel:0.050000 First can you explain the water level? How is delay (audio buffered in sink) 99ms, but waterlevel 0? Note, the timestamps are microsecond. So at 59935.007812 the Pi sink reported it had 99ms of audio. Then ~50ms later silence is being output? Why do that when we are going to be happy for another 50ms? RE: RPI1-512 Audio Dropout playing HD multichannel music - FernetMenta - 2015-03-29 GetDelay in this case shows audio buffered in sink. Water level relates to audio buffered in the engine, that's audio queued for processing by ActiveAESink. ActiveAESink pulls data from the input queue (water level) and sends it to the sink. If input is empty, it submits silence to the sink in order to protect from underruns. Buffers are supposed to fill from bottom to the top, then we are in a stable state. RE: RPI1-512 Audio Dropout playing HD multichannel music - FernetMenta - 2015-03-29 Quote:Then ~50ms later silence is being output? Why do that when we are going to be happy for another 50ms? we can't wait until buffers of sink ran dry. in general audio drivers don't accept data at any time but only after an interrupt. but this is not this issue here. the engine runs dry which should not happen. RE: RPI1-512 Audio Dropout playing HD multichannel music - popcornmix - 2015-03-29 (2015-03-29, 16:02)FernetMenta Wrote: we can't wait until buffers of sink ran dry. in general audio drivers don't accept data at any time but only after an interrupt. but this is not this issue here. the engine runs dry which should not happen. How much buffering is there in the system when using paplayer? Is it just the 200ms inside audio engine? I've tried with a USB stick and it didn't stutter (not conclusive as it's intermittent), but it might suggest the problem is underrun from network. dvdplayer can play much higher bitrate files, but it does typically have a few seconds of data bufferered, so can cope with some delay from network. RE: RPI1-512 Audio Dropout playing HD multichannel music - FernetMenta - 2015-03-29 AE only buffers .25 sec of audio. Currently there are vfs issues in particular for samba and nfs. I have seen quite a few problem reports related to those. MAybe something went wrong with all the rework on vfs. RE: RPI1-512 Audio Dropout playing HD multichannel music - popcornmix - 2015-03-29 (2015-03-29, 16:40)FernetMenta Wrote: AE only buffers .25 sec of audio. It looks like setting buffermode=1 is fixing my issue, so I think the current issue I have is just down to the pretty high bitrate of the file (6Mbit/s), the limited buffering in paplayer and my not-great network (I'm going through a wireless bridge at the moment). Any other way of increasing buffering in paplayer? I think there is still another issue. fritsch and MrNice were seeing an issue with local content (and I've seen sink underruns in the past), but I'm not seeing the issue at the moment. One thing for fritsch/MrNice to try is adding (to config.txt): Code: hdmi_samples_limit=384000 You will need a firmware from March 25 or newer to try this (latest Milhouse build would be fine). That will limit the physical audio rate to 8 channels @ 48kHz (by default it is double this). This means Kodi (and Pi Sink) can run at e.g. 6 channels @ 96kHz, but audio will be resampled on GPU down to 48kHz (when multichannel). If this fixes the problem, then there is GPU side problem of getting 6 channels @ 96kHz out through HDMI. If it doesn't fix it, then the problem is more likely on Kodi end. RE: RPI1-512 Audio Dropout playing HD multichannel music - MrNice - 2015-03-29 @popcornmix I did the test: From fresh image, update to OpenELEC Isengard build #0328 Added in config.txt: hdmi_samples_limit=384000 Play in file mode, no browsing 1 drop during 1.50 minute Then change to full screen and no browsing for 2 more minutes No drop http://xbmclogs.com/pjwtcoo2n RE: RPI1-512 Audio Dropout playing HD multichannel music - fritsch - 2015-03-29 @MrNice - could you do the other test as well: Set Output to Fixed, 5.1 channels, samplerate 48000? Does this make it also work? RE: RPI1-512 Audio Dropout playing HD multichannel music - popcornmix - 2015-03-29 @MrNice can you try this test firmware: https://dl.dropboxusercontent.com/u/3669512/temp/firmware_nice.zip and add to config.txt Code: hdmi_mai_thresh=0x1412 |