fabio914 / RealityMixer

Mixed Reality app for iOS
GNU General Public License v2.0
776 stars 63 forks source link

Calibration successful but can't connect with "start mixed reality" #117

Open kameronlightheart14 opened 1 year ago

kameronlightheart14 commented 1 year ago

I have an iPhone 14 Pro and a Quest 2 headset both running on latest OS. I was able to get through the calibration process and saved the calibration to headset. Then I launch an app like beatsaber in the headset and select "start mixed reality" in the Reality Mixer app. Next when I select "Connect" I get an error "Error. Unable to connect (unknownError)." All the suggested fixes listed after the error in the pop-up I have done. No dice. Is anyone else having this issue?

Rhino99-o commented 1 year ago

Just chiming in to say I have the same issue. Success to calibrate but error on connecting during gameplay. Im using an iPhone 13 Pro (16.4.1(a)), Quest 2 (v53) and latest Beat Saber (just did reinstall) and also just installed Thrill of the Fight to test and no love.

thatnzguy commented 1 year ago

Same issue. Same iPhone 13 Pro, and Quest 2 versions as above.

Some discussion here, but no solution: https://github.com/fabio914/RealityMixer/issues/31#issue-763028214

marilolli commented 1 year ago

I'm having the same issue only it started after downgrading and modding my version of Beat Saber using QuestAppVersionSwitcher. There is an issue with the Beat Saber install that doesn't allow Reality Mixer to connect after calibrating. I have not tried LIV yet, but I haven't been able to get that to connect in the past anyway (even with retail).

ENZOs542 commented 1 year ago

Having the same issue on quest 2, can calibrate but not connect

fabio914 commented 1 year ago

I believe this issue is related to a recent OS update, the Quest is now using a newer version of Android that has more strict permissions, and it doesn't allow the calibration app on the Quest to copy the mrc.xml file (with the calibration) to other apps. Hence these apps won't accept an incoming Mixed Reality connection.

You can read more about it on this thread on Twitter

dthery commented 1 year ago

I've tried the ADB commands, but they don't work. If you have another solution...

dthery commented 1 year ago

In which Quest directory is the calibration file mrc.xml created? I couldn't find it to copy it to the app to be tested.

fabio914 commented 1 year ago

Hi, sorry about the delay. I just added a new page with some extra instructions indicating how to copy the mrc.xml to the correct place using SideQuest.

https://github.com/fabio914/RealityMixer/blob/extra-instructions/Additional-instructions.md

fabio914 commented 1 year ago

Actually, turns out that this will only work if the MRC Calibration app is able to save its own mrc.xml file in the first place. I've been testing a bit more and it seems that this isn't always the case.

dthery commented 1 year ago

Thanks @fabio914 , in my case the file is not in the files directory. Meta Quest Pro V55

Capture d'écran 2023-06-18 134434

ENZOs542 commented 1 year ago

Same happening on Quest 2, the mrc.xml file isn´t saved.

SoapyMan commented 1 year ago

Been trying to figure out permission issues recently and ended up reverse-engineering original Oculus calibration App. https://github.com/SoapyMan/MRCCameraCalibrationApp/releases

UPD: tried to calibrate from it in Reality Mixer, seems like it does not respond to buttons but correctly responds to Calibration Paused UPDUPD: It somehow worked, maybe with longer button press

dthery commented 1 year ago

I have the same thing. The A or trigger button doesn't react. Only the B button makes a noise on the iPad.

Up : Even with longer pressure, I have no reaction. Quest pro V55 IPad pro M2 V16.5.1

Up2 : However, with the Oculus MRC PC application, I can confirm that the mrc.xml file is copied to the directory. Capture d'écran 2023-06-24 112810

dthery commented 11 months ago

No progress on this issue? I still couldn't get it to work.

stobak commented 11 months ago

Unable to get this working as well.

atjchen commented 10 months ago

still no solution? i trie addictional manual instruction: https://github.com/fabio914/RealityMixer/blob/extra-instructions/Additional-instructions.md

its doesnt work for me :( (no file mrc.xml on /sdcard/Android/data/com.oculus.MrcCameraCalibration/files)

DikeyKing commented 7 months ago

Replace the method in CalibrationViewController.swift


@IBAction private func saveAction(_ sender: Any) {
        guard case .calibrationSet(_, let calibration) = state else { return }

        guard let data = calibration.toFrame()?.toData() else {
            let alert = UIAlertController(title: "Error", message: "Unable to generate calibration data.", preferredStyle: .alert)
            alert.addAction(.init(title: "OK", style: .default, handler: nil))
            present(alert, animated: true, completion: nil)
            return
        }

        let temporaryDirectory = FileManager.default.temporaryDirectory
        let fileURL = temporaryDirectory.appendingPathComponent("mrc.xml")
        let xmlString:String = calibration.xmlString
        print("d:xmlString = \(xmlString)")
        do {
            try xmlString.write(to: fileURL, atomically: true, encoding: .utf8)
            // 文件保存成功
            print("d:xmlString:saved")
        } catch {
            // 处理保存文件时的错误
            print("d:xmlString:saved:failed")
        }

        // @Dikey 发送 calibration的位置

        switch client.send(data: data) {
        case .failure(let error):
            let alert = UIAlertController(title: "Error", message: "Unable to save calibration: \(error)", preferredStyle: .alert)
            alert.addAction(.init(title: "OK", style: .default, handler: nil))
            present(alert, animated: true, completion: nil)
        case .success:
            let alert = UIAlertController(title: "Calibration Saved!", message: "You can now close the Oculus Mixed Reality Capture Calibration app and launch your VR application/game.", preferredStyle: .alert)
            alert.addAction(.init(title: "OK", style: .default, handler: { [weak self] _ in
                guard let self = self else { return }
                self.displayLink?.invalidate()
                self.delegate?.calibration(self, didFinishWith: calibration)
            }))
            present(alert, animated: true, completion: nil)
        }
    }
  1. Use iExploer or somethome other soft to copy this file from your iOS device to your mac (path Reality Mixer/tmp/mrc.xml)

  2. Use Side quest to save this file to data/com.xxx.app/files/

Tested and it works

XXLWolf commented 7 months ago

替换CalibrationViewController.swift中的方法


@IBAction private func saveAction(_ sender: Any) {
        guard case .calibrationSet(_, let calibration) = state else { return }

        guard let data = calibration.toFrame()?.toData() else {
            let alert = UIAlertController(title: "Error", message: "Unable to generate calibration data.", preferredStyle: .alert)
            alert.addAction(.init(title: "OK", style: .default, handler: nil))
            present(alert, animated: true, completion: nil)
            return
        }

        let temporaryDirectory = FileManager.default.temporaryDirectory
        let fileURL = temporaryDirectory.appendingPathComponent("mrc.xml")
        let xmlString:String = calibration.xmlString
        print("d:xmlString = \(xmlString)")
        do {
            try xmlString.write(to: fileURL, atomically: true, encoding: .utf8)
            // 文件保存成功
            print("d:xmlString:saved")
        } catch {
            // 处理保存文件时的错误
            print("d:xmlString:saved:failed")
        }

        // @Dikey 发送 calibration的位置

        switch client.send(data: data) {
        case .failure(let error):
            let alert = UIAlertController(title: "Error", message: "Unable to save calibration: \(error)", preferredStyle: .alert)
            alert.addAction(.init(title: "OK", style: .default, handler: nil))
            present(alert, animated: true, completion: nil)
        case .success:
            let alert = UIAlertController(title: "Calibration Saved!", message: "You can now close the Oculus Mixed Reality Capture Calibration app and launch your VR application/game.", preferredStyle: .alert)
            alert.addAction(.init(title: "OK", style: .default, handler: { [weak self] _ in
                guard let self = self else { return }
                self.displayLink?.invalidate()
                self.delegate?.calibration(self, didFinishWith: calibration)
            }))
            present(alert, animated: true, completion: nil)
        }
    }
  1. 使用 iExploer 或其他软件将此文件从您的 iOS 设备复制到您的 Mac(路径 Reality Mixer/tmp/mrc.xml)
  2. 使用 Side quest 将此文件保存到 data/com.xxx.app/files/

已测试并且有效

first thanks! i can't save mrc.xml in /sdcard/Android/data/com.oculus.MrcCameraCalibration, i want to try your method, but it‘s difficult.

Sk8rMarine commented 6 months ago

Is there any hope of this working smoothly again. I have tried the MRC through SideQuest and I have tried manually adding the MRC.xml code to the file but I am still getting the error message. Well there was already a MRC file in beatsaber but I replaced it with the one from MRCCalibration.

I have tried to look at other options (LIV) but I only have an IMac and IPhone and I guess LIV for IOS is still running out of TestFlight and not taking on anymore beta users.

So just trying to figure out what to do now without having to go buy a PC. image

Attilarum commented 6 months ago

The calibration is working however the connection to the app fails. The problems seem to remain as already described above. If it will work it has a lot of benefit to many people. Hope to hear soon some good news and best thanks in advance.

s00500 commented 5 months ago

Hm... I can confirm that the calibration file is in the right location, I used the app installed via sidequest to calibrate, seems to work, still beatsaber does not allow capuring... any inputs ?

fabio914 commented 5 months ago

@s00500 last time I tried it with Beat Saber it didn't work. Many apps stopped supporting Mixed Reality Capture. They'd need to modify their Android manifest file to be able to continue supporting Mixed Reality Capture, and I don't think many developers have done that (including Beat Saber).

s00500 commented 5 months ago

Hey @fabio914, thanks for the headsup... that is pretty sad, so MR for beatsaber on the Quest 2 is basically dead right now ?