English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 06 December 2022, 01:22   #1
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Problem Calling ARexx Command

Hi there!

So I have this code to control various music players via ARexx This code has been working great with dozen of players until I tried it with PlayOGG...

For some reason, with PlayOGG, it blocks on WaitPort(reply_port);, which never returns, and I don't know why! (Doing the same thing using rx works fine.) (I just removed some error-related lines and comments...)

Code:
	if(!(reply_port = CreateMsgPort()))
	{
		...
	}

	if(!(rexx_msg = CreateRexxMsg(reply_port, NULL, NULL)))
	{
		...
	}
	rexx_msg->rm_Args[0] = command_temp;
	rexx_msg->rm_Action = RXCOMM | RXFF_RESULT;

	if(!FillRexxMsg(rexx_msg, 1, 0))
	{
		...
	}

	Forbid();
	if(_connect_player() == RETURN_ERROR)
	{
		...
	}
	PutMsg(_arexx_port, &rexx_msg->rm_Node);
	Permit();

	WaitPort(reply_port);
	GetMsg(reply_port);
Would someone have some idea?

Thanks!

Last edited by tygre; 06 December 2022 at 01:51. Reason: Notifications; typos
tygre is offline  
Old 06 December 2022, 02:46   #2
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
PS. Maybe it has to do with my version of rexxsyslib.library?
tygre is offline  
Old 07 December 2022, 17:11   #3
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi!

I tried with a more recent version of the library, not joy... PlayOGG doesn't seem to reply to the port

Best!
tygre is offline  
Old 09 December 2022, 21:32   #4
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi there!

I wanted to create a MWE and, looking around on the Internet, I found better: Thomas' example! I took Thomas' code, made it compile with VBCC, and tried it simply with rexx playOGG_rx PLAY and (drum roll...) it also gets stuck at WaitPort (replyport)

I modified a bit this MWE to name the replyport (using CreatePort()) and to pass an "argument string" instead of a "plain" string (using CreateArgstring()), still it waits forever I also used SnoopDOS to monitor everything (including ROM calls, etc.) but didn't see anything obvious...

At this point, I don't know what to try... I would give up on PlayOGG but it really bugs me that rx "ADDRESS 'playOGG_rx'; PLAY" works as expected. (It returns!)

Any idea of what I'm missing?
tygre is offline  
Old 11 December 2022, 08:51   #5
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Have you tried using the name of the rexx port as host? (which is also 'REXX')
Maybe it checks the pointer instead of a strcmp?

or use only RXCOMM as action?

Last edited by bebbo; 11 December 2022 at 16:15.
bebbo is offline  
Old 11 December 2022, 18:11   #6
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Bebbo!

Thanks for your reply but I still couldn't make my MWE work: I tried both your suggestions but it still blocks on the WaitPort (replyport)... The exact same code works as expected with other players, like EaglePlayer, so this must be some kind of "corner case" of implementing ARexx in PlayOGG (I have never implemented an ARexx interface, so I don't know what corner case that could be!)

I also tried without the WaitPort (replyport) but then sometimes this MWE crashes my Amiga, the others it "blocks" PlayOGG ARexx port, so not a solution

Take care!

Last edited by tygre; 11 December 2022 at 18:48. Reason: More details
tygre is offline  
Old 15 December 2022, 23:38   #7
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi all!

Any other suggestions?
Maybe Thomas would see something that we missed in the code?

Please help
tygre is offline  
Old 16 December 2022, 12:29   #8
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
There is nothing wrong with your program as far as I can see. I have a similar program to test sending ARexx commands. It works fine with for example WBDock or Workbench. Only with PlayOGG it blocks. So I would suspect an issue in PlayOGG. It executes the command but then does not reply to it, so that the sender is blocked.
thomas is offline  
Old 16 December 2022, 16:41   #9
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
I found a hint on the Amiga Developer CD in directory ADCD_2.1:Extras/Development/Example_Code_v37/ARexx/simplerexx

It does not send the command directly to the target port, but it sends the command to the port REXX and sets the target port in CreateRexxMsg().

This works better with PlayOGG, but it does not give any result.
thomas is offline  
Old 14 January 2023, 01:32   #10
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Thomas!

Sorry for the late reply and thanks for your help!

I'm going to make more tests but this seems without good solution, too bad!

Cheers!
tygre is offline  
Old 15 March 2023, 23:41   #11
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Thomas and all!

Just to let you know that AmiModRadio now works with PlayOGG, the problem must have been a combination using "REXX" as port name and waiting actively for a reply (like in some cases for EaglePlayer).

Cheers!
tygre is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
ARexx RC is 0 Even When Command Fails tygre Coders. Language 7 02 December 2022 22:11
WinUAE Command Line Problem mrv2k support.WinUAE 6 10 March 2021 16:35
[opus5][arexx] "Lister Empty..." command - problem peceha Coders. Scripting 16 20 March 2018 09:42
Problem executing DOpus5 Arexx Script ... beltrixx support.Apps 1 01 August 2015 22:16
Assign command problem... TrojanBarber support.WinUAE 12 26 September 2005 00:08

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:22.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09559 seconds with 15 queries