ãã°ããåã«ãEmboxã«åºã¥ããŠ1 MBã®ROMãš192 KBã®RAMãåããSTM32F4-Discoveryã§SIPé»è©±ãã©ã®ããã«èµ·åãããã«ã€ããŠèª¬æããŸããã ããã§ã¯ããã®ããŒãžã§ã³ã¯æå°éã§ããããµãŒããŒã䜿çšãããé³å£°ãäžæ¹åã«ã®ã¿éä¿¡ãã2å°ã®é»è©±ãçŽæ¥æ¥ç¶ãããšèšããªããã°ãªããŸããã ãã®ããããµãŒããŒãä»ããé話ãåæ¹åã®é³å£°äŒéãåããããå®å šãªé»è©±ãç«ã¡äžããããšã決å®ããŸããããåæã«å¯èœãªéãæå°ã®ã¡ã¢ãªãµã€ãºãç¶æããŸããã
é»è©±ã§ã¯ãPJSIPã©ã€ãã©ãªã®äžéšãšããŠsimple_pjsuaã¢ããªã±ãŒã·ã§ã³ãéžæããããšã決å®ãããŸããã ããã¯ããµãŒããŒã«ç»é²ããåŒã³åºããåä¿¡ããã³å¿çã§ããæå°éã®ã¢ããªã±ãŒã·ã§ã³ã§ãã 以äžã«ãSTM32F7-Discoveryã§ãããå®è¡ããæ¹æ³ãããã«èª¬æããŸãã
å®è¡æ¹æ³
- Emboxã®æ§æ
make confload-platform/pjsip/stm32f7cube
- conf / mods.configãã¡ã€ã«ã§ãç®çã®SIPã¢ã«ãŠã³ããèšå®ããŸãã
include platform.pjsip.cmd.simple_pjsua_imported( sip_domain="server", sip_user="username", sip_passwd="password")
serverã¯SIPãµãŒããŒïŒããšãã°ãsip.linphone.orgïŒã§ããã usernameãšpasswordã¯ã¢ã«ãŠã³ãã®ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãã§ãã
- makeã³ãã³ãã§Emboxããã«ãããŸãã wikiããã³èšäºã«ããããŒãã®ãã¡ãŒã ãŠã§ã¢ã«ã€ããŠã
- Emboxã³ã³ãœãŒã«ã§ãsimple_pjsua_importedãã³ãã³ããå®è¡ããŸã
00:00:12.870 pjsua_acc.c ....SIP outbound status for acc 0 is not active 00:00:12.884 pjsua_acc.c ....sip:alexk2222@sip.linphone.org: registration success, status=200 (Registration succes 00:00:12.911 pjsua_acc.c ....Keep-alive timer started for acc 0, destination:91.121.209.194:5060, interval:15s
- æåŸã«ãã¹ããŒã«ãŒãŸãã¯ããããã©ã³ããªãŒãã£ãªåºåã«æ¿å
¥ãããã£ã¹ãã¬ã€ã®è¿ãã«ãã2ã€ã®å°ããªMEMSãã€ã¯ãšè©±ããŸãã Linuxããsimple_pjsuaãpjsuaã¢ããªã±ãŒã·ã§ã³ã䜿çšããŠåŒã³åºããŸãã ãŸãããŸãã¯ãä»ã®çš®é¡ã®linphoneã䜿çšã§ããŸãã
ããã¯ãã¹ãŠã wikiã§èª¬æãããŠããŸã ã
ã©ããã£ãŠããã«æ¥ãã®ïŒ
ãã®ãããæåã¯ããŒããŠã§ã¢ãã©ãããã©ãŒã ã®éžæã«é¢ããŠçåãçããŸããã STM32F4-Discoveryãã¡ã¢ãªã«åãŸããªãããšãæããã ã£ããããSTM32F7-DiscoveryãéžæãããŸããã 圌女ã«ã¯1 MBã®ãã©ãã·ã¥ãã©ã€ããš256 KBã®RAMïŒ+ 64ã®ç¹å¥ãªé«éã¡ã¢ãªãããã䜿çšããŸãïŒããããŸãã ãŸãããµãŒããŒãä»ããåŒã³åºãã«ã€ããŠã¯ããŸãå€ããããŸããããå ¥ãããšããããšã«ããŸããã
åŸæ¥ãã¿ã¹ã¯ã¯ããã€ãã®æ®µéã«åå²ãããŠããŸããã
- QEMUã§PJSIPãå®è¡ããŸãã ãããã°ã«ã¯äŸ¿å©ã§ããããAC97ã³ãŒããã¯ãæ¢ã«ãµããŒãããŠããŸããã
- QEMUããã³STM32ã§ã®é³å£°ã®é²é³ãšåçã
- PJSIPå ããsimple_pjsuaã¢ããªã±ãŒã·ã§ã³ã移æ€ããŸãã SIPãµãŒããŒã«ç»é²ããŠåŒã³åºããè¡ãããšãã§ããŸãã
- ç¬èªã®AsteriskããŒã¹ã®ãµãŒããŒãå±éããŠãã¹ãããsip.linphone.orgãªã©ã®å€éšãµãŒããŒãè©ŠããŠãã ãã
Emboxã®ãµãŠã³ãã¯Portaudioãä»ããŠæ©èœããŸããPortaudioã¯PISIPã§ã䜿çšãããŸãã QEMUã§æåã®åé¡ãçºçããŸãããWAVã¯44100 Hzã§è¯å¥œã«åçãããŸãããã8000ã§æããã«åé¡ãçºçããŸããã ããã¯åšæ³¢æ°ãèšå®ããããšã®åé¡ã§ããããšãå€æããŸãã-ããã©ã«ãã§ã¯æ©åšã®44100ã§ããããããã¯ããã°ã©ã ã«ãã£ãŠå€æŽãããŸããã§ããã
ããã§ã¯ãäžè¬çã«ãµãŠã³ããã©ã®ããã«åçãããããå°ã説æãã䟡å€ããããŸãã ãµãŠã³ãã«ãŒãã¯ãæå®ã®åšæ³¢æ°ã§åçãŸãã¯é²é³ããã¡ã¢ãªã«ãã€ã³ã¿ãèšå®ã§ããŸãã ãããã¡ãçµäºãããšãå²ã蟌ã¿ãçæããã次ã®ãããã¡ããå®è¡ãç¶ç¶ãããŸãã å®éããããã®ãããã¡ã¯ãåã®ãããã¡ãåçãããåã«äºåã«æºããããŠããå¿ èŠããããŸãã ãã®åé¡ã¯ãSTM32F7ã§ããã«çºçããŸãã
次ã«ããµãŒããŒãã¬ã³ã¿ã«ããŠãã¢ã¹ã¿ãªã¹ã¯ãå±éããŸããã å€ãã®ãããã°ãå¿ èŠã§ãããããã€ã¯ã«åãã£ãŠè©±ããããªããããèªååçãšé²é³ãè¡ãå¿ èŠããããŸããã ãããè¡ãããã«ãsimple_pjsuaã«ããããé©çšããŠããªãŒãã£ãªããã€ã¹ã®ä»£ããã«ãã¡ã€ã«ãã¹ãªããã§ããããã«ããŸããã PJSIPã§ã¯ãããã¯éåžžã«ç°¡åã«è¡ãããŸããããŒãã®æŠå¿µãããã€ã¹ãŸãã¯ãã¡ã€ã«ã®ããããã§ããããã§ãã ãŸãããããã®ããŒãã¯ä»ã®ããŒãã«æè»ã«æ¥ç¶ã§ããŸãã ã³ãŒãã¯pjsip ãªããžããªã§ç¢ºèªã§ããŸã ã ãã®çµæãã¹ããŒã ã¯æ¬¡ã®ããã«ãªããŸããã AsteriskãµãŒããŒã§ãLinuxçšãšEmboxçšã®2ã€ã®ã¢ã«ãŠã³ããååŸããŸããã 次ã«ã simple_pjsua_importedã³ãã³ããEmboxã§å®è¡ããã EmboxããµãŒããŒã«ç»é²ãããŸãããã®åŸãLinuxããEmboxãåŒã³åºããŸãã æ¥ç¶æã«ãã¢ã¹ã¿ãªã¹ã¯ãµãŒããŒã§æ¥ç¶å šäœã確ç«ãããŠããããšã確èªããŸãããã°ãããããšãEmboxã§Linuxããé³ãèãããã¯ãã§ããLinuxã§ã¯ãEmboxããåçããããã¡ã€ã«ãä¿åããŸãã
QEMUã§æ©èœããåŸãSTM32F7-Discoveryãžã®ç§»æ€ã«åãæ¿ããŸããã æåã®åé¡ã¯ãç»åãµã€ãºã«é¢ããŠã-Osãã³ã³ãã€ã©ã®æé©åãå«ãŸããŠããªããšã1 MB ROMã«åãŸããªãã£ãããšã§ãã ãããã£ãŠãã-Oããå«ãŸããŸãã ããã«ããããã¯C ++ãµããŒãããªãã«ããŠãããããpjsuaã«ã®ã¿å¿ èŠã§ãããsimple_pjsuaã䜿çšããŸãã
simple_pjsuaããã£ããã£ã³ã°ããåŸãä»ã§ã¯ãããèµ·åããæ©äŒããããšå€æããŸããã ããããæåã«ãé³å£°ã®é²é³ãšåçã«å¯ŸåŠããå¿ èŠããããŸããã 質å-ã©ãã«æžããïŒ å€éšã¡ã¢ãª-SDRAMïŒ128 MBïŒãéžæããŸããã èªåã§è©Šãããšãã§ããŸãïŒ
åšæ³¢æ°ã16000 Hzã§æç¶æéã10ç§ã®ã¹ãã¬ãªWAVãäœæããŸãã
record -r 16000 -c 2 -d 10000 -m C0000000
è² ãïŒ
play -m C0000000
2ã€ã®åé¡ããããŸããã ã³ãŒããã¯ãåããæåã®ãã®ã¯WM8994ã§ãããã¹ããããªã©ã®æŠå¿µãæã¡ããããã®ã¹ãããã¯4ã§ãããããã£ãŠãããã©ã«ãã§ã¯ããããèšå®ãããŠããªãå ŽåããªãŒãã£ãªãåçãããš4ã€ã®ã¹ããããã¹ãŠã§åçãè¡ãããŸãã ãããã£ãŠã16000 Hzã®åšæ³¢æ°ã§ã¯8000 Hzãåä¿¡ããŸãããã8000 Hzã®å Žåãåçã¯åã«æ©èœããŸããã§ããã ã¹ããã0ãš2ã®ã¿ãéžæãããå Žåãæ£åžžã«æ©èœããŸããã ãã1ã€ã®åé¡ã¯ãSTM32Cubeã®ãªãŒãã£ãªã€ã³ã¿ãŒãã§ã€ã¹ã§ããããªãŒãã£ãªåºåã¯ãSAIïŒã·ãªã¢ã«ãªãŒãã£ãªã€ã³ã¿ãŒãã§ã€ã¹ïŒãä»ããŠãªãŒãã£ãªå ¥åãšåæããŠåäœããŸãïŒè©³çŽ°ã¯ç解ã§ããŸããã§ããããå ±éã®ã¯ããã¯ãå ±æãããªãŒãã£ãªåºåãåæåããããšããªãŒãã£ãªãäœããã®æ¹æ³ã§æ¥ç¶ãããŸãå ¥åïŒã ã€ãŸããããããåå¥ã«èµ·åããããšã¯ã§ããªãããã次ã®ããšãè¡ããŸããããªãŒãã£ãªå ¥åãšãªãŒãã£ãªåºåã¯åžžã«æ©èœããŸãïŒå²ã蟌ã¿ãå«ãïŒã ããããã·ã¹ãã ã§äœã倱ãããŠããªãå Žåã¯ã空ã®ãããã¡ããªãŒãã£ãªåºåã«æ¿å ¥ããã ãã§ãåçãéå§ããããšãæ£çŽã«ãããåãå§ããŸãã
ããã«ã圌ãã¯å£°ãé²é³ãããšãã®é³ãéåžžã«éãã§ãããšããäºå®ã«ééããŸããã ããã¯ãSTM32F7-Discoveryäžã®MEMSãã€ã¯ã16000 Hzæªæºã®åšæ³¢æ°ã§äœããã®åœ¢ã§ããŸãæ©èœããªãããã§ãã ãããã£ãŠã8000 Hzãæ¥ãŠãã16000 Hzãèšå®ããŸãã ãã®ãããçå®ã¯ãããåšæ³¢æ°ããå¥ã®åšæ³¢æ°ãžã®ãœãããŠã§ã¢å€æãè¿œå ããããšã§ããã
次ã«ãRAMã«ããããŒãã®ãµã€ãºãå¢ããå¿ èŠããããŸããã èŠç©ããã«ãããšãpjsipã¯çŽ190 Kbãå¿ èŠãšããçŽ100 KbãããããŸããã§ããã ããã§ã¯ãå°ãã®å€éšã¡ã¢ãª-SDRAMïŒçŽ128 KbïŒã䜿çšããå¿ èŠããããŸããã
ããããã¹ãŠã®ç·šéãè¡ã£ãåŸãLinuxãšEmboxã®éã§æåã®ããã±ãŒãžãèŠãŠãé³ãèãããŸããïŒ ããããé³ã¯ã²ã©ããã®ã§ãQEMUã®ããã§ã¯ãããŸããã§ããã ããããç§ãã¡ã¯äœãåé¡ã«ãªãã®ãèããŸããã ãããã°ã®çµæãEmboxã«ã¯ãªãŒãã£ãªãããã¡ãå å¡«/ã¢ã³ããŒãããæéããªãããšãããããŸããã pjsipã1ãã¬ãŒã ãåŠçããŠããéã«ããããã¡ãŒåŠçã®å®äºåã«2ã€ã®å²ã蟌ã¿ãçºçããŸãããããã¯å€ãããŸãã é«éåããæåã®èãã¯ã³ã³ãã€ã©ã®æé©åã§ãããããã§ã«PJSIPã«å«ãŸããŠããŸããã 2ã€ç®ã¯ããŒããŠã§ã¢ã®æµ®åå°æ°ç¹ã§ããããã«ã€ããŠã¯èšäºã§èª¬æããŸãã ã ããããå®è·µã瀺ããŠããããã«ãFPUã¯é床ãå€§å¹ ã«åäžãããããšã¯ãããŸããã§ããã 次ã®ã¹ãããã¯ãã¹ã¬ããã«åªå é äœãä»ããããšã§ããã Emboxã«ã¯ããŸããŸãªã¹ã±ãžã¥ãŒãªã³ã°æŠç¥ããããåªå 床ããµããŒããããªãŒãã£ãªã¹ããªãŒã ãæé«ã®åªå 床ã«èšå®ãããã®ãå«ããŸããã ãããå©ãã«ã¯ãªããŸããã§ããã
次ã¯ãå€éšã¡ã¢ãªã䜿çšããŠäœæ¥ããŠãããšããèãã§ãããã¢ã¯ã»ã¹ãéåžžã«é »ç¹ã«è¡ãããæ§é ã«ç§»åããã®ã¯è¯ãããšã§ãã simple_pjsuaãã¡ã¢ãªãå²ãåœãŠãã¿ã€ãã³ã°ãšãã®äžã®äºååæãè¡ããŸããã 190 Kbã®ãã¡ãæåã®90 Kbã¯PJSIPã®å éšããŒãºã«å²ãåœãŠãããŠãããããŸãé »ç¹ã«ã¢ã¯ã»ã¹ãããªãããšãå€æããŸããã 次ã«ãçä¿¡åŒã³åºãäžã«pjsua_call_answeré¢æ°ãåŒã³åºãããŸãããã®é¢æ°ã§ã¯ãçä¿¡ãã¬ãŒã ãšçºä¿¡ãã¬ãŒã ãåŠçããããã«ãããã¡ãŒãå²ãåœãŠãããŸãã çŽ100 kbã§ããã ãããŠãããã§ã¯æ¬¡ã®ããã«è¡åããŸããã åŒã³åºãæãŸã§ãããŒã¿ã¯å€éšã¡ã¢ãªã«ä¿åãããŸãã åŒã³åºãåŸããã«-ããã«ããŒãå ã®RAMã亀æããŸãã ãããã£ãŠããã¹ãŠã®ãããããããŒã¿ã¯ãããé«éã§äºæž¬å¯èœãªã¡ã¢ãªã«è»¢éãããŸããã
ãã®çµæãããããã¹ãŠã«ããã simple_pjsuaãèµ·åãããµãŒããŒãä»ããŠåŒã³åºããè¡ãããšãã§ããŸããã ãããŠãsip.linphone.orgãªã©ã®ä»ã®ãµãŒããŒãä»ããŠã
çµè«
ãã®çµæã simple_pjsuaãå®è¡ãããµãŒããŒãä»ããŠäž¡æ¹åã«é³å£°ãéä¿¡ããããšãå€æããŸããã è¿œå ã§æ¶è²»ããã128 Kb SDRAMã®åé¡ã¯ããããã«åŒ·åãªCortex-M7ïŒããšãã°ã512 Kb RAMãåããSTM32F769NIïŒã䜿çšããããšã§è§£æ±ºã§ããŸãããåæã«256 Kbã«ãªãå¯èœæ§ã¯ãŸã ãããŸãã:) ãããã«è¯ã-è©ŠããŠã¿ãŠãã ããã ãã€ãã®ããã«ããã¹ãŠã®ãœãŒã¹ã¯ãªããžããªã«ãããŸã ã