LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.02k stars 998 forks source link

OS X UI hangs during playback #2504

Closed sunnystormy closed 8 years ago

sunnystormy commented 8 years ago

When playing back audio tracks in the Max OS X 1.1.3 version the UI suddenly stops updating within a few seconds. Audio will continue to play, and the buttons on the screen still work, but the time-elapsed labels, mixer, and song editor stop animating/updating properly. I'm wondering if this is a memory allocation and/or threading issue?

I'm running a Mac Mini (Late 2014) with a 1.4 GHz dual-core processor with El Capitan (10.11.2).

Thank you for your help!

tresf commented 8 years ago

This sounds vaguely similar to a theming issue we used to have with upgraded versions, but not identical since you report this starts after a few seconds of playback.

Does this eventually recover, or just keep having refresh issues?

I've tested on Lion, Mountain Lion, Mavericks, Yosemite without this issue, so it may be new with El Capitan, which I haven't performed any testing on yet. @rhunter @follower @jaehyunmicro @eagles051387 are you on El Capitan? If so, can you reproduce?

sunnystormy commented 8 years ago

@tresf It happens whenever multiple tracks are within scope of the scroller as it's moving inside of the song editor during playback. Both the song-editor, the time-elapsed labels, and the mixer stop animating properly. As the song finishes, the animation returns to normal.

I tested this with "Tectonic", which finishes with only one track playing, and the animation returned to normal speed as the song completed. It's during the middle of playing, when there are multiple tracks with notes in them at the same time, that the animation begins to grind to a halt.

I should also add, that when selecting virtual instruments inside of the instrument plugins pane, the animation bubbles for each instrument animate slowly as well. Perhaps this is related?

EDIT: It may depend on the song being played as well. I played Zakarra's "Mainstream Melody" and the hanging issue didn't recover after the end of the composition.

follower commented 8 years ago

Alas, I'm not on El Cap, so am no help. :)

sunnystormy commented 8 years ago

@tresf Is there a way you could show me how to compile the source code on Max OS X so I can test the application with the Master branch's source? If this issue hasn't already been fixed, I'll happily take on the task of fixing it myself.

Umcaruje commented 8 years ago

@sunnystormy Here's an extensive guide on building lmms on OS X: https://github.com/LMMS/lmms/wiki/Compiling-lmms-(Apple)

Hope that helps.

sunnystormy commented 8 years ago

@tresf I've just tested the 1.1.3 version of the application on another laptop with OS X Yosemite prior to upgrading it to El Capitan. Yosemite had no issues, so I've confirmed that the problem isn't hardware-related, and is exclusive to the latest version of OS X.

Is there a way that this could be marked as a bug? Or should I take care of that myself?

tresf commented 8 years ago

@sunnystormy done although it doesn't necessarily make a difference as to if it will be worked on or not. Most of our devs don't have Mac environments. Furthermore, there's little evidence to suggest this is a LMMS bug... It could equally be a bug combo with QT4 + Cocoa (prob worth a try with QT5 soon).

But we'll leave this open until we know more. :+1:

sunnystormy commented 8 years ago

@tresf You make a valid point, it could very well be an issue with its dependencies. Thank you for your help!

sunnystormy commented 8 years ago

@Umcaruje @tresf

I've tried compiling from source but keep getting issues:

CMake Error at /opt/local/share/cmake-3.4/Modules/FindQt4.cmake:1324 (message): Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x Call Stack (most recent call first): CMakeLists.txt:160 (FIND_PACKAGE)

I've got the "qt4-mac" package installed via Macports, so this is confusing. Any help would be appreciated! ^_^

tresf commented 8 years ago

@sunnystormy Homebrew or Macports?

sunnystormy commented 8 years ago

@tresf

Macports

tresf commented 8 years ago

Does it recognize the command qmake? It sounds a bit fishy that it won't find qt4. Also, did you install each package by hand via Compiling-lmms-(Apple)#macports or did you use the sudo port install lmms command? I ask because sometimes pkgconfig missing can cause strange issues.

