tarsjoris / x-air

Tooling for the Behringer X-Air series mixers (XR18) and control surfaces (X-Touch).
GNU General Public License v3.0
8 stars 0 forks source link

Build failure on Windows 10 #24

Closed tizfra closed 11 months ago

tizfra commented 11 months ago

Hi, I've tried to build your project following instructions, but maven tells me that the POM file is missing, how can I proceed? Can you upload the right POM file? Thanks

tizfra commented 11 months ago

ok, i've been able to build the proxy, but when i run the jar executable, it tells me something like a problem: Use XAiR XR18 device at 192.168.1.150 2023-10-08 20:33:14.664 [main] INFO ktor.application - Autoreload is disabled because the development mode is off. Starting ktor netty 2023-10-08 20:33:14.770 [main] INFO ktor.application - Responding at http://192.168.0.4:8080 Exception in thread "main" java.net.BindException: Cannot assign requested address: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Unknown Source) at sun.nio.ch.Net.bind(Unknown Source) at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134) at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550) at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506) at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491) at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248) at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.ktor.server.netty.EventLoopGroupProxy$Companion$create$factory$1$1.run(NettyApplicationEngine.kt:241) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Unknown Source)

Software is running in cmd, but there isn't any window that asks me to calibrate, and there is no comunication between proxy and x-air edit.

Can you help me?

tarsjoris commented 11 months ago

Hi Tizfra, There is now also an automated build, so the jars are available as a package: https://github.com/tarsjoris/x-air/packages/1892157

The XTouch normally connects to the XR18 on port 10111, so this proxy also needs to listen on port 10111. This BindException occurs when there is already another process listening on this port (10111). Is the proxy maybe running twice? Or there might be another program already using this port.

Hope this helps

tizfra commented 11 months ago

thanks for the quick reply, i've also picked up the automated build, and the problem is the same. I think the problem is this ip address ktor.application - Responding at http://192.168.0.4:8080, that i'm not ale to modify. Is that right?

Another question, how should I set up the connection between xr18, PC and x-touch? Thanks

tarsjoris commented 11 months ago

Hi Tizfra,

The webserver listening at 192.168.04:8080 is when you want to use the React web application for doing monitor mixes on smartphones. It is optional, and can be disabled by setting webrelay.enabled=false in xtouch.properties. If you do want to use it, the address can be configured by setting address=your-ip, also in xtouch.properties. The port is currently fixed.

But the exception in the stacktrace that you posted earlier, seems not related to that part, but to the part that proxies requests between the XTouch and the XR18. The port 10111 cannot be changed as the XTouch only connects to that port on the configured IP-address. You could check which application is already binding to that port. Not sure which platform you are on, but on windows, it can be done like this https://stackoverflow.com/questions/48198/how-do-i-find-out-which-process-is-listening-on-a-tcp-or-udp-port-on-windows .

Setting up the connection between the XTouch, the proxy and the XR18 is explained in the README.md at the root of this project.

Hope you can get it working.

tizfra commented 11 months ago

I've done some tests and I've found that I have only your proxy that listen on port 10111, because with netstat -aof command I saw port 10111 only when proxy is running. I can't see the window that asks me to calibrate, and also x-touch can't connect to my pc

tarsjoris commented 11 months ago

Hi Tizfra, When I now look at the stack trace that you provided, it shows a different stack trace than what I saw earlier. Very strange. I'm confused. It shows that the message was edited. Did you maybe change the stack trace? Now it is indeed the webserver that is the problem. Then this part of my previous response should solve the issue:

"The webserver listening at 192.168.04:8080 is when you want to use the React web application for doing monitor mixes on smartphones. It is optional, and can be disabled by setting webrelay.enabled=false in xtouch.properties. If you do want to use it, the address can be configured by setting address=your-ip, also in xtouch.properties. The port is currently fixed."

tizfra commented 11 months ago

Yes, I edited the message with a new trace, sorry for that. Do you think proxy runs if I disable the webrelay?

tarsjoris commented 11 months ago

Hi Tizfra, Yes the webrelay is optional. You only need it if you want to use mobile phones to make monitor mixes.

tizfra commented 11 months ago

Ok, now proxy runs perfectly, but now I have some issues with mouse calibration, if I press EQ on x-touch mouse goes on COMP tab, sometimes mouse goes on top left of window and generally mouse arrow doesn't go where there is a blue spot during calibration. What can I do?

tarsjoris commented 11 months ago

Is the XAir Edit app always in the same location on the screen? The proxy clicks on absolute positions on the screen, so if the X Air Edit app is moved around, it no longer aligns with the callibration.

tizfra commented 11 months ago

Yes, x-air edit is always in the same position, this evening I'll do more tests.

tizfra commented 11 months ago

I've done more tests and I confirm what I tell you before. Maybe you can add a sort of manual calibration, where there's a list of buttons and a coordinate of mouse.

tarsjoris commented 11 months ago

Hi Tizfra, I'm afraid that won't fix the problem. As the mouse is moved to the same absolute location as the blue dots. It was tested on Linux (Raspberry PI), Windows and Mac OS. What operating system are you using? There's also no physical mouse or trackpad sending commands to the cursor as well?

tizfra commented 11 months ago

I'm using windows 10 notebook, only with trackpad, do you think trackpad disturbing the proxy? I can see very well that mouse doesn't go on blue spot especially on bus button and FX button on bottom right I must try it on raspberry

tarsjoris commented 11 months ago

Hi Tizfra, Maybe it's an issue with DPI ... When you calibrate and click the mixer and mute-button, do those blue dots appear on the location that you clicked?

tizfra commented 11 months ago

Calibration looks good Immagine

tizfra commented 11 months ago

Maybe the problem could be the scaling of windows graphic, that in this moment I can't remember what I had set to. Something like here https://stackoverflow.com/questions/48799393/robot-mousemove-not-moving-to-specified-location-properly

tarsjoris commented 11 months ago

Hi Tizfra, I did some tests with different scalings in Windows, but it all seemed to behave correctly. I added some debug functionality to a separate branch. Could you try and checkout https://github.com/tarsjoris/x-air/tree/issue/24 and rebuild the JAR ?

On the calibration screen, there is now an extra button "Test" which positions the mouse in each of the four corners where the X-Air Edit should be (with a second delay in between). Could you check if the mouse is moved to the correct locations? The expected position and the actual position are also printed to the console. These values could indicate where the problem is.

You can also add an option mouse-move-retry=true to ~/xtouch/interactor.properties. It will then check if the mouse is at the correct location, and try to move the mouse again if it wasn't in the correct location.

tizfra commented 11 months ago

I've tried to compile your modified project, but it gives me some errors during the build about werelay. [INFO] --- kotlin:1.8.10:compile (compile) @ proxy --- [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (4, 16) Unresolved reference: application [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (5, 16) Unresolved reference: application [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (6, 25) Unresolved reference: websocket [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (7, 29) Unresolved reference: resources [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (8, 29) Unresolved reference: static [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (9, 16) Unresolved reference: routing [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (12, 26) Unresolved reference: WebSockets [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (13, 26) Unresolved reference: webSocket [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\webrelay\WebRelay.kt: (25, 13) Unresolved reference: Application [ERROR] C:\Users\tizza\Desktop\x-air-issue-24\proxy\src\main\kotlin\be\t_ars\xtouch\xctl\IXR18Listener.kt: (8, 4) 'when' expression must be exhaustive, add necessary 'is UnusedButtonLEDEvent' branch or 'else' branch instead

tarsjoris commented 11 months ago

I updated the branch, that should be fixed now.

tizfra commented 11 months ago

I've tested your modified app, I've calibrate and I pressed "Test" button. This is what cmd tells me: 58 180 0 74 1034 180 1292 206 58 779 0 922 1034 779 1292 744 I have done the test with a small window and the mouse pointer goes outside the x-air edit window.

tizfra commented 11 months ago

Tomorrow I'll be able to do more tests with another PC, to see if the problem is my notebook.

tarsjoris commented 11 months ago

I've tested your modified app, I've calibrate and I pressed "Test" button. This is what cmd tells me: 58 180 0 74 1034 180 1292 206 58 779 0 922 1034 779 1292 744 I have done the test with a small window and the mouse pointer goes outside the x-air edit window.

Those are some interesting numbers :) It clearly is not moving the mouse to the requested position. Maybe setting the position a few times, as suggested on SO, fixes the issue …

tarsjoris commented 11 months ago

I did read that it might be related to high screen DPI’s (e.g., 1920x1080). Or it might be a bug in the JRE. Which version of java are you using?

tizfra commented 11 months ago

i use java 1.8.0_311, and yes, my screen resolution is 1920x1080

tarsjoris commented 11 months ago

If it is caused by a bug in the JRE, it should be fixed when using a newer version. Could you try with Java 11 or 17? (Available as OpenJDK, or AWS).

tizfra commented 11 months ago

Ok, i've update java to 17 and now calibration is ok. For me you can close the issue. Thanks for the help

tarsjoris commented 11 months ago

Hi Tizfra,

Glad it works. Hope the project can be useful to you.