Kodi Community Forum

Full Version: Audio only on channel switch - AmLogic HW decoding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am experiencing an error as follows:

- XBMC Gotham nightly from 2014-01-24 running on ATV1200 with 720x567@50Hz component output enabled (but same error with HDMI)
- HW video decoding for AMLogic enabled in settings
- Live TV running with pvr.hts from a TVheadend backend on synology Diskstation, works flawlessly with XBMC nightly on Win32

When switching channels either with Channel up on the remote control or via the TV channels menu, in ca. 1/4 I get a black video screen with audio only playing. Sometimes switching up and down again cures the problem, so basically every channel can be played. When the video is missing, I can see plot information pop up above the Video HMI.
With HW decoding switched off and thus video decoding with ffmpeg, channel switching works perfectly.

Log file: http://xbmclogs.com/show.php?id=115793

Explanation:
Basically, a clean start of XBMC, activate Live TV
From 647. on I start playing the very first TV channel and press 'Up' repeatedly after each channel is showing.
The first 4 channels are playing fine.

At 1138. I press Up for the 5th channel, which plays audio only.
A series of errors show up, which were not thrown with the previous 4 channels:
1163. 21:09:05 T:1651441656 ERROR: Got MSGQ_ABORT or MSGO_IS_ERROR return true
...
1183. 21:09:05 T:1680473552 ERROR: Got MSGQ_ABORT or MSGO_IS_ERROR return true (-1)
...
1187. 21:09:05 T:1682982720 WARNING: CDVDMessageQueue(audio)::Put MSGQ_NOT_INITIALIZED
1188. 21:09:05 T:1682982720 WARNING: CDVDMessageQueue(video)::Put MSGQ_NOT_INITIALIZED
...

I do not really know if these errors are to be taken seriously or could be ignored for the problem under investigation.

Then the Decoder is started, 1237 and following:

21:09:05 T:1682982720 DEBUG: FactoryCodec - Video: amcodec - Opening
21:09:05 T:1682982720 INFO: DVDVideoCodecAmlogic: Opened Amlogic Codec
21:09:05 T:1682982720 DEBUG: FactoryCodec - Video: am-mpeg2 - Opened
21:09:05 T:1554405200 DEBUG: CAMLCodec::CloseDecoder
21:09:05 T:1554405200 DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_RESYNC(0.000000, 1)
21:09:05 T:1554405200 DEBUG: DVDVideoCodecAmlogic: detected mpeg2 aspect ratio(1.777778), framerate(25.000000), video_rate(3840)
21:09:05 T:1554405200 DEBUG: CAMLCodec::OpenDecoder, android version 16
21:09:05 T:1554405200 DEBUG: codecid_to_vformat, id(2) -> vformat(0)
21:09:05 T:1554405200 DEBUG: codec_tag_to_vdec_type, codec_tag(2) -> vdec_type(0)
21:09:05 T:1554405200 DEBUG: CAMLCodec::OpenDecoder hints.width(704), hints.height(576), hints.codec(2), hints.codec_tag(0), hints.pid(1)
21:09:05 T:1554405200 DEBUG: CAMLCodec::OpenDecoder hints.fpsrate(25000), hints.fpsscale(1000), hints.rfpsrate(25000), hints.rfpsscale(1000), video_rate(3840)
21:09:05 T:1554405200 DEBUG: CAMLCodec::OpenDecoder hints.aspect(1.777778), video_ratio.num(1), video_ratio.den(1)
21:09:05 T:1554405200 DEBUG: CAMLCodec::OpenDecoder hints.orientation(0), hints.forced_aspect(0), hints.extrasize(86)
21:09:05 T:1554405200 DEBUG: CAMLCodec::SetSpeed, speed(1000)
21:09:05 T:1553624800 DEBUG: CAMLCodec::Process Started
21:09:05 T:1554405200 DEBUG: ERROR check in pts error!
21:09:05 T:1554405200 DEBUG: check in pts failed

which results in repeated "check in pts error" messages while playing audio only.

This particular channel is 704x576 instead of 720x576, but that should not represent a major challenge since 704x576 is a usual DVB-T format.

As I understand the code, check in pts results in an ioctl passing the pts data to the running HW decoder. So I interpret the error as the decoder not running properly despite "process started" msg. Maybe the decoder fails on the firmware side, since the XBMC side and interface to the decoder seems to be up and running. But that is a mere guess, not knowing precisely what goes on inside, and not having fully understood the DVDPlayer and AMLCodec architecture.

Is someone else experiencing this behaviour, perhaps on a different AmLogic device or with a different PVR client?
Any ideas what I could investigate to track down the cause of this error?

Will add information as I dig deeper into this issue.

