VectorAudio icon indicating copy to clipboard operation
VectorAudio copied to clipboard

Feature Request: RDF Support for EuroScope

Open KingfuChan opened this issue 3 years ago • 3 comments
trafficstars

Firstly I'm really impressed on you vSMR project :) Today I logged-in as a Center controller in an event and I found it hard to locate who's actually talking when my airspace was getting crowded... I believe you know how RDF (https://github.com/chembergj/RDF) is currently working on ES. It needs a bridge reading the stdio of AFV client. Also AFV/VectorAudio and ES don't necessarily need to run on the same machine. So some day ago an idea occurred to me: Can VectorAudio send a message via HTTP to a pre-set network address, and modify the plugin above (or re-write?) to monitor a specific portal so that all RX can be displayed in ES?

KingfuChan avatar Nov 05 '22 15:11 KingfuChan

Thank you, glad you like it :)

Yes, I'd love to support it but the current RDF plug-in in EuroScope uses a windows only API for sending messages back and forth with AFV. If RDF is supported to allow for an HTTP or other more standard protocol, it'd be no problem to do that.

pierr3 avatar Nov 05 '22 17:11 pierr3

Yes I know currently RDF is using WinAPI for monitoring AFV client messages. Actually the principle of displaying that circle is not difficult, and I've also got some experience in developing ES plugins, so I'm thinking if I could figure out how to build a HTTP server in the plugin, then this idea will become fully viable.

KingfuChan avatar Nov 06 '22 03:11 KingfuChan

Thank you, glad you like it :)

Yes, I'd love to support it but the current RDF plug-in in EuroScope uses a windows only API for sending messages back and forth with AFV. If RDF is supported to allow for an HTTP or other more standard protocol, it'd be no problem to do that.

Is it possible to write an Euroscope plugin to listen the message from VectorAudio? It only requires a UDP broadcast on VectorAudio, and the plugin do the same things just like the afvbridge, so that the RDFplugin will work.

LeoChen98 avatar Nov 26 '22 15:11 LeoChen98

There is some initial proof of concept going on for this, if someone would like to prepare a ES plugin that would make an HTTP call on the local machine every X seconds to get the list of transmitting clients, feel free! There will not be an event based system due to the nature of how VectorAudio works.

pierr3 avatar Jan 26 '23 18:01 pierr3

v0.5.0 features the necessary interface on VectorAudio's side. See this wiki page for details. Would be great if someone could create a plugin! Another plus from this implementation, as opposed to AFV Standalone, is that it should work on all EuroScope instances you have open, and not only the first one. Please do give feedback!

pierr3 avatar Jan 27 '23 03:01 pierr3

Great, thank you!

Would we want to open an issue with https://github.com/chembergj/RDF/issues asking if they want to support that HTTP-interface, too? I guess the TopSky plugin includes the code from that plugin?

Or do you think that makes no sense and we should go straight for a "VectorAudioRDFPlugin"?

jonaseberle avatar Jan 27 '23 07:01 jonaseberle

Great, thank you!

Would we want to open an issue with https://github.com/chembergj/RDF/issues asking if they want to support that HTTP-interface, too? I guess the TopSky plugin includes the code from that plugin?

Or do you think that makes no sense and we should go straight for a "VectorAudioRDFPlugin"?

Actually if you look into how RDF now works with ES you will find out that it's the AFVEuroscopeBridge (https://github.com/AndyTWF/afv-euroscope-bridge) that's really triggering the RDF drawings. So my idea is to build a similar bridge plugin to send and receive HTTP request and deliver it in the same way where RDF will do the rest.

KingfuChan avatar Jan 27 '23 08:01 KingfuChan

Or simply using part of the codes from RDF and build another plugin is also viable. I would love to do so because I've got some experience with ES plugin developing, but I need to know how to make HTTP requests in this MFC C++ plugin in the first place :(

KingfuChan avatar Jan 27 '23 09:01 KingfuChan

I'm not actually sure AFVEuroscopeBridge has anything to do with it anymore. The RDF plugin itself communicates with EuroScope through another hidden window, the best way would be to take the code from RDF plugin, but run ProcessMessage on the return of an HTTP call that's done every second. You can see how I've been doing this using std::async and promises in this project: here and here

pierr3 avatar Jan 28 '23 01:01 pierr3

Would we want to open an issue with https://github.com/chembergj/RDF/issues asking if they want to support that HTTP-interface, too?

I've created the issue, I believe it's better if it stays within one plugin, but I do not know how active the developer is, you can find it here! Go voice support!

pierr3 avatar Jan 28 '23 01:01 pierr3

OK I'll get myself acquainted to those methods. Thanks for creating the new issue, though I think forking his repo then modify by ourselves would be better. I don't think the author is active from his front page.

KingfuChan avatar Jan 28 '23 02:01 KingfuChan

I've forked the RDF repo and is finishing the adaptation process, also added some new features. I'm looking at a first release in the few days.

KingfuChan avatar Feb 04 '23 17:02 KingfuChan

https://github.com/KingfuChan/RDF/releases/tag/v1.3.0 Done!

KingfuChan avatar Feb 05 '23 13:02 KingfuChan

Amazing, thank you so much. I would highly recommend that you set the default of addressVectorAudio to "127.0.0.1:49080", as most users are likely to be using the software on the same machine and this would enable the plugin to be plug&play.

pierr3 avatar Feb 06 '23 02:02 pierr3

I've just been testing it and it works pretty good already. Great job, thank you!

