

spresenseの録音サンプルプログラム  
「Audio>application>recorder_wav」ファイルにて、  
10秒間録音をループさせ、連続して録音するプログラムに修正してみたのですが、  
15回ほど録音したところで、audio libraryの初期化が出来ずエラーが発生しました。  
エラーの原因・対策についてご教授いただければ幸いです。

【追記】  
また、エラーが発生しない場合でも、3時間ほどでプログラムがフリーズしてしまいます。その理由などについても心当たりがあればご教授いただけないでしょうか？

[code]

    initialization Audio Library
    up_assert: Assertion failed at file:dma_controller/audio_dma_drv.cpp line: 975 task: capture0
    up_registerdump: R0: 00000001 0d06ed1c 000000e0 0d06f5b4 0d06ed1c 0d093b70 0d06f56c 00000000
    up_registerdump: R8: 0d04ea24 000003cf 0d08b720 00000000 00000000 0d093b70 0d0398f1 0d039fbc
    up_registerdump: xPSR: 61000000 BASEPRI: 000000e0 CONTROL: 00000004
    up_registerdump: EXC_RETURN: ffffffe9
    up_dumpstate: sp:     0d093b70
    up_dumpstate: IRQ stack:
    up_dumpstate:   base: 0d06a988
    up_dumpstate:   size: 00000800
    up_dumpstate:   used: 000000f8
    up_dumpstate: User stack:
    up_dumpstate:   base: 0d093c58
    up_dumpstate:   size: 00000800
    up_dumpstate:   used: 00000284
    up_stackdump: 0d093b60: 0d093b70 0d06f56c 0d093c58 0d039a2b 000000e0 00000004 00000000 00000000
    up_stackdump: 0d093b80: 0d093b70 0d0398f1 0d039fbc 0d02fbcf 0d070180 0d0bbc70 00000000 00000000
    up_stackdump: 0d093ba0: 00000000 00000000 00000000 00000000 00000000 0d01f4bd 00000001 0d0075cd
    up_stackdump: 0d093bc0: 0d0bbc70 0d007209 0d0674a0 00000001 0d0914c0 0d00724f 0d0914c0 0d006c75
    up_stackdump: 0d093be0: 0d08ea20 0d02fbc3 000fd400 0100604d 00000000 000fe7d8 0d093c00 0d00653b
    up_stackdump: 0d093c00: 00000000 000d0000 0d04f2dc 0d067720 0d079d44 0d0914c0 0d08ea20 0d079d30
    up_stackdump: 0d093c20: 0d079d44 0d006fd7 000fd400 000fe7d8 0d08b720 0d007025 0d007003 0d02f003
    up_stackdump: 0d093c40: 00000000 00000000 00000000 00000000 00000000 00000000 00028010 80000820
    up_taskdump: Idle Task: PID=0 Stack Used=468 of 1024
    up_taskdump: hpwork: PID=1 Stack Used=596 of 2008
    up_taskdump: lpwork: PID=2 Stack Used=332 of 2008
    up_taskdump: lpwork: PID=3 Stack Used=332 of 2008
    up_taskdump: lpwork: PID=4 Stack Used=332 of 2008
    up_taskdump: cxd56_pm_task: PID=6 Stack Used=400 of 976
    up_taskdump: gnss_receiver: PID=7 Stack Used=284 of 976
    up_taskdump: init: PID=8 Stack Used=3076 of 8152
    up_taskdump: alt1250: PID=9 Stack Used=852 of 1992
    up_taskdump: lteevt_task: PID=10 Stack Used=628 of 2000
    up_taskdump: altcom_recvthread: PID=11 Stack Used=588 of 2048
    up_taskdump: audio_manager: PID=620 Stack Used=716 of 2048
    up_taskdump: media_player0: PID=621 Stack Used=348 of 3072
    up_taskdump: media_player1: PID=622 Stack Used=348 of 3072
    up_taskdump: out_mixer: PID=623 Stack Used=340 of 3072
    up_taskdump: renderer0: PID=624 Stack Used=340 of 2048
    up_taskdump: renderer1: PID=625 Stack Used=340 of 2048
    up_taskdump: front_end: PID=626 Stack Used=500 of 2048
    up_taskdump: media_recorder: PID=627 Stack Used=332 of 2048
    up_taskdump: capture0: PID=628 Stack Used=700 of 2048
    
    initialization Audio Library
    up_assert: Assertion failed at file:dma_controller/audio_dma_drv.cpp line: 975 task: capture0
    up_registerdump: R0: 00000001 0d06ed1c 000000e0 0d06f5b4 0d06ed1c 0d093b70 0d06f56c 00000000
    up_registerdump: R8: 0d04ea24 000003cf 0d08b720 00000000 00000000 0d093b70 0d0398f1 0d039fbc
    up_registerdump: xPSR: 61000000 BASEPRI: 000000e0 CONTROL: 00000004
    up_registerdump: EXC_RETURN: ffffffe9
    up_dumpstate: sp:     0d093b70
    up_dumpstate: IRQ stack:
    up_dumpstate:   base: 0d06a988
    up_dumpstate:   size: 00000800
    up_dumpstate:   used: 000000f8
    up_dumpstate: User stack:
    up_dumpstate:   base: 0d093c58
    up_dumpstate:   size: 00000800
    up_dumpstate:   used: 00000284
    up_stackdump: 0d093b60: 0d093b70 0d06f56c 0d093c58 0d039a2b 000000e0 00000004 00000000 00000000
    up_stackdump: 0d093b80: 0d093b70 0d0398f1 0d039fbc 0d02fbcf 0d070180 0d0bbc70 00000000 00000000
    up_stackdump: 0d093ba0: 00000000 00000000 00000000 00000000 00000000 0d01f4bd 00000001 0d0075cd
    up_stackdump: 0d093bc0: 0d0bbc70 0d007209 0d0674a0 00000001 0d0914c0 0d00724f 0d0914c0 0d006c75
    up_stackdump: 0d093be0: 0d08ea20 0d02fbc3 000fd400 0100604d 00000000 000fe7d8 0d093c00 0d00653b
    up_stackdump: 0d093c00: 00000000 000d0000 0d04f2dc 0d067720 0d079d44 0d0914c0 0d08ea20 0d079d30
    up_stackdump: 0d093c20: 0d079d44 0d006fd7 000fd400 000fe7d8 0d08b720 0d007025 0d007003 0d02f003
    up_stackdump: 0d093c40: 00000000 00000000 00000000 00000000 00000000 00000000 00028010 80000820
    up_taskdump: Idle Task: PID=0 Stack Used=468 of 1024
    up_taskdump: hpwork: PID=1 Stack Used=596 of 2008
    up_taskdump: lpwork: PID=2 Stack Used=332 of 2008
    up_taskdump: lpwork: PID=3 Stack Used=332 of 2008
    up_taskdump: lpwork: PID=4 Stack Used=332 of 2008
    up_taskdump: cxd56_pm_task: PID=6 Stack Used=400 of 976
    up_taskdump: gnss_receiver: PID=7 Stack Used=284 of 976
    up_taskdump: init: PID=8 Stack Used=3076 of 8152
    up_taskdump: alt1250: PID=9 Stack Used=852 of 1992
    up_taskdump: lteevt_task: PID=10 Stack Used=628 of 2000
    up_taskdump: altcom_recvthread: PID=11 Stack Used=588 of 2048
    up_taskdump: audio_manager: PID=620 Stack Used=716 of 2048
    up_taskdump: media_player0: PID=621 Stack Used=348 of 3072
    up_taskdump: media_player1: PID=622 Stack Used=348 of 3072
    up_taskdump: out_mixer: PID=623 Stack Used=340 of 3072
    up_taskdump: renderer0: PID=624 Stack Used=340 of 2048
    up_taskdump: renderer1: PID=625 Stack Used=340 of 2048
    up_taskdump: front_end: PID=626 Stack Used=500 of 2048
    up_taskdump: media_recorder: PID=627 Stack Used=332 of 2048
    up_taskdump: capture0: PID=628 Stack Used=700 of 2048
    initialization Audio Library
    up_assert: Assertion failed at file:dma_controller/audio_dma_drv.cpp line: 975 task: capture0
    up_registerdump: R0: 00000001 0d06ed1c 000000e0 0d06f5b4 0d06ed1c 0d093b70 0d06f56c 00000000
    up_registerdump: R8: 0d04ea24 000003cf 0d08b720 00000000 00000000 0d093b70 0d0398f1 0d039fbc
    up_registerdump: xPSR: 61000000 BASEPRI: 000000e0 CONTROL: 00000004
    up_registerdump: EXC_RETURN: ffffffe9
    up_dumpstate: sp:     0d093b70
    up_dumpstate: IRQ stack:
    up_dumpstate:   base: 0d06a988
    up_dumpstate:   size: 00000800
    up_dumpstate:   used: 000000f8
    up_dumpstate: User stack:
    up_dumpstate:   base: 0d093c58
    up_dumpstate:   size: 00000800
    up_dumpstate:   used: 00000284
    up_stackdump: 0d093b60: 0d093b70 0d06f56c 0d093c58 0d039a2b 000000e0 00000004 00000000 00000000
    up_stackdump: 0d093b80: 0d093b70 0d0398f1 0d039fbc 0d02fbcf 0d070180 0d0bbc70 00000000 00000000
    up_stackdump: 0d093ba0: 00000000 00000000 00000000 00000000 00000000 0d01f4bd 00000001 0d0075cd
    up_stackdump: 0d093bc0: 0d0bbc70 0d007209 0d0674a0 00000001 0d0914c0 0d00724f 0d0914c0 0d006c75
    up_stackdump: 0d093be0: 0d08ea20 0d02fbc3 000fd400 0100604d 00000000 000fe7d8 0d093c00 0d00653b
    up_stackdump: 0d093c00: 00000000 000d0000 0d04f2dc 0d067720 0d079d44 0d0914c0 0d08ea20 0d079d30
    up_stackdump: 0d093c20: 0d079d44 0d006fd7 000fd400 000fe7d8 0d08b720 0d007025 0d007003 0d02f003
    up_stackdump: 0d093c40: 00000000 00000000 00000000 00000000 00000000 00000000 00028010 80000820
    up_taskdump: Idle Task: PID=0 Stack Used=468 of 1024
    up_taskdump: hpwork: PID=1 Stack Used=596 of 2008
    up_taskdump: lpwork: PID=2 Stack Used=332 of 2008
    up_taskdump: lpwork: PID=3 Stack Used=332 of 2008
    up_taskdump: lpwork: PID=4 Stack Used=332 of 2008
    up_taskdump: cxd56_pm_task: PID=6 Stack Used=400 of 976
    up_taskdump: gnss_receiver: PID=7 Stack Used=284 of 976
    up_taskdump: init: PID=8 Stack Used=3076 of 8152
    up_taskdump: alt1250: PID=9 Stack Used=852 of 1992
    up_taskdump: lteevt_task: PID=10 Stack Used=628 of 2000
    up_taskdump: altcom_recvthread: PID=11 Stack Used=588 of 2048
    up_taskdump: audio_manager: PID=620 Stack Used=716 of 2048
    up_taskdump: media_player0: PID=621 Stack Used=348 of 3072
    up_taskdump: media_player1: PID=622 Stack Used=348 of 3072
    up_taskdump: out_mixer: PID=623 Stack Used=340 of 3072
    up_taskdump: renderer0: PID=624 Stack Used=340 of 2048
    up_taskdump: renderer1: PID=625 Stack Used=340 of 2048
    up_taskdump: front_end: PID=626 Stack Used=500 of 2048
    up_taskdump: media_recorder: PID=627 Stack Used=332 of 2048
    up_taskdump: capture0: PID=628 Stack Used=700 of 2048
    initialization Audio Library
    up_assert: Assertion failed at file:dma_controller/audio_dma_drv.cpp line: 975 task: capture0
    up_registerdump: R0: 00000001 0d06ed1c 000000e0 0d06f5b4 0d06ed1c 0d093b70 0d06f56c 00000000
    up_registerdump: R8: 0d04ea24 000003cf 0d08b720 00000000 00000000 0d093b70 0d0398f1 0d039fbc
    up_registerdump: xPSR: 61000000 BASEPRI: 000000e0 CONTROL: 00000004
    up_registerdump: EXC_RETURN: ffffffe9
    up_dumpstate: sp:     0d093b70
    up_dumpstate: IRQ stack:
    up_dumpstate:   base: 0d06a988
    up_dumpstate:   size: 00000800
    up_dumpstate:   used: 000000f8
    up_dumpstate: User stack:
    up_dumpstate:   base: 0d093c58
    up_dumpstate:   size: 00000800
    up_dumpstate:   used: 00000284
    up_stackdump: 0d093b60: 0d093b70 0d06f56c 0d093c58 0d039a2b 000000e0 00000004 00000000 00000000
    up_stackdump: 0d093b80: 0d093b70 0d0398f1 0d039fbc 0d02fbcf 0d070180 0d0bbc70 00000000 00000000
    up_stackdump: 0d093ba0: 00000000 00000000 00000000 00000000 00000000 0d01f4bd 00000001 0d0075cd
    up_stackdump: 0d093bc0: 0d0bbc70 0d007209 0d0674a0 00000001 0d0914c0 0d00724f 0d0914c0 0d006c75
    up_stackdump: 0d093be0: 0d08ea20 0d02fbc3 000fd400 0100604d 00000000 000fe7d8 0d093c00 0d00653b
    up_stackdump: 0d093c00: 00000000 000d0000 0d04f2dc 0d067720 0d079d44 0d0914c0 0d08ea20 0d079d30
    up_stackdump: 0d093c20: 0d079d44 0d006fd7 000fd400 000fe7d8 0d08b720 0d007025 0d007003 0d02f003
    up_stackdump: 0d093c40: 00000000 00000000 00000000 00000000 00000000 00000000 00028010 80000820
    up_taskdump: Idle Task: PID=0 Stack Used=468 of 1024
    up_taskdump: hpwork: PID=1 Stack Used=596 of 2008
    up_taskdump: lpwork: PID=2 Stack Used=332 of 2008
    up_taskdump: lpwork: PID=3 Stack Used=332 of 2008
    up_taskdump: lpwork: PID=4 Stack Used=332 of 2008
    up_taskdump: cxd56_pm_task: PID=6 Stack Used=400 of 976
    up_taskdump: gnss_receiver: PID=7 Stack Used=284 of 976
    up_taskdump: init: PID=8 Stack Used=3076 of 8152
    up_taskdump: alt1250: PID=9 Stack Used=852 of 1992
    up_taskdump: lteevt_task: PID=10 Stack Used=628 of 2000
    up_taskdump: altcom_recvthread: PID=11 Stack Used=588 of 2048
    up_taskdump: audio_manager: PID=620 Stack Used=716 of 2048
    up_taskdump: media_player0: PID=621 Stack Used=348 of 3072
    up_taskdump: media_player1: PID=622 Stack Used=348 of 3072
    up_taskdump: out_mixer: PID=623 Stack Used=340 of 3072
    up_taskdump: renderer0: PID=624 Stack Used=340 of 2048
    up_taskdump: renderer1: PID=625 Stack Used=340 of 2048
    up_taskdump: front_end: PID=626 Stack Used=500 of 2048
    up_taskdump: media_recorder: PID=627 Stack Used=332 of 2048
    up_taskdump: capture0: PID=628 Stack Used=700 of 2048
    
[/code]


CC BY-SA 4.0
2022-02-18T00:17:47.217
86425
2022-04-11T00:54:51.647
2022-02-20T23:40:14.040
48658
48658
question
spresense
spresense連続録音での初期化エラーについて


最新版の v2.5.0で、

<https://developer.sony.com/develop/spresense/docs/release_arduino_ja.html#_v2_5_0_20220401>

で、下記のこのようにコードを変更して動作させたところ、特に問題なく連続動作していました。

`exitRecording` のラベル中の `exit` を `setup()` に置き換える。  
※`SDClass` には、`end()` がないので。

[code]

      puts("End Recording");
    
      ErrEnd = false;
      setup();
    //  exit(1);
    
[/code]

ご参考まで。


CC BY-SA 4.0
2022-04-11T00:29:12.043
88255
2022-04-11T00:54:51.647
2022-04-11T00:54:51.647
32281
32281
86425
answer