Recent

Author Topic: [SOLVED] Graphics tired in Linux ?  (Read 12592 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 2196
    • StrumPract is the musicians best friend
[SOLVED] Graphics tired in Linux ?
« on: July 19, 2011, 07:52:37 pm »
Hello everybody.

I develop a free DJ mixing app for Linux, Windows and Mac.
(https://sites.google.com/site/fiensprototyping/home)

I use the same code for the 3 OS (with some modif of course).

In Windows and Mac, i have run the app for more than 3 days-nights non stop.

The graphics are still fluent, fast and perfect.  ::)

But in Linux OS (on my PC), after one or two hours playing, all graphics are slower, tired, lazy, timers respond slower,... %)

I do not have find any memory problems or leak (Heaptrc,)...

Is it a known problem in Linux ?

Many thanks.
« Last Edit: July 27, 2011, 06:12:53 pm by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 2196
    • StrumPract is the musicians best friend
Re: Graphics tired in Linux ?
« Reply #1 on: July 23, 2011, 04:42:59 pm »
Toc, toc, toc, is there anybody here ?  :-\
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

Leledumbo

  • Hero Member
  • *****
  • Posts: 8318
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Graphics tired in Linux ?
« Reply #2 on: July 23, 2011, 05:26:10 pm »
Could be anything. Try checking your system monitor / task manager / whatever you have (I'm using Kubuntu, and it's called system monitor here). What's your distro/desktop environment?

Fred vS

  • Hero Member
  • *****
  • Posts: 2196
    • StrumPract is the musicians best friend
Re: Graphics tired in Linux ?
« Reply #3 on: July 23, 2011, 09:42:00 pm »
@ Leledumbo

Thank you for your answer.
Im using Ubuntu 10.10, gnome, GTK2.

The Monitor System shows me 0 % of CPU and +- 10 megas memory used when nothing is playing.

When songs are playing, it use +- 40 % of CPU and +- 13 megas memory.

It append after +- one hour playing, the timers respond slower (a mix of 8 seconds become 20 seconds, buttons respond very slowly, ...)

I do not find how to correct it, in monitor system, nothing different... :'(
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 458
Re: Graphics tired in Linux ?
« Reply #4 on: July 24, 2011, 01:21:36 am »
Some tips:

1. Try to compile with Qt widgetset
2. maybe related to some resource leaking: http://bugs.freepascal.org/view.php?id=8595


Leledumbo

  • Hero Member
  • *****
  • Posts: 8318
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Graphics tired in Linux ?
« Reply #5 on: July 24, 2011, 12:47:41 pm »
Quote
It append after +- one hour playing, the timers respond slower (a mix of 8 seconds become 20 seconds, buttons respond very slowly, ...)
Hmm... I didn't try that long and indeed the CPU and memory usage is about the same as you post if the program runs around 10 minutes. What does the program do internally? i.e. when playing songs. Read/write some files? Also does it happen when the program just runs without playing anything for an hour? I believe the kernel/GUI backend would notice that a program isn't being used for a certain time and therefore decides to swap in the pages holding the program's code and data to disk, and use the memory for other processes. But this would only happen if the program isn't doing anything. One more thing, when it happens, how's the CPU and memory?

Blaazen

  • Hero Member
  • *****
  • Posts: 3034
  • POKE 54296,15
    • Eye-Candy Controls
Re: Graphics tired in Linux ?
« Reply #6 on: July 24, 2011, 05:33:15 pm »
Now I have here miximum in problematic state. Graphic is really slow. It became after 1, 2 or 3 hours (I was AFK).
It has now higher CPU load but this load doesn't come from miximum but from Xorg server (even if miximum is minimalized).
Top:
Code: [Select]
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                 
 1057 root      20   0  374m 150m  90m R   90  3.8 126:10.87 Xorg                                     
 2492 v1        20   0  337m  32m  16m S   10  0.8  45:41.91 miximum                                 
 2080 v1        20   0  858m 435m  29m S    9 11.0  12:43.96 opera                                   
 1796 v1         9 -11  285m  18m  16m S    4  0.5   8:14.87 pulseaudio                               
 2002 root      20   0 14360 3728 1632 S    2  0.1   0:46.14 powertop                                 
 2329 v1        20   0  359m  24m  12m R    1  0.6   1:29.50 operapluginwrap                         
 2602 v1        20   0  447m  33m  25m S    1  0.8   3:39.87 ksysguard                               
 1857 v1        20   0  429m  23m  16m S    1  0.6   0:10.62 konsole                                 
 1588 root      20   0 45168 1056  692 S    0  0.0   0:06.33 udisks-daemon                           
 1741 v1        20   0  793m  65m  35m S    0  1.6   1:04.59 plasma-desktop                           
 2604 v1        20   0  9304 1288  820 S    0  0.0   0:37.53 ksysguardd                               
 5986 root       5 -15     0    0    0 S    0  0.0   0:00.71 khidpd_045800a7   

EDIT: When miximum finished playing, graphic was still slow but there was no high CPU load from Xorg.
« Last Edit: July 25, 2011, 12:38:14 pm by Blaazen »
Lazarus 2.1.0 r64546 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Fred vS

  • Hero Member
  • *****
  • Posts: 2196
    • StrumPract is the musicians best friend
