Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No deviceattached or midi messages being detected or displayed #9

Open
owlandfox opened this issue Mar 11, 2024 · 12 comments
Open

No deviceattached or midi messages being detected or displayed #9

owlandfox opened this issue Mar 11, 2024 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@owlandfox
Copy link

App built for Quest 3 - When plugging my Midi controller in I get the prompt menu appear and click OK. Scene opens but the text does not display any device info or incoming midi data info.

Secondly once this is solved I am simply trying to connect the incoming midi messages to trigger buttons, sliders and toggles in the UI. Can you provide steps to do this also? Thanks!

@owlandfox owlandfox added the bug Something isn't working label Mar 11, 2024
@ArthurVasseur
Copy link
Owner

Hello,

Can you give me the logs
https://developer.android.com/studio/debug/logcat?hl=en

@owlandfox
Copy link
Author

Its not possible to get the logs as the only wayt to test if the midi controller is being detected is by plugging into the Quest. Which means it is not connected to the laptop via USB to activate Logcat :/

Unless theres another way? I also see in some of the other MIDI plugins we tried from the store they required us to add some parameters to the androidmanifest. Is this the case here too? If so what would we need to add?

@ArthurVasseur
Copy link
Owner

You can have the logcat by using wifi instead of USB :

https://docs.unity3d.com/Packages/[email protected]/manual/index.html

@owlandfox
Copy link
Author

Logcat.txt

Would it help for me to filter it by some criterion?

@ArthurVasseur
Copy link
Owner

Not really the full log is ok

2024/03/11 11:03:40.234 1072 5178 Warn InputManager-JNI Input channel object '499b7c7 com.oculus.os.vrusb/com.oculus.os.vrusb.UsbPermissionActivity (client)' was disposed without first being removed with the input manager!
2024/03/11 11:03:40.234 10860 10860 Info Unity Device Attached /dev/bus/usb/001/002
2024/03/11 11:03:40.234 10860 10860 Info Unity Midi.MidiEventHandler:DeviceAttached(String)
2024/03/11 11:03:40.234 10860 10860 Info Unity System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
2024/03/11 11:03:40.234 10860 10860 Info Unity UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
2024/03/11 11:03:40.234 10860 10860 Info Unity UnityEngine.AndroidJavaProxy:Invoke(String, IntPtr)
2024/03/11 11:03:40.234 10860 10860 Info Unity UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)

You need to have the usb permissoin in the manifest file

@owlandfox
Copy link
Author

Yes I had a feeling it was something extra needed in the manifest. Can you confirm what exactly needs adding as I did already add android.hardware.usb.host

Do we need to add the full snippet from here - https://developer.android.com/develop/connectivity/usb/host

<manifest ...>


...

<activity ...>
...


        <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
            android:resource="@xml/device_filter" />
    </activity>
</application>

@ArthurVasseur
Copy link
Owner

Maybe <uses-feature android:name="android.hardware.usb.host" />

@ArthurVasseur
Copy link
Owner

Did it work? Can I close the issue ? @owlandfox

@owlandfox
Copy link
Author

Nope still trying to get some detection for plugged in controllers

@owlandfox
Copy link
Author

From what I can see its because we also need to declare intent filters https://developer.android.com/develop/connectivity/usb/host

But im not sure where we would need to create the xml file as this seems very specific to Android file structure rather than Unity.

@ArthurVasseur
Copy link
Owner

You need to have the android manifest file in unity : https://docs.unity3d.com/2023.2/Documentation/Manual/android-manifest.html

Add <uses-feature android:name="android.hardware.usb.host"/> into the manifest file

@owlandfox
Copy link
Author

Yep tried this multiple times, no success :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants