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

Segment Fault #63

Open
wzpan opened this issue Apr 1, 2019 · 0 comments
Open

Segment Fault #63

wzpan opened this issue Apr 1, 2019 · 0 comments

Comments

@wzpan
Copy link

wzpan commented Apr 1, 2019

I've found #41 and #24 but none of them seem to be the same issue to mine.

I'm trying to write a wave plotting program kivy app.

In pure Python code it works as expected:

#import the pyplot and wavfile modules 

import matplotlib.pyplot as plot

from scipy.io import wavfile

 
# Read the wav file (mono)

signalData = wavfile.read('test.wav')

# Plot the signal read from wav file

fig, ax = plot.subplots()
ax.plot(signalData[1])

plot.show()

However as I was trying to adapt it into kivy app, I got the following segment fault error:

[INFO   ] [Logger      ] Record log in /Applications/Kivy3.app/Contents/Resources/.kivy/logs/kivy_19-04-01_69.txt
[INFO   ] [Kivy        ] v1.10.1
[INFO   ] [Python      ] v3.6.5 (default, Jun 18 2018, 16:36:13) 
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <gl>
[INFO   ] [GL          ] OpenGL version <b'2.1 ATI-2.0.36'>
[INFO   ] [GL          ] OpenGL vendor <b'ATI Technologies Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'AMD Radeon R9 M395 OpenGL Engine'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Start application main loop
Segmentation fault: 11

Here's the whole code:

import matplotlib
matplotlib.use('module://kivy.garden.matplotlib.backend_kivy')
import numpy as np
from scipy.io import wavfile
from kivy.app import App

from kivy.garden.matplotlib.backend_kivyagg import FigureCanvas
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.graphics import Color, Line, Rectangle

import matplotlib.pyplot as plot

signalData = wavfile.read('test.wav')

fig, ax = plot.subplots()
ax.plot(signalData[1])

canvas = fig.canvas

class MatplotlibTest(App):
    title = 'Matplotlib Test'

    def build(self):
        fl = BoxLayout(orientation="vertical")
        fl.add_widget(canvas)
        return fl

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

I will be grateful if you could give me a hand.

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

No branches or pull requests

1 participant