This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCSDK demo fails second time it is executed on DSPC-8682

Hi,

I just started experimenting with a DSPC-8682 card in Linux (Ubuntu 14.04 LTS, 64 bit). I can successfully run some of the demos included within the MCSDK Video (version 02_02_00_45), but I can only do this once. When I try to run it the second time the demo hangs. Also, for some reason, resetting the DSP's always fails.

I use the following scripts to run the demo:

- After host boot up, I set the environment and run "driver_init" and "./init_dsps.sh 1250" from the Linux Desktop SDK (version 01_00_03_00)

- In the pcie_h265enc_demo/scripts directory of MCSDK Video, I do:

    • source setDemoEnv.sh
    • ./dnld_dsp.sh 8
    • ./demoSave2File.sh

These steps are successful. I have verified the output *.265 file with a third party HEVC decoder and everything looks ok.

However, I am not able to run the demo a second time. The encoder either hangs or the output displays messages including "Mailbox messages found in newly opened TX mailbox". When I try to reset the DSP's (using "reset_dsp.sh"), I get "ERROR: Reset code is not working". After trying to reset the DSP's, the host usually freezes, up to the point where I have to do a hard reset.

Any ideas on how to get this resolved?

Best regards,

Jürgen

  • Hi Jürgen, please share with us the complete log and all the scripts and configuration files used. For saving the logs please use --debug-log=HEVC.log --error-log=HEVC.err inside demoSave2File.sh

    Ex:

    MCSDK_VIDEO_HOSTBIN_DIR/demo_c667x --dsp-image=$MCSDK_VIDEO_DSPIMAGE_DIR/sv04.out -v --debug-log=HEVC.log --error-log=HEVC.err --channel="H265 Encode" -a HEVCENC -f $CLIP_CONFIG -c $CODEC_PARAMS -t "0 1 2 3 4 5 6 7" --width=1280 --height=720

    thank you,

    Paula

  • Hi, a quick question did you reset the DSPs before downloading image the second time? below example for a quad-shannon and using CPU clock 1250MHz

    ./reset_dsp.sh 1250

    ./dnld_dsp.sh 4

    ./demoSave2File.sh

    thank you,

    Paula

  • Hi Paula,

    As indicated above, resetting the DSP's always fails for some reason. Here is the output when first executing the pcie_h265enc_demo successfully (as described above) and subsequently executing "./reset_dsp.sh 1250":

    Num of devices 8
    " ERROR: Reset code is not working : Timedout
    Dsp 0: DSP Reset Fail !
    " ERROR: Reset code is not working : Timedout
    Dsp 1: DSP Reset Fail !
    " ERROR: Reset code is not working : Timedout
    Dsp 2: DSP Reset Fail !
    " ERROR: Reset code is not working : Timedout
    Dsp 3: DSP Reset Fail !
    " ERROR: Reset code is not working : Timedout
    Dsp 4: DSP Reset Fail !
    " ERROR: Reset code is not working : Timedout
    Dsp 5: DSP Reset Fail !
    Segmentation fault (core dumped)
    Segmentation fault (core dumped)
    Number of devices: 4
    Device: 0 : dspc8682

    boot config file initcfg_1250.txt
    DSP boot config addr 0x86ff00
    DSP boot config size in bytes 8
    Boot config words: 0xbabeface,
    Boot config words: 0x19,
    Overriding image entry point with input 860000 Download image success !
    Device: 1 : dspc8682

    boot config file initcfg_1250.txt
    DSP boot config addr 0x86ff00
    DSP boot config size in bytes 8
    Boot config words: 0xbabeface,
    Boot config words: 0x19,
    Overriding image entry point with input 860000 Download image success !
    Device: 2 : dspc8682

    boot config file initcfg_1250.txt
    DSP boot config addr 0x86ff00
    DSP boot config size in bytes 8
    Boot config words: 0xbabeface,
    Boot config words: 0x19,
    Overriding image entry point with input 860000 Download image success !
    Device: 3 : dspc8682

    boot config file initcfg_1250.txt
    DSP boot config addr 0x86ff00
    DSP boot config size in bytes 8
    Boot config words: 0xbabeface,
    Boot config words: 0x19,
    Overriding image entry point with input 860000 Download image success !


    At this point, "lspci -v | grep Texas" prints:

    05:00.0 Multimedia controller: Texas Instruments Device b005 (rev 01)
    06:00.0 Multimedia controller: Texas Instruments Device b005 (rev ff) (prog-if ff)
    07:00.0 Multimedia controller: Texas Instruments Device b005 (rev ff) (prog-if ff)
    08:00.0 Multimedia controller: Texas Instruments Device b005 (rev ff) (prog-if ff)
    09:00.0 Multimedia controller: Texas Instruments Device b005 (rev ff) (prog-if ff)
    0a:00.0 Multimedia controller: Texas Instruments Device b005 (rev 01)
    0b:00.0 Multimedia controller: Texas Instruments Device b005 (rev ff) (prog-if ff)
    0c:00.0 Multimedia controller: Texas Instruments Device b005 (rev 01)

    Best regards,
    Jurgen
  • Hi Jurgen, it seems to me a phisycal issue with your setup (board and/or PC).  A quick question have you tried desktop linux SDK loopback demos? if not could you please give a try and let me know if you can reset the boards using those scripts?

    http://processors.wiki.ti.com/index.php/Desktop-linux-sdk_01.00.00_Getting_Started_Guide#Running_the_Demonstration_Applications 

    For this test please don't forget to allocate contigous memory (http://processors.wiki.ti.com/index.php/Desktop-linux-sdk_01.00.00_Getting_Started_Guide#Using_larger_and_pre-reserved_contiguous_memory_allocation:_Optional). FYI, For 4K HEVC transcoder demos I am currently using 4GB but depending on your use case and setup resources you can use a much smaller size, fo example 520MB

    ./install_grub.sh 4096 8

    thank you,

    Paula

     

  • Hi Paula,

    I was already using contiguous memory (848MB) but I changed it now to 4GB just to be sure (through "./install_grub.sh 4096 8"). After rebooting the host, setting up the environment variables and initializing the card, I ran the loopback demos as you suggested (desktop-linux-sdk_01_00_03) using a test file of about 750MB:

    ./dnld_demo_loopback 8

    ./run_dmatest.sh 8 0x400000
    ./run_memcpytest.sh 8 0x400000
    ./run_dspmaptest.sh 8 0x400000

    The first two tests (dmatest and memcpytest) terminate without errors. The last test fails, however, with the following output:

    dspBits = FFFFFFFF
    dspBits = FFFFFFFF
    Driver opened!

    Contiguous memory allocation complete : Num Buffers 64
    Creating Mailbox (80000000 --> 0)
    Created Mailbox Tx id: 0x 0 Handle 0x2f7af30
    Creating Mailbox (0 --> 80000000)
    Created Mailbox Rx id: 0x 0, Handle 0x2f7af60
    Creating Mailbox (80000000 --> 1)
    Created Mailbox Tx id: 0x 1 Handle 0x2f7af90
    Creating Mailbox (1 --> 80000000)
    Created Mailbox Rx id: 0x 1, Handle 0x2f7afc0
    Creating Mailbox (80000000 --> 2)
    Created Mailbox Tx id: 0x 2 Handle 0x2f7aff0
    Creating Mailbox (2 --> 80000000)
    Created Mailbox Rx id: 0x 2, Handle 0x2f7b020
    Creating Mailbox (80000000 --> 3)
    Created Mailbox Tx id: 0x 3 Handle 0x2f7b050
    Creating Mailbox (3 --> 80000000)
    Created Mailbox Rx id: 0x 3, Handle 0x2f7b080
    Creating Mailbox (80000000 --> 4)

    ...

    Creating Mailbox (3d --> 80000000)
    Created Mailbox Rx id: 0x 3d, Handle 0x2f80bf0
    Creating Mailbox (80000000 --> 3e)
    Created Mailbox Tx id: 0x 3e Handle 0x2f80c20
    Creating Mailbox (3e --> 80000000)
    Created Mailbox Rx id: 0x 3e, Handle 0x2f80c50
    Creating Mailbox (80000000 --> 3f)
    Created Mailbox Tx id: 0x 3f Handle 0x2f80c80
    Creating Mailbox (3f --> 80000000)
    Created Mailbox Rx id: 0x 3f, Handle 0x2f80cb0
    nodeBits 1 decision1
    Opening Mailbox(80000000 --> 0)
    Opening Mailbox(0 --> 80000000)
    nodeBits 2 decision2
    Opening Mailbox(80000000 --> 1)
    Opening Mailbox(1 --> 80000000)
    nodeBits 4 decision4
    Opening Mailbox(80000000 --> 2)
    Opening Mailbox(2 --> 80000000)
    nodeBits 8 decision8
    Opening Mailbox(80000000 --> 3)
    Opening Mailbox(3 --> 80000000)

    ...

    Opening Mailbox(3c --> 80000000)
    nodeBits 20000000 decision20000000
    Opening Mailbox(80000000 --> 3d)
    Opening Mailbox(3d --> 80000000)
    nodeBits 40000000 decision40000000
    Opening Mailbox(80000000 --> 3e)
    Opening Mailbox(3e --> 80000000)
    nodeBits 80000000 decision80000000
    Opening Mailbox(80000000 --> 3f)
    Opening Mailbox(3f --> 80000000)
    Mailboxed Created!
    Configuration Complete!
    Starting Test...
    Priming done.
    bufmgrAlloc(0) = 0x7f23081ca000
    bufmgrAlloc(0) = 0x7f2307dca000

    Msg (C0DE0000) to --> 0 : input_addr = 0x60000000, input_size = 4194304, output_addr = 0x60400000, output_size = 32547

    bufmgrAlloc(1) = 0x7f23079ca000
    bufmgrAlloc(1) = 0x7f23075ca000

    Msg (C0DE0001) to --> 1 : input_addr = 0x60800000, input_size = 4194304, output_addr = 0x60C00000, output_size = 32547

    bufmgrAlloc(2) = 0x7f23071ca000
    bufmgrAlloc(2) = 0x7f2306dca000

    Msg (C0DE0002) to --> 2 : input_addr = 0x61000000, input_size = 4194304, output_addr = 0x61400000, output_size = 32547

    bufmgrAlloc(3) = 0x7f23069ca000
    bufmgrAlloc(3) = 0x7f23065ca000

    Msg (C0DE0003) to --> 3 : input_addr = 0x61800000, input_size = 4194304, output_addr = 0x61C00000, output_size = 32547

    bufmgrAlloc(4) = 0x7f23061ca000
    bufmgrAlloc(4) = 0x7f2305dca000

    Msg (C0DE0004) to --> 4 : input_addr = 0x62000000, input_size = 4194304, output_addr = 0x62400000, output_size = 32547

    bufmgrAlloc(5) = 0x7f23059ca000
    bufmgrAlloc(5) = 0x7f23055ca000

    Msg (C0DE0005) to --> 5 : input_addr = 0x62800000, input_size = 4194304, output_addr = 0x62C00000, output_size = 32547

    bufmgrAlloc(6) = 0x7f23051ca000
    bufmgrAlloc(6) = 0x7f2304dca000

    Msg (C0DE0006) to --> 6 : input_addr = 0x63000000, input_size = 4194304, output_addr = 0x63400000, output_size = 32547

    bufmgrAlloc(7) = 0x7f23049ca000
    bufmgrAlloc(7) = 0x7f23045ca000

    Msg (C0DE0007) to --> 7 : input_addr = 0x63800000, input_size = 4194304, output_addr = 0x63C00000, output_size = 32547

    bufmgrAlloc(8) = 0x7f23041ca000
    bufmgrAlloc(8) = 0x7f2303dca000

    Msg (C0DE0008) to --> 8 : input_addr = 0x60000000, input_size = 4194304, output_addr = 0x60400000, output_size = 32547

    bufmgrAlloc(9) = 0x7f23039ca000
    bufmgrAlloc(9) = 0x7f23035ca000

    Msg (C0DE0009) to --> 9 : input_addr = 0x60800000, input_size = 4194304, output_addr = 0x60C00000, output_size = 32547

    bufmgrAlloc(10) = 0x7f23031ca000
    bufmgrAlloc(10) = 0x7f2302dca000

    Msg (C0DE000A) to --> 10 : input_addr = 0x61000000, input_size = 4194304, output_addr = 0x61400000, output_size = 32547

    bufmgrAlloc(11) = 0x7f23029ca000
    bufmgrAlloc(11) = 0x7f23025ca000

    Msg (C0DE000B) to --> 11 : input_addr = 0x61800000, input_size = 4194304, output_addr = 0x61C00000, output_size = 32547

    bufmgrAlloc(12) = 0x7f23021ca000
    bufmgrAlloc(12) = 0x7f2301dca000

    Msg (C0DE000C) to --> 12 : input_addr = 0x62000000, input_size = 4194304, output_addr = 0x62400000, output_size = 32547

    bufmgrAlloc(13) = 0x7f23019ca000
    bufmgrAlloc(13) = 0x7f23015ca000

    Msg (C0DE000D) to --> 13 : input_addr = 0x62800000, input_size = 4194304, output_addr = 0x62C00000, output_size = 32547

    bufmgrAlloc(14) = 0x7f23011ca000
    bufmgrAlloc(14) = 0x7f2300dca000

    Msg (C0DE000E) to --> 14 : input_addr = 0x63000000, input_size = 4194304, output_addr = 0x63400000, output_size = 32547

    bufmgrAlloc(15) = 0x7f23009ca000
    bufmgrAlloc(15) = 0x7f23005ca000

    Msg (C0DE000F) to --> 15 : input_addr = 0x63800000, input_size = 4194304, output_addr = 0x63C00000, output_size = 32547

    bufmgrAlloc(16) = 0x7f23001ca000
    bufmgrAlloc(16) = 0x7f22ffdca000

    Msg (C0DE0010) to --> 16 : input_addr = 0x60000000, input_size = 4194304, output_addr = 0x60400000, output_size = 32547

    bufmgrAlloc(17) = 0x7f22ff9ca000
    bufmgrAlloc(17) = 0x7f22ff5ca000

    Msg (C0DE0011) to --> 17 : input_addr = 0x60800000, input_size = 4194304, output_addr = 0x60C00000, output_size = 32547

    bufmgrAlloc(18) = 0x7f22ff1ca000
    bufmgrAlloc(18) = 0x7f22fedca000

    Msg (C0DE0012) to --> 18 : input_addr = 0x61000000, input_size = 4194304, output_addr = 0x61400000, output_size = 32547

    bufmgrAlloc(19) = 0x7f22fe9ca000
    bufmgrAlloc(19) = 0x7f22fe5ca000

    Msg (C0DE0013) to --> 19 : input_addr = 0x61800000, input_size = 4194304, output_addr = 0x61C00000, output_size = 32547

    bufmgrAlloc(20) = 0x7f22fe1ca000
    bufmgrAlloc(20) = 0x7f22fddca000

    Msg (C0DE0014) to --> 20 : input_addr = 0x62000000, input_size = 4194304, output_addr = 0x62400000, output_size = 32547

    bufmgrAlloc(21) = 0x7f22fd9ca000
    bufmgrAlloc(21) = 0x7f22fd5ca000

    Msg (C0DE0015) to --> 21 : input_addr = 0x62800000, input_size = 4194304, output_addr = 0x62C00000, output_size = 32547

    bufmgrAlloc(22) = 0x7f22fd1ca000
    bufmgrAlloc(22) = 0x7f22fcdca000

    Msg (C0DE0016) to --> 22 : input_addr = 0x63000000, input_size = 4194304, output_addr = 0x63400000, output_size = 32547

    bufmgrAlloc(23) = 0x7f22fc9ca000
    bufmgrAlloc(23) = 0x7f22fc5ca000

    Msg (C0DE0017) to --> 23 : input_addr = 0x63800000, input_size = 4194304, output_addr = 0x63C00000, output_size = 32547

    bufmgrAlloc(24) = 0x7f22fc1ca000
    bufmgrAlloc(24) = 0x7f22fbdca000

    Msg (C0DE0018) to --> 24 : input_addr = 0x60000000, input_size = 4194304, output_addr = 0x60400000, output_size = 32547

    bufmgrAlloc(25) = 0x7f22fb9ca000
    bufmgrAlloc(25) = 0x7f22fb5ca000

    Msg (C0DE0019) to --> 25 : input_addr = 0x60800000, input_size = 4194304, output_addr = 0x60C00000, output_size = 32547

    bufmgrAlloc(26) = 0x7f22fb1ca000
    bufmgrAlloc(26) = 0x7f22fadca000

    Msg (C0DE001A) to --> 26 : input_addr = 0x61000000, input_size = 4194304, output_addr = 0x61400000, output_size = 32547

    bufmgrAlloc(27) = 0x7f22fa9ca000
    bufmgrAlloc(27) = 0x7f22fa5ca000

    Msg (C0DE001B) to --> 27 : input_addr = 0x61800000, input_size = 4194304, output_addr = 0x61C00000, output_size = 32547

    bufmgrAlloc(28) = 0x7f22fa1ca000
    bufmgrAlloc(28) = 0x7f22f9dca000

    Msg (C0DE001C) to --> 28 : input_addr = 0x62000000, input_size = 4194304, output_addr = 0x62400000, output_size = 32547

    bufmgrAlloc(29) = 0x7f22f99ca000
    bufmgrAlloc(29) = 0x7f22f95ca000

    Msg (C0DE001D) to --> 29 : input_addr = 0x62800000, input_size = 4194304, output_addr = 0x62C00000, output_size = 32547

    bufmgrAlloc(30) = 0x7f22f91ca000
    bufmgrAlloc(30) = 0x7f22f8dca000

    Msg (C0DE001E) to --> 30 : input_addr = 0x63000000, input_size = 4194304, output_addr = 0x63400000, output_size = 32547

    bufmgrAlloc(31) = 0x7f22f89ca000
    bufmgrAlloc(31) = 0x7f22f85ca000

    Msg (C0DE001F) to --> 31 : input_addr = 0x63800000, input_size = 4194304, output_addr = 0x63C00000, output_size = 32547

    ERROR: bufmgrAlloc() did not find free input buffer.

  • Hi Jurgen, no sure why dspmaptest loopback is failing, however, the main idea to propuse you to try desktop linux SDK loopback demos was to see if you can reset DSPs several times without any issues.

    Could you please try dmatest or memcpytest loopback several times and let me know if you face any issues reseting any of the DSPs?

    From MSCDK video framework, I think you did it, but just to confirm, I was wondering if you built SDK host modules before running HEVC encoder PCIe demo?

    http://processors.wiki.ti.com/index.php/MCSDK_VIDEO_2.x_Getting_Started_PCIe_Demo_Guide#Build_MCSDK_Video_Host_Application_to_Execute_on_Linux_PC

    http://processors.wiki.ti.com/index.php/MCSDK_VIDEO_2.x_Getting_Started_PCIe_Demo_Guide#Building_Desktop_Linux_SDK_Host_Modules

    No completely sure if it is a hardware/thermal issue, but please also take a look to ensure board's power supply connection is OK and fans are working properly.

    thank you,

    Paula

     

     

     

  • Hi Paula,

    None of the scripts for resetting the DSP's works for me. "dspallreset.sh" from Desktop Linux SDK fails in all cases, and trying to reset only one or some of the DSP's through "dspreset.sh" also fails in all cases. The only way I am able to run a demo (either loopback demo or from the MCSDK Video) is to reboot the host, and follow the different steps without resetting the DSP's at all.

    I had already built the SDK host modules. (I assume that I would not have been able to run the HEVC encoding demo at least once if I did not build the modules)

    The card's power supply should be ok (blue led is on, but not blinking), and the fans are working properly.

    Best regards,

    Jürgen

  • Hi Jurgen,

    From Advantech drivers you can also can get/test dspreset and scripts

    You can get the drivers from: 

    I will try to find out if Advantech has some diagnostic code for Quad/Octal shannon boards. If you have another board and/or PCIe slot to try it would be great in order to start ruling out HW issues.

    thank you,

    Paula

  • Hi Paula,

    Using the drivers from Advantech solved my problem. I can now reset all DSP's successfully and run the MCSDK Video demo's multiple times without rebooting the host.

    Thank you very much for your help.

    Best regards,
    Jurgen
  • Jurgen, a quick question are you using Ubuntu 32bit or 64bit?. thank you,Paula
  • Hi Paula,

    I'm using Ubuntu 14.04 LTS, 64-bit (kernel version 3.19.0-031900-generic).

    Best regards,

    Jürgen

  • Jurgen, another question are you using an octal card or 2 quad shannons?
    thank you,Paula
  • Hi Paula, I am using an octal card.

    Jurgen