Thank you in advance!!!

Cheers

Michael
check permissions
Hello,

thank you for your advice! I have checked permissions for the /sys/class/video tree and for the tsync tree. Both are set as XBMC does during startup. I have changed all permissions to 666 to be sure. Unfortunately this does not improve the described behaviour for switching live tv channels.

From inspecting the video and tsync properties while running XBMC I have found that
1. In good case, live tv playing perfectly:
- reported VFrame rate is ca. 25 fps
- VFrame parameters contain values
- pool_size=4
- buf_free_num=0
- buf_recycle_num=0
- buf_avail_num=3
- tsync/pts_video is continuously increasing

2. In bad case, audio only playing after switching channel:
- VFrame rate is anything between 0.83 and 9.22 fps
- VFrame parameters are "vframe no states"
- tsync/pts_video is 0x0

In both cases the resolution is reported as 720x576.

So I guess that the decoder is not running at all, either not initialised or being fed a unusable stream. After switching back and forth video is often playing fine, so I would rule out a systematic problem with some special channels or with the way the video format is passed to the decoder.

I have noticed that for pvr the decoder is closed and opened in quite a fast sequence. Maybe it does not have enough time to complete these cycles in all cases.

Is there a chance, that I can probe, if there was an attempt to initialise the decoder after switching channels, and if the stream fed to the decoder is valid?

With FFMpeg all is fine - is it more forgiving with initialisation, rapid cycling or problematic streams?

Cheers

Michael
Hello,

I have tried the scenario with DVBLink instead of pvr.hts.
Channel switching works now flawlessly but very slow (ca 8 sec). As far as I know, DVBLink uses a FFMPEG demuxer instead of internal demuxer (as in pvr.hts). That points me to the interface between demuxer and DVDPlayer which seems to deliver unusable video streams to the Amlogic decoder in some cases. However, I have not found out why disabling Amcodec cures the problem.

Cheers

Michael
Hi I also have this problem. No video, only sound, after switching channels usjng up or down. Works ok if I stop the video and play a diferent channel. Using tvheadend and latest fotham beta.
Hello,

same problem here.... also using xbmc gotham on amlogic mx media player and tvheadend
Hi!

Have the same Problem, I use a beelink M8. Tried different android images from freaktab and all XBMC Versions and forks from 13.0 to 14.2. All have the same issues.

After starting xbmc, the first channel works fine. But after 3 Channel Switches max the screen stays black, only audio.

I get the error "ERROR check in pts error!" in the log all the time.

Searched all important forums, and google did not help either.

MKVs work fine (480p, 720p, 1080p with DTS, DD 5.1 etc,.), just the live TV with vdr-vnsi not, a real show stopper for me.

Did anyone solve this?

Thanks!

Markus
I'm looking into this for Pivos, no eta on solution yet.
(2014-08-17, 17:39)mboka Wrote: [ -> ]Hi!

Have the same Problem, I use a beelink M8. Tried different android images from freaktab and all XBMC Versions and forks from 13.0 to 14.2. All have the same issues.

After starting xbmc, the first channel works fine. But after 3 Channel Switches max the screen stays black, only audio.

I get the error "ERROR check in pts error!" in the log all the time.

Searched all important forums, and google did not help either.

MKVs work fine (480p, 720p, 1080p with DTS, DD 5.1 etc,.), just the live TV with vdr-vnsi not, a real show stopper for me.

Did anyone solve this?

Thanks!

Markus

I have probably the same problem with the same device. But in my case I experience only problems with HD (720p or 180i) stations. e Switching from one SD station to another is absolutely smooth. Maybe you switch back to SD stations for the meanwhile. No problems would be there. On linux (raspberry or pc switching is no problem)
But I/We would like of course to look HD live TV with the box.
BTW: The box itself can play smoothly the vdr recordings from 720p or 1080i stations.
Who can solve this? How can I assist to debug the problem?

Kind Regards
Wolfgang
Only HD here, too. SD works, but I don't watch them normaly.

Switching back to SD and then to HD does not work, still no HD after that.

I think it has something to do with the AMLogic HW acceleration (timing problem due too switching?), so I hope for new drivers or something like that.
Possible close then open amcodec too fast. The AML driver does not like that.
Yes, that could it be. The old stream is stopped and the new one restarted almost immediately. Maybe a delay of a second or more would help. But I have no idea how to realize that.
add a 1/2 second sleep after line 1708 (ShowMainVideo(false)Wink in https://github.com/xbmc/xbmc/blob/master...LCodec.cpp


usleep(500 * 1000);
Thanks! I'll keep you informed if this helps (I hope Stane/or someone else from freaktab implements that, unfortunately, I'm not very experienced in compiling for Android)