We haven't used MacPorts in a while now and my MacPorts machine is out of reach at the moment. I know Homebrew logic is in good shape. Do you use MacPorts already or was it just your first choice?

sunnystormy commented 8 years ago

@tresf No, it doesn't recognize the command "qmake". I installed each package individually, and not by using the "lmms" command. I used Macports simply because it was the one I was the most familiar with. I'm wondering if I need to install the "qt4-creator-mac" package as well?

I'm open-minded to trying other things too, if you have other suggestions.

tresf commented 8 years ago

qt4-creator-mac won't be needed. It sounds like MacPorts hasn't been added to your environment variables/path. Can you confirm that you can install something else with MacPorts and that it is reachable via command line?

sunnystormy commented 8 years ago

@tresf I'm able to use "npm" to install packages, so if this applies, then, yes.

sunnystormy commented 8 years ago

@tresf Tried installing with Homebrew instead and get the following when trying the shell script:

fltk: This formula either does not compile or function as expected on OS X
versions newer than Yosemite due to an upstream incompatibility.

What do I do?

tresf commented 8 years ago

You can turn off fltk (disables Zyn) via WANT_FLTK in CMakeLists.txt. You could try compiling from source too, but probably overkill.

sunnystormy commented 8 years ago

@tresf But without ZynAddSubFX... that limits a lot of music-composition options. :(

I kind of feel like I'd want to have that around.

I'll compile from source just to make sure that this issue is resolved. I guess making sure all of the dependencies are updated will have to follow.

UPDATE:

Now it's not finding "libsndfile" when trying to compile, even though Homebrew says it's installed:

CMake Error at CMakeLists.txt:178 (MESSAGE):
  LMMS requires libsndfile1 and libsndfile1-dev >= 1.0.11 - please install,
  remove CMakeCache.txt and try again!
tresf commented 8 years ago

without ZynAddSubFX... that limits a lot of music-composition options. :( I kind of feel like I'd want to have that around.

In the context of the bug report "OS X UI hangs during playback", it's irrelevant, which is the only reason I proposed it.

Now it's not finding "libsndfile" when trying to compile, even though Homebrew says it's installed:

I'm not sure how or why you are having so many problems with compilation. I have a El Capitan box I can test the build process out on, but it would be several weeks before I'd be able to fire it up and check our tutorial against it. I build all of the DMGs against Lion because I can't figure out how to get modern builds to run on older OS X releases.

We have a few other Mac developers on here that may be able to help or may have encountered your issues.... @rhunter, @rageboge and probably a few others.

sunnystormy commented 8 years ago

@tresf Cool, man! Wasn't trying to knock you or anything with my ZynAddSubFx comment, I just really love the different plugins available and appreciate the amount of effort you guys have made. : )

I'll take a back seat at this point and see if anybody else has anything to add. Thanks again for all of your help!

tresf commented 8 years ago

@sunnystormy Just to give you some more troubleshooting information...

We have a build fire on OS X each time a code submission comes in which is run by Travis-CI.

The build process is as follows:

  1. https://github.com/LMMS/lmms/blob/master/.travis/osx..install.sh
  2. https://github.com/LMMS/lmms/blob/master/.travis/osx..script.sh

To see what the output of one of these commands looks like:

I believe this build is being fired on Mavericks, but I'm having a hard time confirming this so if your issue is related to the OS X version, getting another dev to try out the build process is the fastest way to get this going. :+1: Unfortunately, we have very few Mac devs.

mauicoder commented 8 years ago

I'm on El Capitan 10.11.3 and the build is working fine for me. I had a problem with qt4-mac, as reported in macports ticket they removed the link to the qmake in favor of a qt_chooser port that is not yet officially available, so I had to create 2 links manually (I have only qt4, no need to dynamically select the qt version).

sudo ln -s /opt/local/libexec/qt4/bin/qmake /opt/local/bin/qmake   
sudo ln -s /opt/local/libexec/qt4/bin/lrelease /opt/local/bin/lrelease

I also had to create a new build folder from scratch, but you shouldn't have the same issue if it is the first time you build it. My ports are up-to-date.

tresf commented 8 years ago

@sunnystormy

Silly question, but did you properly install the XCode command line tools via sudo xcode-select --install? There can be some very strange errors if they're not installed and these are listed as prerequisites in the install instructions.

I'm running Brew + El Capitan right now. It'll take a day or so, I'll report my progress. :beer:

tresf commented 8 years ago

@sunnystormy

Ok, I'm running into build issues too, and they appear to be related to upgrading my OS from Yosemite to El Capitan without reinstalling XCode. Edit: Added to wiki. Perhaps that helps... Continuing. :+1:

sunnystormy commented 8 years ago

@tresf Just so you know, I didn't install Xcode on my device until after I upgraded the OS. I also have the command-line tools installed. Hope that helps.

tresf commented 8 years ago

@tresf Just so you know, I didn't install Xcode on my device until after I upgraded the OS. I also have the command-line tools installed. Hope that helps.

Yes it does. I've added the hint to our tutorial anyways because it just snagged me. My El Capitan environment won't download XCode, so I'm troubleshooting that still. :wine_glass:

tresf commented 8 years ago

@sunnystormy After reinstalling XCode (I chose 7.3 beta for this particular machine) the build is starting...

image

If you'd like I can upload the build for you to try out to see if it resolves the refresh issues you are encountering.

sunnystormy commented 8 years ago

@tresf That sounds great! I will happily download it when you're ready. :+1:

tresf commented 8 years ago

Well, it runs fine, but the DMG ended up being 500MB compressed so something is horribly wrong with my packaging process.

I'll work on it some more and upload a release when ready.

FYI, I'm building our master branch currently. I can supply 1.1.3-stable instead if you'd like although my intentions originally were to vet out the build process, which I can confirm is working fine on El Capitan (although I'll have to double check on the packaging process now).

Also, unrelated, but make dmg needs to depend on make install, so that's another fix needed.
Edit: Correction, cmake doesn't support built-in targets in the ADD_DEPENDENCIES(..., ...) command, so we'll have to continue using make install; make dmg on apple until this functionality changes.

tresf commented 8 years ago

Ok, it took completely uninstalling Homebrew, but I've reproduced the fltk issue.... Will post updates/update wiki as I get them...

🍺  /usr/local/Cellar/portaudio/19.20140130: 30 files, 448.7K
fltk: This formula either does not compile or function as expected on OS X
versions newer than Yosemite due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.
tresf commented 8 years ago

@sunnystormy I've added instructions for circumventing the fltk installation problem and added them to the build wiki. I'll continue and report back my findings.

tresf commented 8 years ago

@sunnystormy I've documented the remaining steps in the tutorial. It appears in addition to the fltk upstream bug, the packages cmake and pkgconfig were missing from the travis script. Closing, marking as resolved (or not-our-bug technically, since we can't control compat between qt/osx).

@Lukas-W do you have any objections to adding these deps ( cmake and pkgconfig) to the travis script? (node too actually, as well as sudo npm install appdmg). Also, do you have any objections to changing brew install to brew reinstall so that these OS X upgrades don't keep botching people's dev environments?

I understand cmake and pkgconfig probably aren't needed on Travis (I assume they're already installed) but it helps put our deps in a centralized location and simplifies our wiki. Feedback appreciated. :beers:

tresf commented 8 years ago

Oh, and the DMG I promised here: lmms-1.1.90-mac10.11.dmg. Again, this is master branch (bleeding edge, "unstable"). If you're looking for a stable-1.1 release, we can provide that from El Capitan too (would only take about 20 minutes now that the build env is fixed.)

lukas-w commented 8 years ago

do you have any objections

Nope

tresf commented 8 years ago

Nope

Thanks. Fired the changes via #2595.

sunnystormy commented 8 years ago

@tresf Downloaded your build and the issue still exists. :( I'll try building this on my own sometime later to see if a local build helps fix the problem.

EDIT: After building, the issue still persists. @tresf Could you please upload a build of one of the stable versions for testing? Thank you.

tresf commented 8 years ago

@tresf Could you please upload a build of one of the stable versions for testing? Thank you.

Unfortunately, if it doesn't work with master, it won't work with stable-1.1.3 either. @Furthermore, I can't reproduce the problem in my El Capitan VM. I do have a physical machine I can upgrade to test this redrawing bug out. I'll start the El Capitan upgrade process right now on a physical machine to see if I can reproduce this.

tresf commented 8 years ago

@sunnystormy, I just upgraded my physical box to OS X 10.11 "El Capitan" as well and did a fresh install of lmms-1.1.3-mac10.7.dmg from our downloads page. I still cannot reproduce. Here are my test results:

https://youtu.be/Dkw1iUwuYow

sunnystormy commented 8 years ago

@tresf Hmm... Well, I had this error occur on both my Mac Mini and Macbook Pro laptop with El Captian installed (with the latest updates). I just downloaded the dmg from the main page and the issue is still occurring. I don't know what screen-capture technology exists, but perhaps seeing is believing?

tresf commented 8 years ago

I used QuickTime for screen capture.

tresf commented 8 years ago

Also, do either/both machines have any 3rd party components from QT installed globally? Perhaps MacPorts/homebrew conflict, etc? There a command on Mac to show the DYLIBs in use, but I'll have to look it up.

sunnystormy commented 8 years ago

@tresf This problem was occurring prior to installing anything related to that. Also, I've created the quicktime screen-capture to demonstrate the issue. How would you like me to send it to you? It's ~60MB in size.

tresf commented 8 years ago

Google drive, drop box, YouTube, whatever. :+1:

sunnystormy commented 8 years ago

@tresf Dropbox link to video is: https://www.dropbox.com/s/ms7i9dnfssau3ck/LMMS_2504.mov?dl=0

tresf commented 8 years ago

Does the same thing happen if you are composing a new track? That looks like the software is working ok at first, but running very, very slow as it gets deeper into the track.

sunnystormy commented 8 years ago

@tresf Yes. But only when there are multiple tracks playing at the same time on the song editor. Keep in mind that the audio plays just fine, it's only the UI that begins to stutter and stop.

tresf commented 8 years ago

@sunnystormy I can confirm this track performs equally as bad on my machine. Looking at the CPU, it spikes from 25% - 50% depending. Some tracks play OK, but once the CPU goes over 25% the GUI doesn't refresh very well. Sometimes the EQ hangs for seconds at a time.

Is this a bug? Probably. Is it new to El Capitan? I don't know, we'd have to do some much more specific benchmarks on physical hardware with various OS X versions to know for sure.

Here are some conversations on how we don't utilize CPU very efficiently... #2295 #1916 https://github.com/LMMS/lmms/issues/1600#issuecomment-69782663 https://github.com/LMMS/lmms/issues/643#issuecomment-41467413

If you know a thing or two about debugging, we'd be happy to get some benchmarks on where/why our resources are out of control on OS X. :+1:

sunnystormy commented 8 years ago

@tresf Should this ticket remain closed, then? Or should we simply defer it to other tickets, like the ones you mentioned?

tresf commented 8 years ago

:beer:

eagles051387 commented 8 years ago

Probably a stupid question here, but has anyone tried to open the code base in xcode and run it through the profiler that is part of xcode? Reason I am asking is that I think it would be useful as well to allow it as an IDE to provide code hints as well that could help us pinpoint issues for mac users.

I will submit another ticket about creating an xcode project for mac developers.

This email has been sent from a virus-free computer protected by Avast. www.avast.com https://www.avast.com/sig-email <#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Jonathan Aquilina

On Sun, Feb 21, 2016 at 3:02 AM, sunnystormy notifications@github.com wrote:

@tresf https://github.com/tresf Should this ticket remain closed, then? Or should we simply defer it to other tickets, like the ones you mentioned?

— Reply to this email directly or view it on GitHub https://github.com/LMMS/lmms/issues/2504#issuecomment-186719531.