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

Glitch with long TCO's #3378

Open
zonkmachine opened this issue Feb 22, 2017 · 19 comments
Open

Glitch with long TCO's #3378

zonkmachine opened this issue Feb 22, 2017 · 19 comments

Comments

@zonkmachine
Copy link
Member

zonkmachine commented Feb 22, 2017

longfileending

The end of the SampleTCOView of long Sample Tracks sometimes gets distorted.
I've only seen this occasionally with really long samples, 30+ minutes, so far.

@zonkmachine
Copy link
Member Author

5minogg

3.5 minute into a 5 minute .ogg sample

@BaraMGB
Copy link
Contributor

BaraMGB commented Feb 22, 2017

Have you noticed this only in ogg files?

@zonkmachine
Copy link
Member Author

Have you noticed this only in ogg files?

It's in wav files too. Found the commit.

@Umcaruje

commit f136ba3097d45b8651e45b494f8af5a6d606cd59
Author: Umcaruje <uros.maravic@gmail.com>
Date:   Tue Feb 16 01:01:43 2016 +0100

    Refactor the drawing of TCO's; Get rid of hardcoded colors in TCOs; Make TCO gradient configurable; Even out the color scheme
    Thanks to @Fastigium for helping with the BB Pattern redraw problem

@Umcaruje
Copy link
Member

Huh, looks like something is not getting initialised. You can get these glitches on all patterns if you remove the style.css. I'll look into this.

@Umcaruje
Copy link
Member

I'm sorry, I can't reproduce this. I loaded a 30 minute ogg and it seems to render fine 😕

@zonkmachine
Copy link
Member Author

Sometimes you need to also zoom in to trigger this.

@Umcaruje
Copy link
Member

@zonkmachine could you zip up a file that does this?

@Umcaruje
Copy link
Member

Also are you on Qt4 or Qt5?

@zonkmachine
Copy link
Member Author

Qt4, Linux Mint 17.3 with cheap AMD cpu and no dedicated graphic card.

@zonkmachine
Copy link
Member Author

@zonkmachine could you zip up a file that does this?

Aight!
sampleend.zip
This one is buggy on 1600% zoom from bar 129.

@zonkmachine
Copy link
Member Author

zonkmachine commented Feb 22, 2017

If I scroll the tempo the glitch is affected.

@Umcaruje
Copy link
Member

Ok I can reproduce now, thanks.

@Umcaruje
Copy link
Member

This is not a problem with sample TCO's, but with all TCO's:
screenshot from 2017-02-23 21 34 06

The reason this was introduced with my commit is because I switched all TCO's to draw to a m_paintPixmap to not have excessive redrawing, and to keep consistency with all other TCO's.
image
As you see the problem exists in 1.1.3 with patterns using this method.

Investigation ahead...

@Umcaruje
Copy link
Member

Seems like a QPixmap can't be more than 32767 x 32767px in size...

@musikBear
Copy link

This could have bearings to #746
If 30 mins is a maximum, then 746 could force a mandatory split of a block when it is 29 mins long.

@zonkmachine zonkmachine changed the title SampleTCOView - Glitch with long samples Glitch with long TCO's Jul 13, 2019
@PhysSong
Copy link
Member

Seems like a QPixmap can't be more than 32767 x 32767px in size...

Can we use multiple QPixmap instances for long TCOs? If it's possible, we can be free from the pixel limit.

@zonkmachine
Copy link
Member Author

Or borrow space from the vertical part of the pixmap. Just continue writing the pixmap but roll back to 0, let it grow in size vertically and continue writing/reading.

@Spekular
Copy link
Member

Spekular commented Sep 19, 2019 via email

@michaelgregorius
Copy link
Contributor

The current implementation seems to be quite inefficient with regards to memory performance. I have added some debug code to the implementation of resizeEvent in Track.h. The added code simply captures the new size of the widget.

If I open the project contained in the file sampleend.zip (see original attachment above), extend the height of the sample track to a nice height for my screen and zoom in to 1600% then the size of the widget (and the associated QPixmap) becomes 40871x103 = 4209713 pixels. Assuming four bytes per pixel (RGBA) the associated pixmap uses around 16 MB for only one track. And most of it is not even visible on the screen. If a project has several long tracks then this becomes quite wasteful.

A potential fix might be to make the tracks aware of the zoom level and the area that needs a redraw and to only redraw that area on the fly without any caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants