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

audio_sdl2: Update for mixer v2.0.2 support #5459

Merged
merged 1 commit into from Nov 1, 2017
Merged

audio_sdl2: Update for mixer v2.0.2 support #5459

merged 1 commit into from Nov 1, 2017

Conversation

ghost
Copy link

@ghost ghost commented Oct 29, 2017

Quick fix for #5457. The MIX_INIT_* flags no longer represent specific libraries, but instead "abstract format types" see here. It appears like the proper way to query for the exact library support is has_music, but that raises many questions.

This should in theory work with old and new versions, but I looked very quickly at the upstream changes... there could be other problems left to fix

Flags MIX_INIT_MODPLUG was removed, and MIX_INIT_FLUIDSYNTH was
renamed to MIX_INIT_MID.
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue regarding the sdl2 error ^_^

This was tested on:

OS X: 10.13
Python: 3.6
Xcode: 9.1
Brew installation of sdl packages

@KeyWeeUsr KeyWeeUsr merged commit d8ef8c2 into kivy:master Nov 1, 2017
@KeyWeeUsr
Copy link
Contributor

Thanks!

@ghost
Copy link
Author

ghost commented Nov 4, 2017

Can you please suggest what needs to be done in order to install "kivy"? I get the following error when I run "pip install kivy".

/private/var/folders/1v/fsz767yj41q7hx2pd6kmzpfr0000gn/T/pip-build-Gtlg9Q/kivy/kivy/core/audio/audio_sdl2.c:1742:63: error: use of undeclared identifier 'MIX_INIT_MODPLUG'; did you mean 'MIX_INIT_MOD'?
__pyx_v_want_flags = (__pyx_v_want_flags | ((MIX_INIT_MOD | MIX_INIT_MODPLUG) | MIX_INIT_FLUIDSYNTH));
^~~~~~~~~~~~~~~~
MIX_INIT_MOD
/usr/local/include/SDL2/SDL_mixer.h:80:5: note: 'MIX_INIT_MOD' declared here
MIX_INIT_MOD = 0x00000002,
^
/private/var/folders/1v/fsz767yj41q7hx2pd6kmzpfr0000gn/T/pip-build-Gtlg9Q/kivy/kivy/core/audio/audio_sdl2.c:1742:83: error: use of undeclared identifier 'MIX_INIT_FLUIDSYNTH'
__pyx_v_want_flags = (__pyx_v_want_flags | ((MIX_INIT_MOD | MIX_INIT_MODPLUG) | MIX_INIT_FLUIDSYNTH));
^
/private/var/folders/1v/fsz767yj41q7hx2pd6kmzpfr0000gn/T/pip-build-Gtlg9Q/kivy/kivy/core/audio/audio_sdl2.c:5262:69: error: use of undeclared identifier 'MIX_INIT_MODPLUG'; did you mean 'MIX_INIT_MOD'?
__pyx_t_2 = ((__pyx_v_4kivy_4core_5audio_10audio_sdl2_mix_flags & MIX_INIT_MODPLUG) != 0);
^~~~~~~~~~~~~~~~
MIX_INIT_MOD
/usr/local/include/SDL2/SDL_mixer.h:80:5: note: 'MIX_INIT_MOD' declared here
MIX_INIT_MOD = 0x00000002,
^
3 errors generated.
error: command 'gcc' failed with exit status 1

@ghost
Copy link

ghost commented Nov 4, 2017

@sp- Please use the development version of kivy which indicated on the kivy website MacOS installation.

pip install http://github.com/kivy/kivy/archive/master.zip

@jdsayle
Copy link

jdsayle commented Nov 21, 2017

@lfasmpao Big thanks!

Wasn't able to install (last installation step) using 'pip install kivy' form within my virtualenv. 'pip install http://github.com/kivy/kivy/archive/master.zip' worked for me as well.

System specs:

  • OSX: 10.13.1
  • Python: 3.6.2
  • Xcode: command-line tools (v. 9.1.0.0.1.1508540944)
  • Kivy: latest Dev build as of the writing of this post
  • Kivy installation method: brew + pip

@AndreMiras
Copy link
Member

I confirm it fixes it also on Ubuntu 18.04. See log extract below:

pip install Kivy==1.10.0
...
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/pip-install-m41uwbhb/Kivy/kivy/include -I/usr/local/include/SDL2 -I/usr/include/SDL2 -I/usr/include/SDL2 -I/usr/include/python3.6m -I/home/
andre/workspace/EtherollApp/venv/include/python3.6m -c /tmp/pip-install-m41uwbhb/Kivy/kivy/core/audio/audio_sdl2.c -o build/temp.linux-x86_64-3.6/tmp/pip-install-m41uwbhb/Kivy/kivy/core/audio/audio_sdl2.o
    /tmp/pip-install-m41uwbhb/Kivy/kivy/core/audio/audio_sdl2.c: In function ‘__pyx_f_4kivy_4core_5audio_10audio_sdl2_mix_init’:
    /tmp/pip-install-m41uwbhb/Kivy/kivy/core/audio/audio_sdl2.c:1722:63: error: ‘MIX_INIT_MODPLUG’ undeclared (first use in this function); did you mean ‘MIX_INIT_MOD’?
       __pyx_v_want_flags = (__pyx_v_want_flags | ((MIX_INIT_MOD | MIX_INIT_MODPLUG) | MIX_INIT_FLUIDSYNTH));
                                                                   ^~~~~~~~~~~~~~~~
                                                                   MIX_INIT_MOD
    /tmp/pip-install-m41uwbhb/Kivy/kivy/core/audio/audio_sdl2.c:1722:63: note: each undeclared identifier is reported only once for each function it appears in
    /tmp/pip-install-m41uwbhb/Kivy/kivy/core/audio/audio_sdl2.c:1722:83: error: ‘MIX_INIT_FLUIDSYNTH’ undeclared (first use in this function); did you mean ‘MIX_INIT_MID’?
       __pyx_v_want_flags = (__pyx_v_want_flags | ((MIX_INIT_MOD | MIX_INIT_MODPLUG) | MIX_INIT_FLUIDSYNTH));
                                                                                       ^~~~~~~~~~~~~~~~~~~
                                                                                       MIX_INIT_MID
    /tmp/pip-install-m41uwbhb/Kivy/kivy/core/audio/audio_sdl2.c: In function ‘__pyx_pf_4kivy_4core_5audio_10audio_sdl2_9MusicSDL2_extensions’:
    /tmp/pip-install-m41uwbhb/Kivy/kivy/core/audio/audio_sdl2.c:5242:69: error: ‘MIX_INIT_MODPLUG’ undeclared (first use in this function); did you mean ‘MIX_INIT_MOD’?
       __pyx_t_2 = ((__pyx_v_4kivy_4core_5audio_10audio_sdl2_mix_flags & MIX_INIT_MODPLUG) != 0);
                                                                         ^~~~~~~~~~~~~~~~
                                                                         MIX_INIT_MOD
     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/home/andre/workspace/EtherollApp/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-m41uwbhb/Kivy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n
', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-p6ma30ui/install-record.txt --single-version-externally-managed --compile --install-headers /home/andre/workspace/EtherollApp/
venv/include/site/python3.6/Kivy" failed with error code 1 in /tmp/pip-install-m41uwbhb/Kivy/
Makefile:14: recipe for target 'virtualenv' failed
make: *** [virtualenv] Error 1

Installing from that commit hash fixed it:

pip install 'https://github.com/kivy/kivy/archive/d8ef8c2834293098bc404c0432049b2761f9b721.zip#egg=kivy

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.

None yet

3 participants