Find a problem on "multiplayer"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
40 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
Ok, i have test:

fredvs wrote
if length(uosPlayers) > 0 then
 for x := 0 to length(uosPlayers) -1 do
  begin
  uosPlayers[x].nofree := false;
  uos_stop(x);
  end;
This does not work if you keep a player created but never put into play.
Create a wait loop.

if length(uosPlayers) > 0 then
 for x := 0 to length(uosPlayers) -1 do
  if assigned(uosPlayers[x]) then
   uosPlayers[x].FreePlayer;   

With this I have not found any problems since it does the same thing + the case Play / Stop if Player ever put in play.

You can give me a little source to understand when it does not work?

Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
> You can give me a little source to understand when it does not work?

Using Strumpract without {$DEFINE mse} = FPC thread in define.inc ---> OK no memory leak when closing application and Drums still play ( = PlayNoFree).

But with {$DEFINE mse} = MSE thread in define.inc ---> NOT OK --> memory leak.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
Huuu, no, the last commits gives lot of memory leak with StrumPract now.

Sorry, but I have to re-check all.

Write you later.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
Hello Phoenix.

I am very sorry but now that I did test some other projects, I get also memory leak.

I did a regression to commit Dec 14, 2017  (where I was not able to find any memory leak).

I will deeply study all your changes and apply it one by one.

I think I did commit your change too fast.

But sure that I will use your change, but I need to explore it better.

Many thanks for your work.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
Hello,

fredvs wrote
Huuu, no, the last commits gives lot of memory leak with StrumPract now.
Of course, unfortunately you have entered an error
if length(uosPlayers) > 0 then
  for x := 0 to length(uosPlayers) -1 do
-  if assigned(uosPlayers[x]) then  <--------------- github shows you have removed this important line
   begin
   uosPlayers[x].nofree := false;
   uos_stop(x);


Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
In reply to this post by fredvs
Re-hello Phoenix.

OK, I did commit your changes till commit  6860127 "Change FreePlayer()"

With your commit c790aafuse "only FreePlayer()" I get memory leak.

I will study your changes to see what cause that problems.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
In reply to this post by Phoenix
>  if assigned(uosPlayers[x]) then  <--------------- github shows you have removed this important line

Ooops, of course it is a bug from me

Re-commited e64d88b with all your changes and test it ---> no memory leak now.

Sorry for the inconvenient and many thanks for your patience and eyes.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
This post was updated on .
In reply to this post by fredvs
In case you do not find the real reason for the problem using mse:

In Windows10 with the changes made to point "4f)" I did not have memory leaks.
But already that only for "mse" remained problems, this should solve everything (even if I do not know why).
Probably some difference between platforms.

procedure uos_Free();
var
x : integer;
nt : integer = 200;
begin

if length(uosPlayers) > 0 then
 for x := 0 to length(uosPlayers) -1 do
  if assigned(uosPlayers[x]) then
  begin
   {$IF DEFINED(mse)}
   uosPlayers[x].nofree := false;
   uos_stop(x);
   {$ENDIF}
   uosPlayers[x].FreePlayer;
  end;          
...

and in uos_CreatePlayer

this:
...
if (uosPlayers[PlayerIndex] <> nil) then
  begin
   uosPlayers[PlayerIndex].FreePlayer;
   Sleep(20);
...

now change:
...
if (uosPlayers[PlayerIndex] <> nil) then
  begin
   {$IF DEFINED(mse)}
   uosPlayers[PlayerIndex].nofree := false;
   uos_stop(PlayerIndex);
   {$ENDIF}
   uosPlayers[PlayerIndex].FreePlayer;
   Sleep(20);
...
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
In reply to this post by fredvs
Ok, we posted at the same time.

Perfect if everything goes now!!!
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
Yep thanks.

But I will study your last propositions about MSE threads and , sure, use it.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
fredvs wrote
But I will study your last propositions about MSE threads and , sure, use it.
I modified the previous post because I had copied [x] instead of [PlayerIndex]

Ok I hope it works even with all 4 points
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
Ok, super, many thanks.

