Hi again!

2011/3/15 Niki Yoshiuchi <aplu...@gmail.com>:
> I've been using ocaml-portaudio for some pitch-detection software I'm
> working on.  I noticed that some functionality was missing and decided
> to add it in.  Specifically I've been working on: different formats,
> callbacks and using Bigarrays.
>
> I don't know how useful callbacks are - if the execution of the
> callback takes too long portaudio will silently fail (pun intended).
> On my machine (an EeePC 1000H) the callback couldn't handle much more
> than a Bigarray.blit.  Generating random noise, for example, would
> cause the thread to terminate execution after a few seconds.  This
> also requires OCaml 3.12 and the use of threads.

I have no idea if callback are useful but I see that the code for this
seems very clean and makes use of the thread registration API provided
by ocaml 3.12. Very nice :-)

My only remark would be about the use of printf which is probably
temporary for debugging..

> The other significant change I've made is switching to Bigarrays.
> This results in far less copying of data and allows for almost
> seamless use of non-interleaved arrays.  I have noticed that Liquid
> Soap uses float array arrays extensively and that Bigarrays will break
> compatibility.  While I have currently rewritten the read and write
> functions to use Bigarrays I can easily support both in order to not
> break compatibility.  However this leads me to wonder (and forgive me
> if this is an ignorant question, I don't use Liquid Soap and only
> briefly looked through the source) why float array arrays are used
> over Bigarrays given that Bigarrays are compatible with C.

I think the answer is that we consider that copying float arrays is
negligable compared to the advantage of being able to manipulate
directly floats in OCaml code in Liquidsoap.

For video data, however, we are using bigarrays because copying data
is just not an option there..

It would be nice indeed to have a backward compatibility API. You may
switch the main function to bigarray and provide an alternative _f API
though..

> My code can be found on github:
> https://github.com/aplusbi/ocaml-portaudio  Some functionality is
> still missing or untested, but please let me know if any of this work
> is of use to Savonet.

I think we would be pleased to incorporate your changes once you are
done. I also believe that we would be pleased to give you commit
access to our repository if you wish to work directly there..

Romain

> Thanks,
> Niki Yoshiuchi
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> Savonet-devl mailing list
> Savonet-devl@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/savonet-devl
>

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Savonet-devl mailing list
Savonet-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-devl

Répondre à