Can't build audiostream for Android

792 views
Skip to first unread message

Jason Boyd

unread,
Oct 11, 2016, 8:24:56 PM10/11/16
to Kivy users support


I suspect this may be a known issue, but I see there is a recipe in python-for-android for building audiostream, but it fails to build. Log below, but the error at the end is:

 

master/pythonforandroid/recipes/audiostream/__init__.py", line 25, in get_recipe_env

    raise RuntimeError('Audiostream library is not yet able to configure itself to link against SDL2.  Patch on audiostream library needed - any help much appreciated!')


I've been looking for alternatives to the simple SoundLoader and came across audiostream, which is awesome if I could compile it for Android. Also looked at PyAudio which though not very active, works well on computer alongside Kivy. It is dependent on Portaudio, and there is at least one abandoned attempt at building it for Android, since it supports ALSA and OSS hosts. Both PyAudio and audiostream offer basically same functionality, writing directly to sound device and reading from microphone. Even if this does not provide lower latency than SoundLoader, it opens up huge range of options for generating audio and music from touch devices. 


If this isn't too easy to address, I'd be curious to know what needs to happen to get this to work. 



$ buildozer android_new debug

# Check configuration tokens

# Ensure build layout

# Check configuration tokens

# Preparing build

# Check requirements for android

# Search for Git (git)

#  -> found at /usr/bin/git

# Search for Cython (cython)

#  -> found at /Library/Frameworks/Python.framework/Versions/2.7/bin/cython

# Search for Java compiler (javac)

#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javac

# Search for Java keytool (keytool)

#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/keytool

# Install platform

# Apache ANT found at /Users/macbookpro/apache-ant-1.9.7/bin

# Android SDK found at /Users/macbookpro/Library/Android/sdk

# Android NDK found at /Users/macbookpro/Library/Android/ndk-r12b

# Check application requirements

# Check garden requirements

# Compile platform

# Run 'python -m pythonforandroid.toolchain --color=always --storage-dir=/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build create --dist_name=learningkivy --bootstrap=sdl2 --requirements=kivy,python2,audiostream --arch armeabi-v7a --copy-libs'

# Cwd /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Will compile for the following archs: armeabi-v7a

[INFO]:    Found Android API target in $ANDROIDAPI

[INFO]:    Available Android APIs are (19, 20, 21, 22, 23)

[INFO]:    Requested API target 19 is available, continuing.

[INFO]:    Found NDK dir in $ANDROIDNDK

[INFO]:    Got NDK version from $ANDROIDNDKVER

[INFO]:    Using Google NDK r9c

[INFO]:    Found virtualenv at /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv

[INFO]:    Found the following toolchain versions: ['4.9']

[INFO]:    Picking the latest gcc toolchain, here 4.9

[WARNING]: Missing executable: libtoolize is not installed

[INFO]:    No existing dists meet the given requirements!

[INFO]:    No dist exists that meets your requirements, so one will be built.

[INFO]:    Bootstrap requires recipes ['sdl2', ('python2', 'python3crystax')]

[INFO]:    Loaded recipe sdl2 (depends on [('python2', 'python3crystax'), 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf'], conflicts ['sdl', 'pygame', 'pygame_bootstrap_components'])

[INFO]:    Loaded recipe kivy (depends on ['pyjnius', ('sdl2', 'pygame'), ('python2', 'python3crystax')])

[INFO]:    Loaded recipe audiostream (depends on ['pyjnius', ('python2', 'python3crystax'), ('sdl', 'sdl2'), 'python2'])

[INFO]:    Loaded recipe python2 (depends on ['hostpython2'], conflicts ['python3crystax', 'python3'])

[INFO]:    Loaded recipe sdl2_image (depends on [])

[INFO]:    Loaded recipe sdl2_mixer (depends on [])

[INFO]:    Loaded recipe sdl2_ttf (depends on [])

[INFO]:    Loaded recipe pyjnius (depends on ['six', ('sdl2', 'sdl', 'genericndkbuild'), ('python2', 'python3crystax')])

[INFO]:    Loaded recipe hostpython2 (depends on [], conflicts ['hostpython3'])

[INFO]:    Loaded recipe six (depends on [('python2', 'python3crystax')])

[INFO]:    Found a single valid recipe set (this is good)

[INFO]:    The selected bootstrap is sdl2

[INFO]:    # Creating dist with sdl2 bootstrap

[INFO]:    Dist will have name learningkivy and recipes (kivy, python2, audiostream)

[INFO]:    -> running cp -r /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/p...(and 145 more)

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Recipe build order is ['hostpython2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2', 'sdl2', 'six', 'pyjnius', u'audiostream', u'kivy']

[INFO]:    # Downloading recipes 

[INFO]:    Downloading hostpython2

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/hostpython2

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/hostpython2

[INFO]:    -> running basename http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2

[INFO]:    hostpython2 download already cached, skipping                                                                                            

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading sdl2_image

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_image

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_image

[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz

[INFO]:    sdl2_image download already cached, skipping                                                                                             

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading sdl2_mixer

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_mixer

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_mixer

[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz

[INFO]:    sdl2_mixer download already cached, skipping                                                                                             

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading sdl2_ttf

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_ttf

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_ttf

[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz

[INFO]:    sdl2_ttf download already cached, skipping                                                                                               

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading python2

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/python2

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/python2

[INFO]:    -> running basename http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2

[INFO]:    python2 download already cached, skipping                                                                                                

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading sdl2

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2

[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz

[INFO]:    sdl2 download already cached, skipping                                                                                                   

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading six

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/six

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/six

[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz

[INFO]:    six download already cached, skipping                                                                                                    

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading pyjnius

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/pyjnius

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/pyjnius

[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/master.zip

[INFO]:    pyjnius download already cached, skipping                                                                                                

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading audiostream

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/audiostream

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/audiostream

[INFO]:    -> running basename https://github.com/kivy/audiostream/archive/master.zip

[WARNING]: Should check headers here! Skipping for now.                                                                                             

[INFO]:    -> running rm -f .mark-master.zip

[INFO]:    Downloading audiostream from https://github.com/kivy/audiostream/archive/master.zip

Downloading audiostream from https://github.com/kivy/audiostream/archive/master.zip

[INFO]:    -> running touch .mark-master.zip

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Downloading kivy

[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/kivy

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/kivy

[INFO]:    -> running basename https://github.com/kivy/kivy/archive/master.zip

[INFO]:    kivy download already cached, skipping                                                                                                   

[WARNING]: Should check headers here! Skipping for now.

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    # Building all recipes for arch armeabi-v7a

[INFO]:    # Unpacking recipes

[INFO]:    Unpacking hostpython2 for armeabi-v7a

[INFO]:    -> running basename http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop      

[INFO]:    hostpython2 is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking sdl2_image for armeabi-v7a

[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni     

[INFO]:    sdl2_image is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking sdl2_mixer for armeabi-v7a

[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni     

[INFO]:    sdl2_mixer is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking sdl2_ttf for armeabi-v7a

[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni     

[INFO]:    sdl2_ttf is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking python2 for armeabi-v7a

[INFO]:    -> running basename http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a      

[INFO]:    python2 is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking sdl2 for armeabi-v7a

[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni     

[INFO]:    sdl2 is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking six for armeabi-v7a

[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/six-python2/armeabi-v7a  

[INFO]:    six is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking pyjnius for armeabi-v7a

[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/master.zip

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a

[INFO]:    pyjnius is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking audiostream for armeabi-v7a

[INFO]:    -> running basename https://github.com/kivy/audiostream/archive/master.zip

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/audiostream-python2-sdl2/armeabi-v7a

[INFO]:    -> running mv audiostream-master /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build...(and 62 more)

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Unpacking kivy for armeabi-v7a

[INFO]:    -> running basename https://github.com/kivy/kivy/archive/master.zip

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/kivy-python2-sdl2/armeabi-v7a

[INFO]:    kivy is already unpacked, skipping

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    # Prebuilding recipes

[INFO]:    Prebuilding hostpython2 for armeabi-v7a

[INFO]:    -> running cp /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pyth...(and 175 more)

[INFO]:    Prebuilding sdl2_image for armeabi-v7a

[INFO]:    sdl2_image has no prebuild_armeabi_v7a, skipping

[INFO]:    Applying patches for sdl2_image[armeabi-v7a]

[INFO]:    sdl2_image already patched, skipping

[INFO]:    Prebuilding sdl2_mixer for armeabi-v7a

[INFO]:    sdl2_mixer has no prebuild_armeabi_v7a, skipping

[INFO]:    Applying patches for sdl2_mixer[armeabi-v7a]

[INFO]:    sdl2_mixer already patched, skipping

[INFO]:    Prebuilding sdl2_ttf for armeabi-v7a

[INFO]:    sdl2_ttf has no prebuild_armeabi_v7a, skipping

[INFO]:    Prebuilding python2 for armeabi-v7a

[INFO]:    python2 has no prebuild_armeabi_v7a, skipping

[INFO]:    Applying patches for python2[armeabi-v7a]

[INFO]:    python2 already patched, skipping

[INFO]:    Prebuilding sdl2 for armeabi-v7a

[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping

[INFO]:    Applying patches for sdl2[armeabi-v7a]

[INFO]:    sdl2 already patched, skipping

[INFO]:    Prebuilding six for armeabi-v7a

[INFO]:    six has no prebuild_armeabi_v7a, skipping

[INFO]:    Prebuilding pyjnius for armeabi-v7a

[INFO]:    pyjnius has no prebuild_armeabi_v7a, skipping

[INFO]:    Applying patches for pyjnius[armeabi-v7a]

[INFO]:    pyjnius already patched, skipping

[INFO]:    Prebuilding audiostream for armeabi-v7a

[INFO]:    audiostream has no prebuild_armeabi_v7a, skipping

[INFO]:    Prebuilding kivy for armeabi-v7a

[INFO]:    kivy has no prebuild_armeabi_v7a, skipping

[INFO]:    # Building recipes

[INFO]:    Building hostpython2 for armeabi-v7a

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2

[INFO]:    hostpython already exists, skipping build

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master

[INFO]:    Building sdl2_image for armeabi-v7a

[INFO]:    Building sdl2_mixer for armeabi-v7a

[INFO]:    Building sdl2_ttf for armeabi-v7a

[INFO]:    Building python2 for armeabi-v7a

[INFO]:    Copying hostpython binary to targetpython folder

[INFO]:    -> running cp /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/hostp...(and 160 more)

[INFO]:    Building sdl2 for armeabi-v7a

[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni

[INFO]:    -> running ndk-build V=1

ccache found, will optimize builds

('path is', '/Users/macbookpro/Library/Android/ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86/bin/:/Users/macbookpro/Library/Android/ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/:/Users/macbookpro/Library/Android/ndk-r12b:/Users/macbookpro/Library/Android/sdk/tools:/Users/macbookpro/apache-ant-1.9.7/bin/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/macbookpro/bin:/Users/macbookpro/apache-ant-1.9.7/bin:/Users/macbookpro/Library/Android/sdk/tools:/Users/macbookpro/Library/Android/sdk/platform-tools')

[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master                         

[INFO]:    Building six for armeabi-v7a

[INFO]:    Python package already exists in site-packages

[INFO]:    six said it is already built, skipping

[INFO]:    Building pyjnius for armeabi-v7a

[INFO]:    Python package already exists in site-packages

[INFO]:    pyjnius said it is already built, skipping

[INFO]:    Building audiostream for armeabi-v7a

[INFO]:    audiostream apparently isn't already in site-packages

[INFO]:    Cythonizing anything necessary in audiostream

('name is', None, <class 'pythonforandroid.recipes.six.SixRecipe'>)

('name is', 'jnius', <class 'pythonforandroid.recipes.pyjnius.PyjniusRecipe'>)

('name is', None, <class 'pythonforandroid.recipes.audiostream.AudiostreamRecipe'>)

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main

    "__main__", fname, loader, pkg_name)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code

    exec code in run_globals

  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 829, in <module>

    main()

  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 826, in main

    ToolchainCL()

  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 483, in __init__

    getattr(self, args.subparser_name.replace('-', '_'))(args)

  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 146, in wrapper_func

    build_dist_from_args(ctx, dist, args)

  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 189, in build_dist_from_args

    build_recipes(build_order, python_modules, ctx)

  File "pythonforandroid/build.py", line 562, in build_recipes

    recipe.build_arch(arch)

  File "pythonforandroid/recipe.py", line 958, in build_arch

    self.build_cython_components(arch)

  File "pythonforandroid/recipe.py", line 964, in build_cython_components

    env = self.get_recipe_env(arch)

  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/audiostream/__init__.py", line 25, in get_recipe_env

    raise RuntimeError('Audiostream library is not yet able to configure itself to link against SDL2.  Patch on audiostream library needed - any help much appreciated!')

RuntimeError: Audiostream library is not yet able to configure itself to link against SDL2.  Patch on audiostream library needed - any help much appreciated!

# Command failed: python -m pythonforandroid.toolchain --color=always --storage-dir=/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build create --dist_name=learningkivy --bootstrap=sdl2 --requirements=kivy,python2,audiostream --arch armeabi-v7a --copy-libs

# Buildozer failed to execute the last command

# The error might be hidden in the log above this error

# Please read the full log, and search for it before

# raising an issue with buildozer itself.

# In case of a bug report, please add a full log with log_level = 2

Jason Boyd

unread,
Oct 24, 2016, 11:53:06 PM10/24/16
to Kivy users support
Any response at all would be nice...

I'm building a little synthesizer app, works fine on OS X. My current plan, since I lack the knowledge to fix the library myself, is to port any application I make to another language, either JS/Cordova/WebAudio or Java for Android native. I would love it if I could just run my app on mobile ...

Alexander Taylor

unread,
Oct 27, 2016, 4:56:23 PM10/27/16
to Kivy users support
I don't think this should be that complicated to fix, just nobody has done it. I'm not sure what would need doing though, probably editing the setup.py to change what it links against but maybe also some code changes if the SDL2 API is different to what it used before (although this can't be that hard, since we use sdl2 on kivy-ios).

Jason Boyd

unread,
Oct 27, 2016, 5:13:28 PM10/27/16
to Kivy users support
That would be great. I'm stuck because however simple it may be, I simply don't know enough about how recipes work to do this myself. Makefiles and compiling for target platforms is black magic to me, unfortunately. 

I may however post my little project on github if anyone else is curious. It works nicely on OS X. I'm both eager to get proper touch input and to see if whatever audiostream is wrapping on Android has better latency than many approaches on Android notoriously do...

I guess I'll just poke this thread now and then, hoping someone can fix.

Alexander Taylor

unread,
Oct 27, 2016, 7:41:08 PM10/27/16
to kivy-...@googlegroups.com
I don't know either, I'm not familiar with the audio processing parts of
the toolchain and it wasn't obvious on a quick look quite how much needs
changing.

I do know that at least one person has tried audiostream recently with
latency in mind, without great results, apparently because Android is
just bad like that (as you say) and not because audiostream was missing
anything.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Kivy users support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/kivy-users/-A4NqroF0ew/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> kivy-users+...@googlegroups.com
> <mailto:kivy-users+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


signature.asc

Jason Boyd

unread,
Oct 27, 2016, 8:05:18 PM10/27/16
to Kivy users support
Only adding this as related and of interest to anyone reading this thread:

I suspect audiostream is wrapping Android *java* classes for accessing the sound device (because that seems norm for Kivy), and I also believe it is this java implementation that may be reason for bad reputation with Android latency. 

ALSA, the Advanced Linux Sound Architecture, is apparently supported on Android, based on cursory reading, and *may* mean there is a better, lower level way to access the sound device, with low latency. 

PyAudio is a solid Python wrapper around PortAudio, which is an open source C++ library for accessing audio hardware, which supports ALSA drivers. In theory, PortAudio could be compiled for Android and iOS, and PyAudio would "just work". 

Sadly, it seems no one currently has both the know-how and motivation to do such porting. I wish I had the skills. I see someone had a port of PortAudio for Android going a few years back, looks like it was abandoned, not sure in what state. 

Keep in mind, PortAudio/PyAudio and tito's audiostream package are not doing a ton of things. They are not audio processing libraries, but simply wrappers to open a connection to the native sound device for sending/receiving byte streams. So while there is work involved, neither is a large or complex library. 

There is a whole class of applications possible with such a library. My particular interest is musical performance and creative apps, which very much want latency below 10-20ms so that touch input -> audible sound feels like an instrument and rhythmic playing is possible. Latency much higher than this tends to throw off rhythm too much in the ear->finger coordination. 

Hope there may be further input from others.

manoj lamkhade

unread,
May 28, 2018, 1:24:04 AM5/28/18
to Kivy users support
Hello,
I don't now whether this is right platform to as such question still any help will be appreciated

I am using buildozer to make APK  and not getting any success 
pyaudio is not available in standard python libraries, So may i have step wise procedure to add custom library to python-for -android I am using ubuntu 16.04  with python 2.7
can I have examples of adding custom library to .buildozer/......./recepies

Saradhadevi Elaiyaraja

unread,
May 31, 2019, 6:49:15 AM5/31/19
to Kivy users support
Manoj, I am also having the same issue. Did you get any idea?

Robert Flatt

unread,
Jun 1, 2019, 5:12:11 PM6/1/19
to Kivy users support
Appears to work for me , my test case dumps audiostream symbols to the screen:

from kivy.app import App
from kivy.uix.label import Label
from kivy.graphics import Color, Rectangle
from kivy.core.window import Window
import audiostream as sd

class Demo(App):
   
def set_background_color(self):
       
with self.label.canvas.before:
           
Color(0.5, 0.0, 0.5)
           
Rectangle(size=Window.size)
       
   
def _resize_handler(self,obj,size):
       
self.set_background_color()

   
def on_start(self):
        symbols
= ''
       
for m in dir(sd):
            symbols
+= m + '\n'
       
self.label.text = symbols

   
def build(self):
       
Window.bind(size=self._resize_handler)
       
self.label = Label(text = 'Greetings Earthlings')
       
self.set_background_color()
       
return self.label

if __name__ == '__main__':
   
Demo().run()

This is my .p4a  (Buildozer users this contains the same info as your .spec).
I do not know which options are critical, if you care about this you could change them one by one.

--dist_name=ex
--private .
--package=com.example.ex
--name Ex
--requirements=python3,kivy==master,audiostream
--arch=armeabi-v7a
--orientation sensor
--sdk_dir /home/bobf/androidtools/sdk
--ndk_dir /home/bobf/androidtools/android-ndk-r17c
--android_api 28
--ndk-api 21
--version 0.0.0


Reply all
Reply to author
Forward
0 new messages