Hi everyone, I?m currently trying to use opus on a ST ARM (STM32F407) without any OS (bare metal). The aim of my project is to transmit voice over CAN bus. The main issue I have is that opus fail to allocate memory, the ALLOC macro always return a NULL pointer. I have sure that I have enough free space to allocate buffers. Is there anyone who already try this or have meet this issue ? Thanks in advance. Benjamin. ________________________________ Comme vous le savez, les messages envoy?s par e-mail peuvent ?tre manipul?s par des tiers. Pour cette raison, nos messages e-mails n'ont pas de valeur juridique. Ces messages ?lectroniques (y compris les pi?ces jointes) contiennent des informations confidentielles et peuvent ?tre prot?g?es contre la distribution. L'information est destin?e ? ?tre utilis?e seulement par le ou les destinataires. Toute divulgation, copie, distribution ou utilisation du contenu de ce message est interdite. Si vous avez re?u cet e-mail par erreur, informez-moi imm?diatement par r?ponse e-mail et supprimez ce message et les pi?ces jointes de votre syst?me. Merci de votre collaboration. Wie Sie wissen, k?nnen ?ber das Internet versandte E-Mails unter fremdem Namen erstellt oder der Inhalt ver?ndert werden. Aus diesem Grund sind unsere als E-Mail verschickten Nachrichten grunds?tzlich keine rechtsverbindlichen Erkl?rungen. Der Inhalt dieser E-Mail samt Anlagen ist vertraulich und u. U. rechtlich gesch?tzt. Der Inhalt ist ausslie?lich an einen bestimmten Empf?nger gerichtet. Eine Weitergabe, die Herstellung von Kopien oder der sonstige Gebrauch durch Nichtadressaten ist nicht erlaubt. Ich bitte daher jeden anderen Empf?nger, der diese E-Mail versehentlich erh?lt, mich umgehend zu informieren und die Nachricht zu l?schen. As you are aware, messages sent by e-mail can be manipulated by third parties. For this reason our e-mail messages are generally not legally binding. This electronic message (including any attachments) contains confidential information and may be privileged or otherwise protected from disclosure. The information is intended to be for the use of the intended addressee only. Please be aware that any disclosure, copy, distribution or use of the contents of this message is prohibited. If you have received this e-mail in error please notify me immediately by reply e-mail and delete this message and any attachments from your system. Disclaimer v2.0 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20150825/e7dcd37a/attachment.htm
On 8/25/15, 12:25 AM, Treuillard, Benjamin wrote:> The aim of my project is to transmit voice over CAN bus.CAN? 8 byte transactions. CRC. Bit stuffing on 5 bit repeats. Automatic retransmits. No ordering. Really? I guess if you *have* to, but I would pick pretty much *any* interface standard *other* than CAN for audio.> The main issue I have is that opus fail to allocate memory, the ALLOC > macro always return a NULL pointer.If you are on bare metal, does malloc even work in your *own* code? I suspect your environment may not even have a valid malloc() implementation if you are on bare metal. -a -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/opus/attachments/20150825/b2a8ed43/attachment.pgp
Hi Benjamin, On 08/25/2015 09:25 AM, Treuillard, Benjamin wrote:> I?m currently trying to use opus on a ST ARM (STM32F407) without any > OS (bare metal). > > The aim of my project is to transmit voice over CAN bus. >I also have a project where I use Opus on an STM32F407 + ChibiOS (still bare metal linkage). Data is being send via bluetooth.> The main issue I have is that opus fail to allocate memory, the ALLOC > macro always return a NULL pointer. > > I have sure that I have enough free space to allocate buffers. >Compile Opus by defining -DOVERRIDE_OPUS_ALLOC (I did in Makefile.unix). Then you need to provide implementations for opus_alloc() and opus_free() in your application. I statically allocate the whole 64KB of fast non-DMA RAM of the STM32F407 and manage it as a heap in my application just for the Opus codec. Best, Stephan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20150825/4e1a717d/attachment.htm
On 08/25/2015 01:45 AM, Andrew Lentvorski wrote:> On 8/25/15, 12:25 AM, Treuillard, Benjamin wrote: >> The aim of my project is to transmit voice over CAN bus. > > CAN? 8 byte transactions. CRC. Bit stuffing on 5 bit repeats. > Automatic retransmits. No ordering. > > Really? I guess if you *have* to, but I would pick pretty much *any* > interface standard *other* than CAN for audio.Eh, it can work. CAN bus can actually guarantee ordering, and while it can't guarantee no packet loss, it does have built in retransmits. So it's not as bad as you think.>> The main issue I have is that opus fail to allocate memory, the ALLOC >> macro always return a NULL pointer. > > If you are on bare metal, does malloc even work in your *own* code? > > I suspect your environment may not even have a valid malloc() > implementation if you are on bare metal.I have a lot of experience with the STM32 series, I can probably help you out here, but it seems your current problems are unrelated to Opus in general. Can you do a simple test with malloc() and see if it works at all? What toolchain and libc are you using? You can actually use Opus without a malloc() at all, but I would expect most toolchains to have a working one.
On 08/25/2015 03:25 AM, Treuillard, Benjamin wrote:> The main issue I have is that opus fail to allocate memory, the ALLOC > macro always return a NULL pointer.ALLOC() is for temporary memory and can be implemented in one of three different ways depending on whether you define VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK. Which are you using? Have you tried the others? Jean-Marc> ------------------------------------------------------------------------ > > Comme vous le savez, les messages envoy?s par e-mail peuvent ?tre > manipul?s par des tiers. Pour cette raison, nos messages e-mails n'ont > pas de valeur juridique. Ces messages ?lectroniques (y compris les > pi?ces jointes) contiennent des informations confidentielles et peuvent > ?tre prot?g?es contre la distribution. L'information est destin?e ? ?tre > utilis?e seulement par le ou les destinataires. Toute divulgation, > copie, distribution ou utilisation du contenu de ce message est > interdite. Si vous avez re?u cet e-mail par erreur, informez-moi > imm?diatement par r?ponse e-mail et supprimez ce message et les pi?ces > jointes de votre syst?me. Merci de votre collaboration. > > Wie Sie wissen, k?nnen ?ber das Internet versandte E-Mails unter fremdem > Namen erstellt oder der Inhalt ver?ndert werden. Aus diesem Grund sind > unsere als E-Mail verschickten Nachrichten grunds?tzlich keine > rechtsverbindlichen Erkl?rungen. Der Inhalt dieser E-Mail samt Anlagen > ist vertraulich und u. U. rechtlich gesch?tzt. Der Inhalt ist > ausslie?lich an einen bestimmten Empf?nger gerichtet. Eine Weitergabe, > die Herstellung von Kopien oder der sonstige Gebrauch durch > Nichtadressaten ist nicht erlaubt. Ich bitte daher jeden anderen > Empf?nger, der diese E-Mail versehentlich erh?lt, mich umgehend zu > informieren und die Nachricht zu l?schen. > > As you are aware, messages sent by e-mail can be manipulated by third > parties. For this reason our e-mail messages are generally not legally > binding. This electronic message (including any attachments) contains > confidential information and may be privileged or otherwise protected > from disclosure. The information is intended to be for the use of the > intended addressee only. Please be aware that any disclosure, copy, > distribution or use of the contents of this message is prohibited. If > you have received this e-mail in error please notify me immediately by > reply e-mail and delete this message and any attachments from your system. > > Disclaimer v2.0 > > > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus >