Hey, I keep getting this error when I try to connect my SR 2.0 to MPV.
Error when connecting to MPV:
System.TimeoutException: The operation has timed out.
at System.IO.Pipes.NamedPipeClientStream.ConnectInternal(Int32 timeout, CancellationToken cancellationToken, Int32 startTime)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
— End of stack trace from previous location —
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
— End of stack trace from previous location —
at MultiFunPlayer.MediaSource.ViewModels.MpvMediaSource.RunAsync(ConnectionType connectionType, CancellationToken token)
at MultiFunPlayer.Common.ExceptionExtensions.Throw(Exception e)
at MultiFunPlayer.MediaSource.ViewModels.MpvMediaSource.RunAsync(ConnectionType connectionType, CancellationToken token)
I’ve tried everything from running is at administrator to changing the usb port to restarting my pc multiple times. I really don’t know what to do else to get it to work. My device does connect to my pc since it gives a connect sound, but for some reason MFP won’t let me connect it to MPV. ;_;
“Yes, when you plug in the FUNSR1 to your USB port, Windows should register a new Serial COM device. (In Device Manager, it’s under “Ports (COM & LPT)”.) If this doesn’t show up, you might have a faulty cable. Once the COM port shows up, open Multifunplayer, click Add Output > Serial. Then click the dropdown menu that says “serial port”. It will have COM1 (default Windows port, not what you are looking for), and the assigned COM port for your SR1. After selecting it, click the connect button to communicate with the SR1.”
I found the answer for the people who want to know this.
Now when I try to drop the video’s into the player after everything is connected it doesn’t let me. I ran the program as admin. What could the problem be?
I think you are a second person to ever have this issue, I dont know what causes this.
Can you try drag dropping the video file directly onto mpv.exe? It should be in Bin\mpv\mpv.exe
MFP needs to start mpv for scripts to work. Opening the video directly via mpv.exe was just a test.
But I don’t know why you cant drag drop files into the mpv window opened by MFP, did you change the arguments list?
Sure, the file attached implements pause script, manual mode and edging mode at the moment. Return to base doesn’t seem to register for me maybe Yoooi knows why. You need the latest version 1.32.0+ as this uses the new plugin API.
What it does at the moment
Everything is mapped to L0 as I have a FUNOSR1 and no other axis
Edging mode toggles between an edging and normal range
Pause script bypasses all motion (motion provider and script)
Manual mode toggels the motion providor on and off
To use this you’d have to map the buttons to the script actions like so:
Keep in mind that currently you have to press the button twice. I’m hoping Yoooi will reduce this to once as it’s an implementation choice but we’ll see.
The html part is integrated with my Electron application that uses Vue 3 and isn’t easily sharable. however you can easily reproduce something that communicates with the plugin using some basic html and javascript and then just host it on your localhost.
For refrence this is how my plugin ui looks like (speed and delay for manual mode aren’t implemented yet).
You can communicate with the plugin like so, for exampe something like this for is-edging
Here’s my one, with a proper HTTP (tho I guess I gonna copypaste routes from your code), and a no-working (I think) enable/disable GUI taken from example
I’ve already used it to play a couple of games, it worked somehow.
Yeah importing using System.Net; didn’t work for me in the previous version of mfp for some reason so I worked around it. However, everything is working fine and dandy on my side so no need for any code but thanks
You need to use //#r "System.Net.HttpListener" for not-included deps (that was somewhere i changelogs I guess?)
Tho I’m not sure if it works in the build with System dlls
I’ve posted code mostly to post code so it doesn’t just lays on my PC and someone can read and comment on it, and your code post finally made me do this
The plugin base class exposes CancellationToken property which gets cancelled before the call to OnDispose. You should use it (or your own) on all your tasks/threads so that they are properly cleaned up when the plugin is unloaded.
Your Action queue task will never finish, meaning the plugin assembly will always be loaded, so on each recompile you will have a memory leak.
Also I dont think you need the whole action queue, if you want thread safety just add a lock. But if it works it works.
Its not an implementation choice, thats how it behaves in DeoVR, you saw the logs, there are no events for when you press/release the button, only events for when a feature is enabled/disabled.
You can add two shortcuts one for press (enable feature), one for release (disable feature).