nettoyeurny / opensl_stream

A simple callback-driven audio API for Android that sits on top of OpenSL and provides a credible illusion of synchronized input and output.
63 stars 13 forks source link

pd-for-android compilation errors in opensl_stream.c #5

Open joebowbeer opened 2 years ago

joebowbeer commented 2 years ago

pd-for-android compilation errors:

/pd-for-android/PdCore/src/main/jni/libpd/jni/opensl_stream/opensl_stream.c:98:3:
warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
  clock_gettime(CLOCK_MONOTONIC, &t);
  ^
/pd-for-android/PdCore/src/main/jni/libpd/jni/opensl_stream/opensl_stream.c:510:3:
warning: implicit declaration of function 'usleep' is invalid in C99 [-Wimplicit-function-declaration]
[x86] Compile        : pdnativeopensl <= opensl_stream.c
  usleep(100000);
make: Leaving directory '/pd-for-android/PdCore/src/main/jni'
  ^
2 warnings generated.

https://github.com/libpd/libpd/pull/357#issuecomment-1132106623

See two fixes to opensl_stream.c below

  1. https://github.com/libpd/libpd/pull/357#issuecomment-1132243211
  2. https://github.com/libpd/libpd/pull/357#issuecomment-1132245811
Ant1r commented 2 years ago

Actually #2 already fixes this... But it's 4 years old ;-)

tkirshboim commented 2 years ago

2 seems to resolve the compile errors from opensl_stream.c. I tested it by using code from #2 when building pd-for-android (see @tkirshboim\pd-for-android ). The errors related to clock_gettime and usleep are no longer there. Unfortunately other compile errors are present, however these seem more related to pure data source code, than libpd:

libpd/pure-data/src/x_file.c:909: error: undefined reference to 'glob'
libpd/pure-data/src/x_file.c:940: error: undefined reference to 'globfree'
BorisMolch commented 1 year ago

@tkirshboim were you able to resolve these 'glob' errors?

tkirshboim commented 1 year ago

@BorisMolch Yes, this issue was recently solved by raising the minimum API level. See this comment.