drensin/Remixatron

Playback is very choppy

Closed this issue · 13 comments

Hi there! With Eternal Jukebox suffering from constant outages, I've been looking for an alternative. This looks promising since I was able to get it to actually work, yay! However, playback is very choppy. The song will constantly skip/stutter, especially during early playback. However, audio will also start to stutter if my MacBook Pro is doing anything more than light work.

Cheers - great work! 😄

hmm.. interesting.. Can you use the -save option to save off a long chuck -- say 3min and then play it? Is it choppy when you play the saved file?

Sorry for the delay here! The saved files sound just fine. The choppiness only occurs when playing in real-time.

Just wanted to let you know that choppy playback is still an issue when listening in real-time, even on the latest version. Definitely liking the additional info display, though!

Is there any way to debug this issue? I would love to help diagnose because I would use this every day if the performance was there.

As a side note, any plans for a simple frontend? For instance, a window with a drop zone for an audio file. Would be much more convenient than opening the terminal and typing the command, haha.

Can you take a look at the Activity Monitor on your Macbook during playback? How many CPUs (cores) is the app using? RAM? etc... I have a pretty old Macbook Air and it works smoothly, so I'm trying to figure this out.

Also, is there any difference if you pick a pretty short song (<3.5min) vs something longer (maybe >5min)? I'm wondering if I'm hitting a RAM issue because I keep so much state around.

I hear no difference when playing songs of any particular length. And playback never smooths out, no matter how long I let it play or how much RAM I have free (my test track is a two-minute long mp3). Activity Monitor doesn’t show anything particularly special - it’s using 6 threads and between 1-4% CPU. It does show Python as having a high energy impact - between 10-15. But in my experience that is typical of an app running in focus.

I’m on a 2016 15” MBP, fwiw. So it shouldn’t be a performance issue.

Honestly, I don't really know. Out of curiosity, how did you install the support libraries? Did you use pip, homebrew, anaconda, etc?

I installed them exactly as described in the readme, and they all ran successfully. I re-ran the commands just now for fun, here’s the output:

Sans:~ Jason$ pip install --upgrade pip
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages (18.1)
Sans:~ Jason$ pip install --user soundfile pygame pyparsing numpy
Requirement already satisfied: soundfile in /Library/Python/2.7/site-packages (0.10.2)
Requirement already satisfied: pygame in ./Library/Python/2.7/lib/python/site-packages (1.9.4)
Requirement already satisfied: pyparsing in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (2.0.1)
Requirement already satisfied: numpy in ./Library/Python/2.7/lib/python/site-packages (1.15.0)
Requirement already satisfied: cffi>=1.0 in /Library/Python/2.7/site-packages (from soundfile) (1.11.5)
Requirement already satisfied: pycparser in /Library/Python/2.7/site-packages (from cffi>=1.0->soundfile) (2.18)
Sans:~ Jason$ pip install --user librosa
Requirement already satisfied: librosa in ./Library/Python/2.7/lib/python/site-packages (0.6.2)
Requirement already satisfied: joblib>=0.12 in ./Library/Python/2.7/lib/python/site-packages (from librosa) (0.12.2)
Requirement already satisfied: numpy>=1.8.0 in ./Library/Python/2.7/lib/python/site-packages (from librosa) (1.15.0)
Requirement already satisfied: numba>=0.38.0 in ./Library/Python/2.7/lib/python/site-packages (from librosa) (0.39.0)
Requirement already satisfied: scipy>=0.14.0 in ./Library/Python/2.7/lib/python/site-packages (from librosa) (1.1.0)
Requirement already satisfied: scikit-learn!=0.19.0,>=0.14.0 in ./Library/Python/2.7/lib/python/site-packages (from librosa) (0.19.2)
Requirement already satisfied: decorator>=3.0.0 in ./Library/Python/2.7/lib/python/site-packages (from librosa) (4.3.0)
Requirement already satisfied: audioread>=2.0.0 in ./Library/Python/2.7/lib/python/site-packages (from librosa) (2.1.6)
Requirement already satisfied: six>=1.3 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from librosa) (1.4.1)
Requirement already satisfied: resampy>=0.2.0 in ./Library/Python/2.7/lib/python/site-packages (from librosa) (0.2.1)
Requirement already satisfied: funcsigs in ./Library/Python/2.7/lib/python/site-packages (from numba>=0.38.0->librosa) (1.0.2)
Requirement already satisfied: llvmlite>=0.24.0dev0 in ./Library/Python/2.7/lib/python/site-packages (from numba>=0.38.0->librosa) (0.24.0)
Requirement already satisfied: singledispatch in ./Library/Python/2.7/lib/python/site-packages (from numba>=0.38.0->librosa) (3.4.0.3)
Requirement already satisfied: enum34 in ./Library/Python/2.7/lib/python/site-packages (from numba>=0.38.0->librosa) (1.1.6)

(You're not missing anything, I pasted it to show that everything's installed properly, haha.)

Just saw that you pushed a few changes, though - I'll try them out and report back!

EDIT: No change for me with the new version, still just as choppy as before. Would it be helpful if I recorded a screencast of playback?

Decided to finally make a screen recording since the latest version is still super choppy. Maybe it will provide some insight, who knows.

https://streamable.com/cy1lt

Audio file used (zipped so I can upload it here):
10 Rude Buster.aiff.zip

I re-wrote the playback loop to be event-based, rather than timings-based. Please let me know if that helps. If so, feel free to close this bug.

My man!! Amazing work. Playback is seamless now. Closing issue!