When using pyglet.media to play a playlist of music MP3s on a Raspberry Pi 3B, memory usage continually increases until system starts thrashing
OS: Raspbian 10
Python: 3.7.3
Pyglet: 1.5.7
FFMPEG: 4.1.6-1~deb10u1+rpt2
The following code reproduces the error. It reads a list of MP3's from a directory of about 30 files each about 2-3 minutes long. The program initially consumes 420MB, but grows to 1.98GB by the time the system becomes unresponsive
The following code was used to reproduce the issue consistently
import pyglet
import os
path = '/path/to/directory/containing/mp3s'
pool = []
for root, dirs, files in os.walk(path, followlinks = True) :
for name in files :
pool.append(os.path.join(root, name))
player = pyglet.media.Player()
def queue_next() :
s = pool.pop(0)
print("Queueing: %s" % (s))
player.queue(pyglet.media.load(s))
pool.append(s) #put the item back on the end of the playlist so we never run out of songs to play
def on_eos() :
player.next_source()
queue_next()
player.on_eos = on_eos
queue_next()
queue_next()
player.play()
window = pyglet.window.Window(100,100,)
pyglet.app.run()
When using pyglet.media to play a playlist of music MP3s on a Raspberry Pi 3B, memory usage continually increases until system starts thrashing
OS: Raspbian 10
Python: 3.7.3
Pyglet: 1.5.7
FFMPEG: 4.1.6-1~deb10u1+rpt2
The following code reproduces the error. It reads a list of MP3's from a directory of about 30 files each about 2-3 minutes long. The program initially consumes 420MB, but grows to 1.98GB by the time the system becomes unresponsive
The following code was used to reproduce the issue consistently