Skip to contentSkip to conversation

Error while decoding second h.264 chunk

coda6 Gaëtan Carlier 1 participant 3 messages Sep 30, 2014 – Oct 3, 2014 2 messages not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Philipp and Fabio,
First of all, thanks a lot for your reply.

Quoted 12 lines · Philipp Zabel

Hi Gaëtan,

Am Mittwoch, den 24.09.2014, 11:18 +0200 schrieb Gaëtan Carlier:

Quoted 8 lines

Hello Dears,
I am back with my Coda6 (i.MX27). I have ported decoding from libvpu code to kernel 3.6 but I have a little problem. DEC_SEQ_INIT runs fine, the internal RdPtr increases by 512 bytes but when I run the DEC_PIC_RUN (PRESCAN disabled), the RdPTr has increased to 1024 (0x400), but macroblock error are reported and next DEC_PIC_RUN does not increase anymore the internal RdPtr.
If I enable PRESCAN, the first DEC_PIC_RUN does not event finish (timeout).

Quoted 3 lines

where is the PC pointer at when it times out? Maybe do a complete register dump before DEC_PIC_RUN and after the timeout to see if something stands out.

I will do that and post reply today (I really don't know what to do with Program Counter of the FW. I hope you do :)).

Quoted 11 lines
Quoted 9 lines

I attach the kernel driver (+fw), the h264 raw file (encoded using this coda6 driver and played without error using ffplay), the userspace test program and the log file.

Can you give me some advise to know where to search. I have tried to reset WrPtr and RdPtr before first DEC_PIC_RUN and reload h264 raw file from the beginning, let RdPtr and WrPtr unchanged and h264 raw file from the beginning but this is even worst...

I don't think you are supposed to write RdPtr.

That is what I think too but I have tried many things before asking help :)

Quoted 3 lines

It is under firmware
control, at least between SEQ_INIT and SEQ_END. There is a DEC_BUF_FLUSH command, maybe that does what you need.

I supposed that DEC_BUF_FLUSH command is needed after DEC_PIC_RUN command in case of last chunk or one frame decoding. As my problem occurs while this first DEC_PIC_RUN, I don't even try to implement this command.

Quoted 3 lines

What happens if you queue a third ~1200 byte frame before calling the first DEC_PIC_RUN?

I already try to increase v4l2buffer from userspace and queue upto 10 h.264 chunk in bitstreambuffer but same behaviour.

Quoted 9 lines
Quoted 7 lines

The firmware is version 2.2.5.

Thanks a lot for your help.
Best regards,
Gaëtan Carlier.

ps: I do not post this on mailing list due to attachments that may not work

You could extract the relevant parts of the log.

I send this reply on mailing list, as people will already see your advise and avoid duplication. Here is the log:

...
coda coda-imx27.0: Initialized CodaDx6. coda coda-imx27.0: Firmware version: 2.2.5 coda coda-imx27.0: codec registered as /dev/video2
...
Chunk 0[6269] : key frame 67 (00000001674218D4)

Chunk 1[1154] :     frame 41 (00000001419AFFBF)
Chunk 2[1293] :     frame 41 (00000001419A8110)
Chunk 3[1256] :     frame 41 (00000001419A7590)
Chunk 4[1887] :     frame 41 (00000001419A0989)
Chunk 5[2609] :     frame 41 (00000001419A6E54)
Chunk 6[2463] :     frame 41 (00000001419A0865)
Chunk 7[2087] :     frame 41 (00000001419AB42D)
Chunk 8[2394] :     frame 41 (00000001419AB52F)
Chunk 9[2210] :     frame 41 (00000001419A2CC2)

coda_fill_decoder_bitstreambuf - c8c7f000 - 6269 bytes added - 6269 bytes bufferd

	WrPtr @ a73c187d - RdPtr @ a73c0000
		00000001674218D4

coda coda-imx27.0: Int occurs : 00000002 (SEQ_INIT) coda coda-imx27.0: CODA_REG_DEC_FUNC_CTRL : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_SRC_SIZE : 000A01E0 coda coda-imx27.0: CODA_RET_DEC_SEQ_SRC_F_RATE : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_FRAME_NEED : 00000003 coda coda-imx27.0: CODA_RET_DEC_SEQ_FRAME_DELAY : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_INFO : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_CROP_LEFT_RIGHT : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_CROP_TOP_BOTTOM : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_NEXT_FRAME_NUM : 00000001 coda coda-imx27.0: CODA_REG_BIT_RUN_INDEX : 00000000 coda coda-imx27.0: CODA_REG_BIT_RD_PTR0 : A73C0200 coda coda-imx27.0: CODA_REG_BIT_WR_PTR0 : A73C187D Framebuffers allocated 10
coda coda-imx27.0: Int occurs : 00000010 (SET_FRAME_BUF) coda_device_run_decoder