Huh, by the way, did you try applications with MSEgui widget-set on Windows 10?

Is it working ok ?

For developing there is, of course, MSEide, the official IDE included with MSEide-MSEgui package.

There is also ideU, the son of MSEide, with some more features.

https://github.com/fredvs/ideU/releases

Fre;D

Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
Hello,

fredvs wrote
Huh, by the way, did you try applications with MSEgui widget-set on Windows 10?
Is it working ok ?
I have no experience with MSEIde, I've only tried Strumpract and it seems to work ok (but I've tested it a little).
I used Delphi but with Lazarus I feel good. MSIde I found it a bit complicated in the configuration (but it seemed more reactive than Lazarus). Regarding the libraries and GUI I can not give an evaluation without programming something. The interface is not suitable for monitors with high resolutions (everything is very tiny in Windows10). So I prefer to use Lazarus.


fredvs wrote
There is also ideU, the son of MSEide, with some more features.
Thanks for the information!


In any case, thanks also for this your work!!
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
Hello,

fredvs wrote
Huh, by the way, did you try applications with MSEgui widget-set on Windows 10?
Is it working ok ?
As anticipated, the tests are not complete but I tried.

I tested these projects:

consolebpmdetect.prj (ok)
consoleplay.prj (ok)
consoleplayloop.prj (ok)
consoleplaymemorybuffer.prj (ok)
consoleplaymemorystream.prj (ok)
consolesynth.prj (ok)

conswebstream (not play = lazarus)

SimplePlayer_MSE.prj (not find msegui but with strumpract yes ??)

*_fpGUI (??)

NOTE: my mouse cursor is almost bigger than the mseide menu file

I hope some information can be useful


Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
> NOTE: my mouse cursor is almost bigger than the mseide menu file

Huh, yes, mseIde has a lilliputian design...

> *_fpGUI (??)

There are also uos projects that use fpGUI widgetset.
https://github.com/graemeg/fpgui/tree/maint

Did you try to load the *_fpGUI.prj with ideU ?
https://github.com/fredvs/ideU/releases

Because ideU is fpGUI compatible too.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
Hello,

SimplePlayer_MSE.prj (ok)

For fpGui I tried to set everything for Windows but:
... fpGUI-maint\src\corelib\x11\fpg_impl.pas(26,3) Fatal: (10022) Can't find unit x used by fpg_impl
Fatal: (1018) Compilation aborted
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
> For fpGui I tried to set everything for Windows but:

In project option, set Make - Directory : ---> directory gdi  for windows

See image included.

fpgui_windows.png

With ideU, "FPGUIDIR" macro is defined in source.

With MSEide you need to create a macro "FPGUIDIR" (with menu "Settings" + "Macro") that point to fpGUI root directory.

FreD




Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
Hello,
Thanks for the configuration.
Sorry for the delay.
Here are the results:

deviceinfos_fpGUI (ok)
simpleplayer_fpGUI (ok)
filterplayer_fpGUI (ok)
librarytester_fpGUI (ok)
morseTL_fpGUI (ok)
multiplayer_fpGUI (ok)
noiseremover_fpGUI (ok)
simpledrums_fpGUI (! it does not work properly while lazarus project ok)
simpledrums_fpGUI (ok)
simplerecorder_fpGUI (! does not record on file = for lazarus project)
simplewebplayer_fpGUI (ok)
simplewebserver_fpGUI (error in the code so it does not build)
waveform_fpGUI (ok)
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

fredvs
Administrator
> simplerecorder_fpGUI (! does not record on file = for lazarus project)

Huh, you did see that bug just after I I fixed it !

Yes, indeed there was a bug in previous releases.

It must be fixed in last commit ec059cd.

> simplewebserver_fpGUI (error in the code so it does not build)

Yes, it is possible, I have to re-check. But uos_webserver is still in development yet, so the demo is not safe.

Thanks to test all this.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Find a problem on "multiplayer"

Phoenix
Ok thanks, I just tried simplerecorder (Lazarus) it works !!
12