What I have done:

  • I added the settings mentioned in https://github.com/KingfuChan/RDF#configurations. For my config (VectorAudio on Linux, EuroScope in wine) RDF Plugin for Euroscope:VectorAudioAddress:127.0.0.1:49080 made it connect. (I added the other settings as well - not sure if necessary)
  • Loaded the .dll via EuroScope OTHER SET -> Plugins... -> Load
  • in EuroScope OTHER SET -> Plugins... I allowed the plugin to draw on types: "Standard ES radar screen" (+ everything else you have there, in my case the "Ground Radar Display")
  • Connected EuroScope (as observer)
  • Connected VectorAudio and enabled some online frequencies
  • Saw the message "RDF Plugin: Connected to VectorAudio/0.6.0" in the EuroScope messages
  • Be very happy seeing circles around transmitting planes :)

Just some remarks:

  • "Log" Messages are currently added to the "main" EuroScope messages. It would be great if they could go to their own "RDF" group. I mean like CCAMS is doing it here: image That would make it easier to find them. They are already very helpful for troubleshooting!
  • The "poll interval" seems to be 1s at the moment. Some transmissions are too short to be picked up. It would be great if it could be much smaller (300ms?). Maybe a setting for it?
  • Very minor issue: Currently transmissions are shown as "concurrent" even if they happen on 2 different frequencies or on different audio devices (because the VectorAudio SDK reports them like that). I don't know if that is improvable due to possible cross-coupling etc. The use case would be that you monitor stations around you on the secondary (SPK) audio device.
  • Would it be possible to set the radius of the circle in pixels rather than NM? For the ground I need a totally different radius in NM... (I don't know if that's easy with the EuroScope plugin API)

Maybe we should have an "issues" tab at the Github page at https://github.com/KingfuChan/RDF ?

Disclaimer: I have never really used AfV or any RDF plugin before.

jonaseberle avatar Feb 11 '23 18:02 jonaseberle

Hi, thanks for your opinion. Actually I'm working on a few items you just mentioned. In the next release I'll try to implement the following modifications.

set the default of addressVectorAudio to "127.0.0.1:49080", as most users are likely to be using the software on the same machine and this would enable the plugin to be plug&play.

I've already added to my code with this default setting, which means there's no need to furthermore configure anything is localhost works perfectly for users. By default the plugin will behave just like the original RDF.

  • "Log" Messages are currently added to the "main" EuroScope messages.

This is actually intended to prevent disturbing messages in EuroScope. Basically all plugins will use the native "Messages" chat to display information.

  • The "poll interval" seems to be 1s at the moment. Some transmissions are too short to be picked up. It would be great if it could be much smaller (300ms?). Maybe a setting for it?

This will be examined later, because I've tested VectorAudio won't work properly if the interval is too short (too many simultaneous requests). Currently I'm using the OnTimer event in EuroScopePlugin SDK and it's forced to refresh every second. Later I may try to use threading for customizable poll interval.

  • Very minor issue: Currently transmissions are shown as "concurrent" even if they happen on 2 different frequencies or on different audio devices (because the VectorAudio SDK reports them like that). I don't know if that is improvable due to possible cross-coupling etc. The use case would be that you monitor stations around you on the secondary (SPK) audio device.

This is what the official AFV client is doing, and also neither can VectorAudio distinguish different devices and frequencies, sorry I don't think there's room for improvement.

  • Would it be possible to set the radius of the circle in pixels rather than NM? For the ground I need a totally different radius in NM... (I don't know if that's easy with the EuroScope plugin API)

Yes, I will add this to the next release.

Feel free to open an issue in my repo! I'll close this issue now. Thanks for the work from everybody!

KingfuChan avatar Feb 12 '23 16:02 KingfuChan

Thank you @KingfuChan! You can enable issues in https://github.com/KingfuChan/RDF/settings - I think it is off by default for forks.

jonaseberle avatar Feb 13 '23 08:02 jonaseberle

Should we advertise it on https://forum.vatsim.net/tag/euroscope to get some more testing in?

jonaseberle avatar Feb 13 '23 09:02 jonaseberle

You can enable issues

Done.

Should we advertise it on https://forum.vatsim.net/tag/euroscope to get some more testing in?

I doubt that VectorAudio is not officially recognized by VATSIM yet (from an SUP friend of mine), which means advertising my plugin is OK but advertising VectorAudio may cause some other issues?

KingfuChan avatar Feb 13 '23 15:02 KingfuChan

I'm working on that. Stay tuned.

pierr3 avatar Feb 13 '23 16:02 pierr3

I've lowered the SDK update rate to 300ms, and increased the number of workers in the SDK, this will be available in the next release, if you want to try and poll more frequently.

pierr3 avatar Feb 20 '23 18:02 pierr3

  • The "poll interval" seems to be 1s at the moment. Some transmissions are too short to be picked up. It would be great if it could be much smaller (300ms?). Maybe a setting for it?

I've lowered the SDK update rate to 300ms, and increased the number of workers in the SDK, this will be available in the next release, if you want to try and poll more frequently.

My work is done and a configurable poll interval is included in the newest pre-release v1.3.2. Please check it out. If no serious problem with my new method I will change it to and official release.

Also to be noted by a friend of mine, is it possible to add a WebSocket method to proactively push transmitting pilots to the RDF client?

KingfuChan avatar May 31 '23 02:05 KingfuChan

I could explore the websocket solution in the future, not sure what the timeline looks like for now. I also need to refactor the code to detect multiple transmissions on one frequency, I will let you know! Thank you for the work.

pierr3 avatar May 31 '23 03:05 pierr3

Thank you! It would be great to get that merged upstream.

jonaseberle avatar May 31 '23 08:05 jonaseberle