coda_fill_decoder_bitstreambuf - c8d80000 - 1154 bytes added - 7423 bytes bufferd

	WrPtr @ a73c1cff - RdPtr @ a73c0200
		00000001419AFFBF

coda coda-imx27.0: Int occurs : 00000008 (PIC_RUN) CODA_RET_DEC_PIC_FRAME_NUM : 00000001 size 460800 CODA_RET_DEC_PIC_IDX : 00000000 CODA_RET_DEC_PIC_ERR_MB_NUM : 00000442 CODA_RET_DEC_PIC_TYPE : 00000000 CODA_RET_DEC_PIC_SUCCESS : 00000001 CODA_RET_DEC_PIC_OPTION : 00000002 CODA_RET_DEC_PIC_CUR_IDX : 00000001 CODA_RET_DEC_PIC_NEXT_IDX : 00000001 coda_device_run_decoder

coda_fill_decoder_bitstreambuf - c8e81000 - 1293 bytes added - 8716 bytes bufferd

	WrPtr @ a73c220c - RdPtr @ a73c0400
		00000001419A8110

Image 1 decoded : 0
Chunk 10[2841] : frame 41 (00000001419A09A2)
Chunk 11 loaded
coda coda-imx27.0: Int occurs : 00000008
CODA_RET_DEC_PIC_FRAME_NUM : 00000002 size 460800
CODA_RET_DEC_PIC_IDX : 00000001
CODA_RET_DEC_PIC_ERR_MB_NUM : 000000EA
CODA_RET_DEC_PIC_TYPE : 00000001
CODA_RET_DEC_PIC_SUCCESS : 00000001
CODA_RET_DEC_PIC_OPTION : 00000002
CODA_RET_DEC_PIC_CUR_IDX : 00000002
CODA_RET_DEC_PIC_NEXT_IDX : 00000001
coda_device_run_decoder
...

A log with PRESCAN enabled and register dump before/after the timeout will be posted later.

Quoted 4 lines

regards
Philipp

Best regards,
Gaëtan.

#3 lore raw

Hi,
The problem can also come from register address or bit offset because depending source used (GStreamer for 2.6.22 or new coda kernel driver 3.6 or datasheet), registers do not have same addresses or do not even exists !

Quoted 17 lines · Gaëtan Carlier

Hi Philipp and Fabio,
First of all, thanks a lot for your reply.

Quoted 13 lines · Philipp Zabel

Hi Gaëtan,

Am Mittwoch, den 24.09.2014, 11:18 +0200 schrieb Gaëtan Carlier:

Quoted 9 lines

Hello Dears,
I am back with my Coda6 (i.MX27). I have ported decoding from libvpu code to kernel 3.6 but I have a little problem. DEC_SEQ_INIT runs fine, the internal RdPtr increases by 512 bytes but when I run the DEC_PIC_RUN (PRESCAN disabled), the RdPTr has increased to 1024 (0x400), but macroblock error are reported and next DEC_PIC_RUN does not increase anymore the internal RdPtr.
If I enable PRESCAN, the first DEC_PIC_RUN does not event finish (timeout).

Quoted 5 lines
Quoted 3 lines

where is the PC pointer at when it times out? Maybe do a complete register dump before DEC_PIC_RUN and after the timeout to see if something stands out.

I will do that and post reply today (I really don't know what to do with Program Counter of the FW. I hope you do :)).

Here is the dump reg when PRESCAN is enable (and leads to timeout):
Chunk 0[6269] : key frame 67 (00000001674218D4)

Chunk 1[1154] :     frame 41 (00000001419AFFBF)
Chunk 2[1293] :     frame 41 (00000001419A8110)
Chunk 3[1256] :     frame 41 (00000001419A7590)
Chunk 4[1887] :     frame 41 (00000001419A0989)
Chunk 5[2609] :     frame 41 (00000001419A6E54)
Chunk 6[2463] :     frame 41 (00000001419A0865)
Chunk 7[2087] :     frame 41 (00000001419AB42D)
Chunk 8[2394] :     frame 41 (00000001419AB52F)
Chunk 9[2210] :     frame 41 (00000001419A2CC2)

coda_fill_decoder_bitstreambuf - c8c7f000 - 6269 bytes added - 6269 bytes bufferd

        WrPtr @ a73c187d - RdPtr @ a73c0000
                00000001674218D4

coda coda-imx27.0: Int occurs : 00000002 CODA_REG_DEC_FUNC_CTRL (0x0114): 00000000 CODA_RET_DEC_SEQ_SRC_SIZE (0x01C4): 000A01E0 CODA_RET_DEC_SEQ_SRC_F_RATE (0x01C8): 00000000 CODA_RET_DEC_SEQ_FRAME_NEED (0x01CC): 00000003 CODA_RET_DEC_SEQ_FRAME_DELAY (0x01D0): 00000000 CODA_RET_DEC_SEQ_INFO (0x01D4): 00000000 CODA_RET_DEC_SEQ_CROP_LEFT_RIGHT (0x01D8): 00000000 CODA_RET_DEC_SEQ_CROP_TOP_BOTTOM (0x01DC): 00000000 CODA_RET_DEC_SEQ_NEXT_FRAME_NUM (0x01E0): 00000001 CODA_REG_BIT_RUN_INDEX (0x0168): 00000000 CODA_REG_BIT_RD_PTR0 (0x0120): A73C0200 CODA_REG_BIT_WR_PTR0 (0x0124): A73C187D Framebuffers allocated 10
coda coda-imx27.0: Int occurs : 00000010 coda_device_run_decoder

coda_fill_decoder_bitstreambuf - c8d80000 - 1154 bytes added - 7423 bytes bufferd

	WrPtr @ a73c1cff - RdPtr @ a73c0200
		00000001419AFFBF

CODA_REG_BIT_INT_STATUS (0x0010): 00000000 CODA_REG_BIT_CUR_PC (0x0018): 00000069 CODA_REG_BIT_CODE_BUF_ADDR (0x0100): A7130000 CODA_REG_BIT_WORK_BUF_ADDR (0x0104): A7200000 CODA_REG_BIT_PARA_BUF_ADDR (0x0108): A7300000 CODA_REG_BIT_STREAM_CTRL (0x010C): 00000006 CODA_REG_BIT_FRAME_MEM_CTRL (0x0110): 00000000 CODA_REG_DEC_FUNC_CTRL (0x0114): 00000000 CODADX6_REG_BIT_SEARCH_RAM_BASE_ADDR (0x0140): FFFF4C00

coda coda-imx27.0: CODA PIC_RUN timeout, stopping all streams

CODA_RET_DEC_PIC_FRAME_NUM (0x01C0): 00000001 size 460800 CODA_RET_DEC_PIC_IDX (0x01C4): 000A01E0 CODA_RET_DEC_PIC_ERR_MB_NUM (0x01C8): 00000000 CODA_RET_DEC_PIC_TYPE (0x01CC): 00000003 CODA_RET_DEC_PIC_SUCCESS (0x01D4): 00000003 CODA_RET_DEC_PIC_OPTION (0x01D0): 00000000 CODA_RET_DEC_PIC_CUR_IDX (0x01DC): FFFFFFFF CODA_RET_DEC_PIC_NEXT_IDX (0x01E0): 00000001

CODA_REG_BIT_INT_STATUS (0x0010): 00000000 CODA_REG_BIT_CUR_PC (0x0018): 00000DC6 CODA_REG_BIT_CODE_BUF_ADDR (0x0100): A7130000 CODA_REG_BIT_WORK_BUF_ADDR (0x0104): A7200000 CODA_REG_BIT_PARA_BUF_ADDR (0x0108): A7300000 CODA_REG_BIT_STREAM_CTRL (0x010C): 00000006 CODA_REG_BIT_FRAME_MEM_CTRL (0x0110): 00000000 CODA_REG_DEC_FUNC_CTRL (0x0114): 00000000 CODADX6_REG_BIT_SEARCH_RAM_BASE_ADDR (0x0140): FFFF4C00

Quoted 111 lines
Quoted 11 lines
Quoted 9 lines

I attach the kernel driver (+fw), the h264 raw file (encoded using this coda6 driver and played without error using ffplay), the userspace test program and the log file.

Can you give me some advise to know where to search. I have tried to reset WrPtr and RdPtr before first DEC_PIC_RUN and reload h264 raw file from the beginning, let RdPtr and WrPtr unchanged and h264 raw file from the beginning but this is even worst...

I don't think you are supposed to write RdPtr.

That is what I think too but I have tried many things before asking help :)

Quoted 3 lines

It is under firmware
control, at least between SEQ_INIT and SEQ_END. There is a DEC_BUF_FLUSH command, maybe that does what you need.

I supposed that DEC_BUF_FLUSH command is needed after DEC_PIC_RUN command in case of last chunk or one frame decoding. As my problem occurs while this first DEC_PIC_RUN, I don't even try to implement this command.

Quoted 3 lines

What happens if you queue a third ~1200 byte frame before calling the first DEC_PIC_RUN?

I already try to increase v4l2buffer from userspace and queue upto 10 h.264 chunk in bitstreambuffer but same behaviour.

Quoted 10 lines
Quoted 8 lines

The firmware is version 2.2.5.

Thanks a lot for your help.
Best regards,
Gaëtan Carlier.

ps: I do not post this on mailing list due to attachments that may not work

You could extract the relevant parts of the log.

I send this reply on mailing list, as people will already see your advise and avoid duplication. Here is the log:

...
coda coda-imx27.0: Initialized CodaDx6. coda coda-imx27.0: Firmware version: 2.2.5 coda coda-imx27.0: codec registered as /dev/video2
...
Chunk 0[6269] : key frame 67 (00000001674218D4)

Chunk 1[1154] :     frame 41 (00000001419AFFBF)
Chunk 2[1293] :     frame 41 (00000001419A8110)
Chunk 3[1256] :     frame 41 (00000001419A7590)
Chunk 4[1887] :     frame 41 (00000001419A0989)
Chunk 5[2609] :     frame 41 (00000001419A6E54)
Chunk 6[2463] :     frame 41 (00000001419A0865)
Chunk 7[2087] :     frame 41 (00000001419AB42D)
Chunk 8[2394] :     frame 41 (00000001419AB52F)
Chunk 9[2210] :     frame 41 (00000001419A2CC2)

coda_fill_decoder_bitstreambuf - c8c7f000 - 6269 bytes added - 6269 bytes bufferd

     WrPtr @ a73c187d - RdPtr @ a73c0000
         00000001674218D4

coda coda-imx27.0: Int occurs : 00000002 (SEQ_INIT) coda coda-imx27.0: CODA_REG_DEC_FUNC_CTRL : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_SRC_SIZE : 000A01E0 coda coda-imx27.0: CODA_RET_DEC_SEQ_SRC_F_RATE : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_FRAME_NEED : 00000003 coda coda-imx27.0: CODA_RET_DEC_SEQ_FRAME_DELAY : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_INFO : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_CROP_LEFT_RIGHT : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_CROP_TOP_BOTTOM : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_NEXT_FRAME_NUM : 00000001 coda coda-imx27.0: CODA_REG_BIT_RUN_INDEX : 00000000 coda coda-imx27.0: CODA_REG_BIT_RD_PTR0 : A73C0200 coda coda-imx27.0: CODA_REG_BIT_WR_PTR0 : A73C187D Framebuffers allocated 10
coda coda-imx27.0: Int occurs : 00000010 (SET_FRAME_BUF) coda_device_run_decoder

coda_fill_decoder_bitstreambuf - c8d80000 - 1154 bytes added - 7423 bytes bufferd

     WrPtr @ a73c1cff - RdPtr @ a73c0200
         00000001419AFFBF

coda coda-imx27.0: Int occurs : 00000008 (PIC_RUN) CODA_RET_DEC_PIC_FRAME_NUM : 00000001 size 460800 CODA_RET_DEC_PIC_IDX : 00000000 CODA_RET_DEC_PIC_ERR_MB_NUM : 00000442 CODA_RET_DEC_PIC_TYPE : 00000000 CODA_RET_DEC_PIC_SUCCESS : 00000001 CODA_RET_DEC_PIC_OPTION : 00000002 CODA_RET_DEC_PIC_CUR_IDX : 00000001 CODA_RET_DEC_PIC_NEXT_IDX : 00000001 coda_device_run_decoder

