Cabbage Logo
Back to Cabbage Site

APK crashed on start up in Oculus

Hello!

I am working on a Unity VR experience using Csound. I was able to run it in Unity Engine with Oculus Link, build it, and install the APK without any compiled errors. However, every time I opened the APK in my Oculus headset it just crashed. When I opened up the second time, the error popped up saying that the application keeps stopping. Are there any settings I missed to run a Csound game in Oculus?

Thank you!

All the best,
Chen Liu.

Are you using CsoundUnity, or have you implemented your own wrapper for Csound?

Hi Rory!

Yes I am using CsoundUnity. It’s a really great package!

I think we need to reach out to @giovannibedetti on this one. I’ve never used this on an Oculus…

1 Like

Two things to check:

  • use ILCPP and build a 64bit apk
  • define sr and ksmps in the Csound options

Let us know how it goes!

Thank you! I just tried the build but failed, and I don’t have 64bit available in my Unity :(((
IL2CPP Setting:


No 64bit:

Errors:

The settings are correct, but it looks like Unity has no write access to the folder where it’s staging the temp export. Try using a shorter path without empty spaces. Also be sure that the window user has write access to the folder. Try starting the Unity Hub as administrator.

1 Like

Thanks a lot! I think the errors are gone, but the build seems to get stuck here:
stucked

Building with ILCPP unfortunately takes some time, it depends on how powerful your pc is. You can just wait :sweat_smile:
Hopefully it will end!

Yeah I am doing this on my notebook lol…it is still building IL2CPP currently and has been for almost 40mins. Hope it’s done soon! Thank you so much :DDD

Any luck?
After the first successfull build you should be able to patch (never tried it but it is an option to consider investigating)


Also, building on a ssd could speed up things a lot

I left it running for the whole last night and it was still stuck there to build IL2CPP XD I guess my notebook just doesn’t like working too much…
Thanks for recommending the patching method. I will definitely try that when I have my first build in the future.

Whoa that’s bad. What kind of hard disk do you have? Ssd? Are you using a usb dock for the hard disk? Usb could slow things down, better use an internal hard disk.
How much space left on the partition?
You could also try and see if the Unity Editor logged some interesting bits before or while being stuck, have a look here:

https://docs.unity3d.com/Manual/LogFiles.html

Good evening :)))

Thank you so much for the information. Sorry for the late reply as I just finished the school. I checked out my hard disk and they are all SSD. However, my Unity project was saved on my flash drive so I guess that could slow things down? Should I save a copy inside the laptop disk and then run and build the level? I have 25.6 GB left in C drive, 40.8 GB in D drive, and 98.8 GB in E drive. Does it also matter to save the build in an internal drive?

Good morning! :wink:
The project folder is where all the temp staging happens (check the “Library” folder inside your project folder), so where Unity creates the files needed to build.
It involves writing lots of small files, this could be very slow if running on an external flash drive.
You can use the external drive to store the final built apk, but the project should reside in the fastest hard disk you have.
As a rule, consider that usually hard disks work best if they have at least 20% of empty space.

Oh sounds awesome and it worked!!! And it’s millions of times faster :smiley: Took around 1 minute. Check out this little prototype I just recorded inside the headset :slight_smile: https://drive.google.com/file/d/1aTavhfny5hvDMJNAuM0CRKHUuA8h8Iua/view?usp=sharing

At first, I built it on E drive and it failed at the end because the access to E drive was denied, and I did run Unity Hub as an Administrator. Then I changed the directory to C:\ User to save the build and it worked.

This access issue has been tricky with my PC. I also haven’t been able to run .csd in CsoundQt due to this so I have been writing all the CSDs in Cabbage. I have tried several security settings but it was denied to change the permission.

The next thing I am gonna do is to make this prototype more musical with more sounds. I also need to understand the way to SendScoreEvent in OnTriggerEnter only once without keeping updating it. I am still being a little confused with the programming logic XD Right now I just used SetChannel to turn up the gain of the instrument, but It is kind of limited if I want to turn on an instrument, trigger a sample, or an event.

Thanks a lot for the help and patience! I really appreciate it :smile: Have a wonderful day

1 Like

The prototype is great! Can’t wait to see more :wink:
Have a look here for some advice on how to use colliders:

Haha yes, that was also me in the discussion but asking for my C# partner. Now I need to really apply this myself! I am excited!

1 Like

I pushed a basic collision example to the package that follows that approach, have a look :wink:
(reinstall from package manager + git pasting)

1 Like

Oh, that’s amazing. I am looking at it now! Thanks a million XD