Re: Graphics tired in Linux ?
« Reply #7 on: July 26, 2011, 09:47:11 pm »
Thank you very much LuizAmérico  :P, Leledumbo  :P and Blaazen  :P

@ LuizAmérico

Quote
1. Try to compile with Qt widgetset

OK, i gonna try it... (and im afraid to install-compile Lazarus for Qt  :-X)

@ Leledumbo

Quote
What does the program do internally? i.e. when playing songs. Read/write some files?

In test mode i let the program do the auto mixes (click once on the Hand and let the program do the work). It do not write anything, only decode the mp3 on loading (for the wave form), playing the song, catching the level for VU and spectrum and drawing the current position on the wave form...
No effects are used, no recording, no BPM stretch, no scratching only playing the cue list...

Quote
Also does it happen when the program just runs without playing anything for an hour?

I do not know, i gonna test it...

Quote
One more thing, when it happens, how's the CPU and memory?

Not really different than when OK...

@ Mr Blaazen

Quote
Now I have here miximum in problematic state. Graphic is really slow. It became after 1, 2 or 3 hours (I was AFK).
It has now higher CPU load but this load doesn't come from miximum but from Xorg server (even if miximum is minimalized).

And what is the cure Doctor ?

@  LuizAmérico, Leledumbo and Blaazen : many, many thanks to spent your time for miXimum.  ;)
« Last Edit: July 26, 2011, 09:51:24 pm by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

Blaazen

  • Hero Member
  • *****
  • Posts: 3034
  • POKE 54296,15
    • Eye-Candy Controls
Re: Graphics tired in Linux ?
« Reply #8 on: July 26, 2011, 10:20:51 pm »
No idea.  :(
As I wrote, when miximum finished playing then it was slow too (and no CPU load from XOrg nor from miximum).
Maybe threads, timers.... Hard to say.
Lazarus 2.1.0 r64546 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

jl

  • Full Member
  • ***
  • Posts: 174
Re: Graphics tired in Linux ?
« Reply #9 on: July 27, 2011, 04:32:27 am »
No idea.  :(
As I wrote, when miximum finished playing then it was slow too (and no CPU load from XOrg nor from miximum).
Maybe threads, timers.... Hard to say.


How can he debug that?   :)

Fred vS

  • Hero Member
  • *****
  • Posts: 2196
    • StrumPract is the musicians best friend
Re: Graphics tired in Linux ?
« Reply #10 on: July 27, 2011, 06:12:22 pm »
Last night the Qt saves my live   :D

Iiiiiiiaaaaa, yaouuuw, now it is more than one night and one day non stop that miXimum is running perfectly, with same fluidity, graphics fast, audio rendering perfect.   ;D

Im totally converted to Qt, bye-bye GTK2 and welcome to my new hair (i loose all of it with GTK2).

Now some comments...

Splash screen:
For the splash-shaped form, with GTK2 the background must be black and the shape white. In Qt it is opposite.
Done.  ;)

Error in running:
Quote
EListError.with message "Duplicate ID: FFFFFFFFFFFFFF31"
It seems that Qt have some problems with allocating ID.
The cure is to place Application.ProcessMessages after each "big" procedure.
Done.  ;)

Loops:
In GTK2 if i want that the loop gives control to graphics:
Code: [Select]
Procedure loopGTK2();
begin
While  "something is true" do
begin
application.processmessage;   // give control to graphics
procedure_in_loop();
end;
end;

That do not work well in Qt, of course it release the control to graphics but the procedure inside the loop take to much time to finish.

That solve the problem for Qt:

Code: [Select]
procedure loopQt();
var
chx : shortint;
begin
chx := 0;
While  "something is true" do
begin
inc(chx);
if chx > 40 then begin
application.processmessage;   // to let control to graphics
chx := 0;
end;
procedure_in_loop();
end;
end;
Done.  ;)
 

Im very happy, i switch from Delphi to Lazarus because of the Linux version.
I was a little disappointed when i get that problem with graphics after one hour playing.
And, trust me, i have done all what i could do to find the problem in GTK2, i never find it.

Once again, thank to you great Lazarus-pros, Qt is the solution.

Many, many, many thanks  :P 

PS: I gonna try miXimum in all the ways to check if no more problems then, of course, i gonna give you the brand new, full functioned, no stop and full speed Qt version of miXimum..

PS: Well seen LuizAmérico   ;)
« Last Edit: July 27, 2011, 06:30:44 pm by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1251
Re: [SOLVED] Graphics tired in Linux ?
« Reply #11 on: August 07, 2011, 10:59:26 pm »
That's a slick looping app you've got there, nicely done :-)
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

avra

  • Hero Member
  • *****
  • Posts: 2141
    • Additional info
Re: [SOLVED] Graphics tired in Linux ?
« Reply #12 on: August 08, 2011, 09:54:37 am »
Code: [Select]
if chx > 40 then beginIt seams to me that you have tuned this for your specific configuration, but how do you know that it will be the same on much worse or much better hardware then yours? It most probably won't, and you will probably need some calibration in initialization if you want to keep this approach. It might be better to rethink if there is some other solution for this problem...
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018