Hyperion issue: playback slowdown and halting.

  • Hi everybody! I'm using LE8 (builds from kszaq, afl1 and johngalt) either on s905 (K1 Plus) and s905x (Coowell V5) devices, and i've faced same playback problem only when hyperion enabled: absolutely randomly video becomes glitchy, slows down and finally hangs for a while (live-tv) or jumps-over a little bit forward (other media). Same time in kodi.log appears "Process - stream stalled" and "WaitForBuffer - timeout waiting for buffer" warnings. One more thing i've noticed - during hyperion's running there is enormous amount of "codec:amvideocap"-related messages floods the kernel's log (see example below). Googling this messages gave me this, so now i believe that my problems are related to kernel.

    Please, could someone of our amazing developers help me to overcome this annoying bug? Many thanks in advance!

    Display Spoiler

    ...

    [35612.339682@0] codec:*****************Into VIDTYPE_VIU_422******************


    [35612.339687@0] codec:RGB_phy_addr:67e00000


    [35612.339692@0] codec:RGB_addr:ffffffc067e00000


    [35612.339703@0] codec:y_index=[0xf1] u_index=[0x0] cur_index:f1


    [35612.339709@0] codec:w=3840-height=544 cur_index:f1


    [35612.339715@0] codec:cd.addr:67e00000


    [35612.342564@0] codec:amvideocap_capture_one_frame: capture ok priv->want.fmt=16777728


    [35612.342571@0] codec:amvideocap_capture_one_frame priv->state=300


    [35612.342575@0] codec:amvideocap_capture_one_frame_wait ret=0


    [35612.342583@0] codec:amvideocap_read=0,priv->state=300,priv->vaddr=ffffffc067e00000


    [35612.342588@0] codec:priv->out_width=160 priv->out_height=160


    [35612.342593@0] codec: priv->outfmt_byteppix=3, size=76800


    [35612.379084@0] codec:start amvideocap_read waitdelay=1000


    [35612.379128@0] codec:amvideocap_capture_one_frame:start vf= (null),index=0


    [35612.379154@0] codec:amvideocap_capture_one_frame: get vf type=3800


    [35612.379178@0] codec:*****************Into VIDTYPE_VIU_422******************


    [35612.379198@0] codec:RGB_phy_addr:67e00000


    [35612.379215@0] codec:RGB_addr:ffffffc067e00000


    [35612.379250@0] codec:y_index=[0xf1] u_index=[0x0] cur_index:f1


    [35612.379272@0] codec:w=3840-height=544 cur_index:f1


    [35612.379290@0] codec:cd.addr:67e00000


    [35612.382335@0] codec:amvideocap_capture_one_frame: capture ok priv->want.fmt=16777728


    [35612.382358@0] codec:amvideocap_capture_one_frame priv->state=300


    [35612.382376@0] codec:amvideocap_capture_one_frame_wait ret=0


    [35612.382402@0] codec:amvideocap_read=0,priv->state=300,priv->vaddr=ffffffc067e00000


    [35612.382423@0] codec:priv->out_width=160 priv->out_height=160


    [35612.382441@0] codec: priv->outfmt_byteppix=3, size=76800


    [35612.419072@3] codec:start amvideocap_read waitdelay=1000


    [35612.419114@3] codec:amvideocap_capture_one_frame:start vf= (null),index=0


    [35612.419140@3] codec:amvideocap_capture_one_frame: get vf type=3800


    [35612.419163@3] codec:*****************Into VIDTYPE_VIU_422******************


    [35612.419182@3] codec:RGB_phy_addr:67e00000


    [35612.419200@3] codec:RGB_addr:ffffffc067e00000


    [35612.419233@3] codec:y_index=[0xf1] u_index=[0x0] cur_index:f1


    [35612.419255@3] codec:w=3840-height=544 cur_index:f1


    [35612.419276@3] codec:cd.addr:67e00000


    [35612.422338@0] codec:amvideocap_capture_one_frame: capture ok priv->want.fmt=16777728


    [35612.422364@0] codec:amvideocap_capture_one_frame priv->state=300


    [35612.422383@0] codec:amvideocap_capture_one_frame_wait ret=0


    [35612.422410@0] codec:amvideocap_read=0,priv->state=300,priv->vaddr=ffffffc067e00000


    [35612.422431@0] codec:priv->out_width=160 priv->out_height=160


    [35612.422449@0] codec: priv->outfmt_byteppix=3, size=76800


    [35612.459681@3] codec:start amvideocap_read waitdelay=1000


    [35612.459697@3] codec:amvideocap_capture_one_frame:start vf= (null),index=0


    [35612.459705@3] codec:amvideocap_capture_one_frame: get vf type=3800


    [35612.459711@3] codec:*****************Into VIDTYPE_VIU_422******************


    [35612.459717@3] codec:RGB_phy_addr:67e00000


    [35612.459721@3] codec:RGB_addr:ffffffc067e00000


    [35612.459731@3] codec:y_index=[0xf1] u_index=[0x0] cur_index:f1


    [35612.459737@3] codec:w=3840-height=544 cur_index:f1


    [35612.459742@3] codec:cd.addr:67e00000


    [35612.462592@3] codec:amvideocap_capture_one_frame: capture ok priv->want.fmt=16777728


    [35612.462598@3] codec:amvideocap_capture_one_frame priv->state=300


    [35612.462603@3] codec:amvideocap_capture_one_frame_wait ret=0


    [35612.462610@3] codec:amvideocap_read=0,priv->state=300,priv->vaddr=ffffffc067e00000


    [35612.462616@3] codec:priv->out_width=160 priv->out_height=160


    [35612.462621@3] codec: priv->outfmt_byteppix=3, size=76800


    [35612.499661@3] codec:start amvideocap_read waitdelay=1000


    [35612.499679@3] codec:amvideocap_capture_one_frame:start vf= (null),index=0


    [35612.499686@3] codec:amvideocap_capture_one_frame: get vf type=3800


    [35612.499693@3] codec:*****************Into VIDTYPE_VIU_422******************


    [35612.499699@3] codec:RGB_phy_addr:67e00000


    [35612.499703@3] codec:RGB_addr:ffffffc067e00000


    [35612.499714@3] codec:y_index=[0xf1] u_index=[0x0] cur_index:f1


    [35612.499720@3] codec:w=3840-height=544 cur_index:f1


    [35612.499725@3] codec:cd.addr:67e00000


    [35612.502589@3] codec:amvideocap_capture_one_frame: capture ok priv->want.fmt=16777728


    [35612.502596@3] codec:amvideocap_capture_one_frame priv->state=300


    [35612.502601@3] codec:amvideocap_capture_one_frame_wait ret=0


    [35612.502608@3] codec:amvideocap_read=0,priv->state=300,priv->vaddr=ffffffc067e00000


    [35612.502614@3] codec:priv->out_width=160 priv->out_height=160


    [35612.502619@3] codec: priv->outfmt_byteppix=3, size=76800


    [35612.540390@3] codec:start amvideocap_read waitdelay=1000


    [35612.540407@3] codec:amvideocap_capture_one_frame:start vf= (null),index=0


    [35612.540416@3] codec:amvideocap_capture_one_frame: get vf type=3800


    [35612.540423@3] codec:*****************Into VIDTYPE_VIU_422******************


    [35612.540429@3] codec:RGB_phy_addr:67e00000


    [35612.540434@3] codec:RGB_addr:ffffffc067e00000


    [35612.540445@3] codec:y_index=[0xf1] u_index=[0x0] cur_index:f1


    [35612.540452@3] codec:w=3840-height=544 cur_index:f1


    [35612.540457@3] codec:cd.addr:67e00000


    [35612.543332@3] codec:amvideocap_capture_one_frame: capture ok priv->want.fmt=16777728


    [35612.543344@3] codec:amvideocap_capture_one_frame priv->state=300


    [35612.543349@3] codec:amvideocap_capture_one_frame_wait ret=0


    [35612.543357@3] codec:amvideocap_read=0,priv->state=300,priv->vaddr=ffffffc067e00000


    [35612.543363@3] codec:priv->out_width=160 priv->out_height=160


    [35612.543368@3] codec: priv->outfmt_byteppix=3, size=76800


    [35612.578968@3] codec:start amvideocap_read waitdelay=1000


    [35612.578995@3] codec:amvideocap_capture_one_frame:start vf= (null),index=0


    [35612.579009@3] codec:amvideocap_capture_one_frame: get vf type=3800


    [35612.579021@3] codec:*****************Into VIDTYPE_VIU_422******************


    [35612.579032@3] codec:RGB_phy_addr:67e00000


    [35612.579040@3] codec:RGB_addr:ffffffc067e00000


    [35612.579060@3] codec:y_index=[0xf1] u_index=[0x0] cur_index:f1


    [35612.579072@3] codec:w=3840-height=544 cur_index:f1


    [35612.579082@3] codec:cd.addr:67e00000


    [35612.582031@3] codec:amvideocap_capture_one_frame: capture ok priv->want.fmt=16777728


    [35612.582046@3] codec:amvideocap_capture_one_frame priv->state=300


    [35612.582055@3] codec:amvideocap_capture_one_frame_wait ret=0


    [35612.582070@3] codec:amvideocap_read=0,priv->state=300,priv->vaddr=ffffffc067e00000


    [35612.582080@3] codec:priv->out_width=160 priv->out_height=160


    [35612.582090@3] codec: priv->outfmt_byteppix=3, size=76800


    [35612.618870@3] codec:start amvideocap_read waitdelay=1000


    [35612.618898@3] codec:amvideocap_capture_one_frame:start vf= (null),index=0


    [35612.618921@3] codec:amvideocap_capture_one_frame: get vf type=3800


    [35612.618933@3] codec:*****************Into VIDTYPE_VIU_422******************


    [35612.618944@3] codec:RGB_phy_addr:67e00000


    [35612.618952@3] codec:RGB_addr:ffffffc067e00000


    [35612.618970@3] codec:y_index=[0xf1] u_index=[0x0] cur_index:f1


    [35612.618982@3] codec:w=3840-height=544 cur_index:f1


    [35612.618992@3] codec:cd.addr:67e00000


    [35612.621962@3] codec:amvideocap_capture_one_frame: capture ok priv->want.fmt=16777728


    [35612.621980@3] codec:amvideocap_capture_one_frame priv->state=300


    [35612.621990@3] codec:amvideocap_capture_one_frame_wait ret=0


    [35612.622004@3] codec:amvideocap_read=0,priv->state=300,priv->vaddr=ffffffc067e00000


    [35612.622015@3] codec:priv->out_width=160 priv->out_height=160


    [35612.622024@3] codec: priv->outfmt_byteppix=3, size=76800


    [35612.659671@3] codec:start amvideocap_read waitdelay=1000


    [35612.659687@3] codec:amvideocap_capture_one_frame:start vf= (null),index=0


    [35612.659694@3] codec:amvideocap_capture_one_frame: get vf type=3800


    [35612.659701@3] codec:*****************Into VIDTYPE_VIU_422******************

    ...

  • I will include the amvideocap from Memphiz in my next build. I'm wondering why I forgot it, perhaps nobody need it before. ;)

    Remember that amvideocap may not work properly for 4K videos.

  • Thanks for your efforts, kszaq! But problem still persist with same symptoms :(

    Display Spoiler

    20:58:09.207 T:3543135136 NOTICE: CVideoPlayerAudio::Process - stream stalled

    20:58:10.189 T:3901387680 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer

    20:59:20.191 T:3543135136 NOTICE: CVideoPlayerAudio::Process - stream stalled

    20:59:20.910 T:3901387680 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer

    21:00:05.496 T:3543135136 NOTICE: CVideoPlayerAudio::Process - stream stalled

    Maybe this bug is related to kernel log spam from amvideocap (check the link in my 1st post).

    Edited once, last by vevs (July 5, 2017 at 7:22 PM).

  • Yup same issue, using Hyperion from LE repo.

    i think it may have to do with the cache size in advancedsettings.xml, particularly readfactor.

    I originally had readfactor set to 5 and buffermode set to 0.

    now its the below.

    <cache>

    <buffermode>0</buffermode>

    <memorysize>139460608</memorysize>

    <readfactor>2</readfactor>

    </cache>

    its taking much longer for the slowdown to occur, before it was 40 minutes now its 1:10.

    EDIT: In the kodi logs i see NOTICE: CVideoPlayerAudio::Process - stream stalled, trying again with buffermode set to 1.

    Edited 3 times, last by JonSnow (July 7, 2017 at 5:23 AM).

  • Please, maybe someone of the developers could try to build kernel with changes, mentioned in my first post? I'm not experianced enough for build a kernel by myself, but i can do heavy testing :) There is no need to rebuild a whole LE on every testing iteration - i need just kernel image, so maybe somebody could spend some time for this? Thanks in advance!

  • Kszaq been running 8.0.2e since release and tried everything but the video still slows down. I read it was related to having both the internal grabber and AML grabber, removing the internal grabber had no effect.

  • Oh, ok, you're right :) So, as i reported, those patches (Memphiz's implemetation) didn't solve the problem. May i ask you also try to remove klog messages from amvideocap, as it done in provided example from my first post? Without those corrections systemd-journal process consumes even more CPU's time than hyperiond itself. And i really hope that this is a reason of playback issues, bacause i don't have any other clue...


    TIA from all ambient lighting lovers :)

  • In case someone of the developers wants to reproduce amvideocap issue by himself: you don't really need any additional hardware for this. Just install Hyperion from LE repo (or via HyperCon), put any config file with "/dev/null" as output (example), and just use device as usual - problem will appear, sooner or later.

  • I have the same on my odroid C2.

    And on my second odroid C2 i installed raybuntu's rb-leia4.3 and no issues so far with hyperion and live tv and other media.