coda_fill_decoder_bitstreambuf - c8e81000 - 1293 bytes added - 8716 bytes bufferd

     WrPtr @ a73c220c - RdPtr @ a73c0400
         00000001419A8110

Image 1 decoded : 0
Chunk 10[2841] : frame 41 (00000001419A09A2)
Chunk 11 loaded
coda coda-imx27.0: Int occurs : 00000008
CODA_RET_DEC_PIC_FRAME_NUM : 00000002 size 460800
CODA_RET_DEC_PIC_IDX : 00000001
CODA_RET_DEC_PIC_ERR_MB_NUM : 000000EA
CODA_RET_DEC_PIC_TYPE : 00000001
CODA_RET_DEC_PIC_SUCCESS : 00000001
CODA_RET_DEC_PIC_OPTION : 00000002
CODA_RET_DEC_PIC_CUR_IDX : 00000002
CODA_RET_DEC_PIC_NEXT_IDX : 00000001
coda_device_run_decoder
...

A log with PRESCAN enabled and register dump before/after the timeout will be posted later.

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

regards
Philipp

Best regards,
Gaëtan.

Regards,
Gaëtan.

#4 lore raw

Hi,
Do you have time to take a look at this (with the PC values) ?

Quoted 212 lines · Gaëtan Carlier

Hi,
The problem can also come from register address or bit offset because depending source used (GStreamer for 2.6.22 or new coda kernel driver 3.6 or datasheet), registers do not have same addresses or do not even exists !

Quoted 18 lines · Gaëtan Carlier

Hi Philipp and Fabio,
First of all, thanks a lot for your reply.

Quoted 14 lines · Philipp Zabel

Hi Gaëtan,

Am Mittwoch, den 24.09.2014, 11:18 +0200 schrieb Gaëtan Carlier:

Quoted 10 lines

Hello Dears,
I am back with my Coda6 (i.MX27). I have ported decoding from libvpu code to kernel 3.6 but I have a little problem. DEC_SEQ_INIT runs fine, the internal RdPtr increases by 512 bytes but when I run the DEC_PIC_RUN
(PRESCAN disabled), the RdPTr has increased to 1024 (0x400), but macroblock error are reported and next DEC_PIC_RUN does not increase anymore the internal RdPtr.
If I enable PRESCAN, the first DEC_PIC_RUN does not event finish (timeout).

Quoted 5 lines
Quoted 3 lines

where is the PC pointer at when it times out? Maybe do a complete register dump before DEC_PIC_RUN and after the timeout to see if something stands out.

I will do that and post reply today (I really don't know what to do with Program Counter of the FW. I hope you do :)).

Here is the dump reg when PRESCAN is enable (and leads to timeout):
Chunk 0[6269] : key frame 67 (00000001674218D4)

Chunk 1[1154] :     frame 41 (00000001419AFFBF)
Chunk 2[1293] :     frame 41 (00000001419A8110)
Chunk 3[1256] :     frame 41 (00000001419A7590)
Chunk 4[1887] :     frame 41 (00000001419A0989)
Chunk 5[2609] :     frame 41 (00000001419A6E54)
Chunk 6[2463] :     frame 41 (00000001419A0865)
Chunk 7[2087] :     frame 41 (00000001419AB42D)
Chunk 8[2394] :     frame 41 (00000001419AB52F)
Chunk 9[2210] :     frame 41 (00000001419A2CC2)

coda_fill_decoder_bitstreambuf - c8c7f000 - 6269 bytes added - 6269 bytes bufferd

         WrPtr @ a73c187d - RdPtr @ a73c0000
                 00000001674218D4

coda coda-imx27.0: Int occurs : 00000002 CODA_REG_DEC_FUNC_CTRL (0x0114): 00000000 CODA_RET_DEC_SEQ_SRC_SIZE (0x01C4): 000A01E0 CODA_RET_DEC_SEQ_SRC_F_RATE (0x01C8): 00000000 CODA_RET_DEC_SEQ_FRAME_NEED (0x01CC): 00000003 CODA_RET_DEC_SEQ_FRAME_DELAY (0x01D0): 00000000 CODA_RET_DEC_SEQ_INFO (0x01D4): 00000000 CODA_RET_DEC_SEQ_CROP_LEFT_RIGHT (0x01D8): 00000000 CODA_RET_DEC_SEQ_CROP_TOP_BOTTOM (0x01DC): 00000000 CODA_RET_DEC_SEQ_NEXT_FRAME_NUM (0x01E0): 00000001 CODA_REG_BIT_RUN_INDEX (0x0168): 00000000 CODA_REG_BIT_RD_PTR0 (0x0120): A73C0200 CODA_REG_BIT_WR_PTR0 (0x0124): A73C187D Framebuffers allocated 10
coda coda-imx27.0: Int occurs : 00000010 coda_device_run_decoder

coda_fill_decoder_bitstreambuf - c8d80000 - 1154 bytes added - 7423 bytes bufferd

     WrPtr @ a73c1cff - RdPtr @ a73c0200
         00000001419AFFBF

CODA_REG_BIT_INT_STATUS (0x0010): 00000000 CODA_REG_BIT_CUR_PC (0x0018): 00000069 CODA_REG_BIT_CODE_BUF_ADDR (0x0100): A7130000 CODA_REG_BIT_WORK_BUF_ADDR (0x0104): A7200000 CODA_REG_BIT_PARA_BUF_ADDR (0x0108): A7300000 CODA_REG_BIT_STREAM_CTRL (0x010C): 00000006 CODA_REG_BIT_FRAME_MEM_CTRL (0x0110): 00000000 CODA_REG_DEC_FUNC_CTRL (0x0114): 00000000 CODADX6_REG_BIT_SEARCH_RAM_BASE_ADDR (0x0140): FFFF4C00

coda coda-imx27.0: CODA PIC_RUN timeout, stopping all streams

CODA_RET_DEC_PIC_FRAME_NUM (0x01C0): 00000001 size 460800 CODA_RET_DEC_PIC_IDX (0x01C4): 000A01E0 CODA_RET_DEC_PIC_ERR_MB_NUM (0x01C8): 00000000 CODA_RET_DEC_PIC_TYPE (0x01CC): 00000003 CODA_RET_DEC_PIC_SUCCESS (0x01D4): 00000003 CODA_RET_DEC_PIC_OPTION (0x01D0): 00000000 CODA_RET_DEC_PIC_CUR_IDX (0x01DC): FFFFFFFF CODA_RET_DEC_PIC_NEXT_IDX (0x01E0): 00000001

CODA_REG_BIT_INT_STATUS (0x0010): 00000000 CODA_REG_BIT_CUR_PC (0x0018): 00000DC6 CODA_REG_BIT_CODE_BUF_ADDR (0x0100): A7130000 CODA_REG_BIT_WORK_BUF_ADDR (0x0104): A7200000 CODA_REG_BIT_PARA_BUF_ADDR (0x0108): A7300000 CODA_REG_BIT_STREAM_CTRL (0x010C): 00000006 CODA_REG_BIT_FRAME_MEM_CTRL (0x0110): 00000000 CODA_REG_DEC_FUNC_CTRL (0x0114): 00000000 CODADX6_REG_BIT_SEARCH_RAM_BASE_ADDR (0x0140): FFFF4C00

Quoted 113 lines
Quoted 5 lines
Quoted 5 lines

I attach the kernel driver (+fw), the h264 raw file (encoded using this coda6 driver and played without error using ffplay), the userspace test program and the log file.

Quoted 7 lines
Quoted 5 lines

Can you give me some advise to know where to search. I have tried to reset WrPtr and RdPtr before first DEC_PIC_RUN and reload h264 raw file from the beginning, let RdPtr and WrPtr unchanged and h264 raw file from
the beginning but this is even worst...

I don't think you are supposed to write RdPtr.

That is what I think too but I have tried many things before asking help :)

Quoted 3 lines

It is under firmware
control, at least between SEQ_INIT and SEQ_END. There is a DEC_BUF_FLUSH command, maybe that does what you need.

I supposed that DEC_BUF_FLUSH command is needed after DEC_PIC_RUN command in case of last chunk or one frame decoding. As my problem occurs while this first DEC_PIC_RUN, I don't even try to implement this command.

Quoted 3 lines

What happens if you queue a third ~1200 byte frame before calling the first DEC_PIC_RUN?

I already try to increase v4l2buffer from userspace and queue upto 10 h.264 chunk in bitstreambuffer but same behaviour.

Quoted 10 lines
Quoted 8 lines

The firmware is version 2.2.5.

Thanks a lot for your help.
Best regards,
Gaëtan Carlier.

ps: I do not post this on mailing list due to attachments that may not work

You could extract the relevant parts of the log.

I send this reply on mailing list, as people will already see your advise and avoid duplication. Here is the log:

...
coda coda-imx27.0: Initialized CodaDx6. coda coda-imx27.0: Firmware version: 2.2.5 coda coda-imx27.0: codec registered as /dev/video2
...
Chunk 0[6269] : key frame 67 (00000001674218D4)

Chunk 1[1154] :     frame 41 (00000001419AFFBF)
Chunk 2[1293] :     frame 41 (00000001419A8110)
Chunk 3[1256] :     frame 41 (00000001419A7590)
Chunk 4[1887] :     frame 41 (00000001419A0989)
Chunk 5[2609] :     frame 41 (00000001419A6E54)
Chunk 6[2463] :     frame 41 (00000001419A0865)
Chunk 7[2087] :     frame 41 (00000001419AB42D)
Chunk 8[2394] :     frame 41 (00000001419AB52F)
Chunk 9[2210] :     frame 41 (00000001419A2CC2)

coda_fill_decoder_bitstreambuf - c8c7f000 - 6269 bytes added - 6269 bytes bufferd

     WrPtr @ a73c187d - RdPtr @ a73c0000
         00000001674218D4

coda coda-imx27.0: Int occurs : 00000002 (SEQ_INIT) coda coda-imx27.0: CODA_REG_DEC_FUNC_CTRL : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_SRC_SIZE : 000A01E0 coda coda-imx27.0: CODA_RET_DEC_SEQ_SRC_F_RATE : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_FRAME_NEED : 00000003 coda coda-imx27.0: CODA_RET_DEC_SEQ_FRAME_DELAY : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_INFO : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_CROP_LEFT_RIGHT : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_CROP_TOP_BOTTOM : 00000000 coda coda-imx27.0: CODA_RET_DEC_SEQ_NEXT_FRAME_NUM : 00000001 coda coda-imx27.0: CODA_REG_BIT_RUN_INDEX : 00000000 coda coda-imx27.0: CODA_REG_BIT_RD_PTR0 : A73C0200 coda coda-imx27.0: CODA_REG_BIT_WR_PTR0 : A73C187D Framebuffers allocated 10
coda coda-imx27.0: Int occurs : 00000010 (SET_FRAME_BUF) coda_device_run_decoder

coda_fill_decoder_bitstreambuf - c8d80000 - 1154 bytes added - 7423 bytes bufferd

     WrPtr @ a73c1cff - RdPtr @ a73c0200
         00000001419AFFBF

coda coda-imx27.0: Int occurs : 00000008 (PIC_RUN) CODA_RET_DEC_PIC_FRAME_NUM : 00000001 size 460800 CODA_RET_DEC_PIC_IDX : 00000000 CODA_RET_DEC_PIC_ERR_MB_NUM : 00000442 CODA_RET_DEC_PIC_TYPE : 00000000 CODA_RET_DEC_PIC_SUCCESS : 00000001 CODA_RET_DEC_PIC_OPTION : 00000002 CODA_RET_DEC_PIC_CUR_IDX : 00000001 CODA_RET_DEC_PIC_NEXT_IDX : 00000001 coda_device_run_decoder

coda_fill_decoder_bitstreambuf - c8e81000 - 1293 bytes added - 8716 bytes bufferd

     WrPtr @ a73c220c - RdPtr @ a73c0400
         00000001419A8110

Image 1 decoded : 0
Chunk 10[2841] : frame 41 (00000001419A09A2)
Chunk 11 loaded
coda coda-imx27.0: Int occurs : 00000008
CODA_RET_DEC_PIC_FRAME_NUM : 00000002 size 460800
CODA_RET_DEC_PIC_IDX : 00000001
CODA_RET_DEC_PIC_ERR_MB_NUM : 000000EA
CODA_RET_DEC_PIC_TYPE : 00000001
CODA_RET_DEC_PIC_SUCCESS : 00000001
CODA_RET_DEC_PIC_OPTION : 00000002
CODA_RET_DEC_PIC_CUR_IDX : 00000002
CODA_RET_DEC_PIC_NEXT_IDX : 00000001
coda_device_run_decoder
...

A log with PRESCAN enabled and register dump before/after the timeout will be posted later.

Quoted 1 line
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

regards
Philipp

Best regards,
Gaëtan.

Regards,
Gaëtan.

Thanks
Regards,
Gaëtan.