Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libquiet ctypes binding #1

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Conversation

xiongyihui
Copy link

@brian-armstrong
This is an attempt to build a ctypes binding for libquiet. Hope it helps.

Changes

  • update scripts/libs.sh
    • without fftw3 - reduce dependencies, avoid GPL (fftw3) vs MIT/BSD (libquit)
    • without portaudio - reduce dependencies, use pyaudio in python
  • add quiet/quiet.py - ctypes binding for libquiet.so
  • update setup.py

Usage

See examples decode() and test() of quiet/quiet.py

known issues

  • if portaudio lib is in system lib path, libquiet will use it, which cause link error. A quick fix is to remove portaudio-dev library

  • not work on ARM (raspberry pi). It seems libcorrect is not a complete replacement for libfec. The error message is:

    /home/pi/quiet.py/sysroot/usr/lib/libliquid.so: undefined reference to `P_init'                                             
    /home/pi/quiet.py/sysroot/usr/lib/libliquid.so: undefined reference to `Partab'                                             
    /home/pi/quiet.py/sysroot/usr/lib/libliquid.so: undefined reference to `partab_init' 
    

@brian-armstrong
Copy link
Member

brian-armstrong commented May 8, 2018

Thanks, I'll take a look at this. It's really cool you put this together.

My plan (and existing WIP) goes in a different direction, binding quiet from inside a C python extension. That's probably going to take a while to finish and isn't particularly high priority though. I'll see about how to provide this in the interim.

Regarding ARM, those missing symbols aren't used by liquid directly. I seem to remember they're specific to libfec. Did you happen to link liquid against fec and then drop in correct+shim? That may not build the correct linkage.

Edit: to clarify, I suspect compiling against fec may be the issue. I think it has some extern symbols in use in its header file. Compiling against correct will fix this.

@xiongyihui
Copy link
Author

Oh, the libcorrect works on ARM, I forgot to remove the header file /usr/local/include/fec.h of the libfec.

@JarbasAl
Copy link

any updates on this issue? I would like to implement quiet in some python projects and this would help a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants