Snapdragon Spaces Camera Frame Access Sample is not working
E
Elijahemunoz
started a topic
2 days ago
Hello Snapdragon Team,
We are having issues with the Camera Frame Access Sample Scene.
For context:
We were given:
ThinkReality A3 Leveno (HMD)
Motorola Edge Plus (Phone)
Versions:
We have tried both the 1.0 and pre-release versions of SnapDragon Spaces, along with each version of Unity, and no configuration seemed to resolve our issue.
We made sure not to change anything with the sample before we ran the apk on our HMD the first time, and it gave us an error:
We already have the Camera Access feature enabled, so we assumed that the issue was permissions.
We then used a script that we got from another forum post that would give permission so that we could use our device's camera:
using UnityEngine;
using UnityEngine.Android;
public class CameraPermissions : MonoBehaviour
{
internal void PermissionCallbacks_PermissionDeniedAndDontAskAgain(string permissionName)
{
Debug.Log($"{permissionName} PermissionDeniedAndDontAskAgain");
}
void Start()
{
if (Permission.HasUserAuthorizedPermission(Permission.Camera))
{
// The user authorized use of the camera.
Debug.Log("Camera permission already granted.");
}
else
{
bool useCallbacks = true; // Set to true to use callbacks
if (!useCallbacks)
{
// We do not have permission to use the camera.
// Ask for permission or proceed without the functionality enabled.
Permission.RequestUserPermission(Permission.Camera);
}
else
{
var callbacks = new PermissionCallbacks();
callbacks.PermissionDenied += PermissionCallbacks_PermissionDenied;
callbacks.PermissionGranted += PermissionCallbacks_PermissionGranted;
callbacks.PermissionDeniedAndDontAskAgain += PermissionCallbacks_PermissionDeniedAndDontAskAgain;
Permission.RequestUserPermission(Permission.Camera, callbacks);
}
}
}
}
This still did not fix the issue.
We are just confused as to why the given sample is not functioning by default. Is there anything that we are missing regarding this issue? Thanks.
Elijahemunoz
Hello Snapdragon Team,
We are having issues with the Camera Frame Access Sample Scene.
For context:
We were given:
ThinkReality A3 Leveno (HMD)
Motorola Edge Plus (Phone)
Versions:
We have tried both the 1.0 and pre-release versions of SnapDragon Spaces, along with each version of Unity, and no configuration seemed to resolve our issue.
We made sure not to change anything with the sample before we ran the apk on our HMD the first time, and it gave us an error:
We already have the Camera Access feature enabled, so we assumed that the issue was permissions.
We then used a script that we got from another forum post that would give permission so that we could use our device's camera:
using UnityEngine;
using UnityEngine.Android;
public class CameraPermissions : MonoBehaviour
{
internal void PermissionCallbacks_PermissionDeniedAndDontAskAgain(string permissionName)
{
Debug.Log($"{permissionName} PermissionDeniedAndDontAskAgain");
}
internal void PermissionCallbacks_PermissionGranted(string permissionName)
{
Debug.Log($"{permissionName} PermissionCallbacks_PermissionGranted");
}
internal void PermissionCallbacks_PermissionDenied(string permissionName)
{
Debug.Log($"{permissionName} PermissionCallbacks_PermissionDenied");
}
void Start()
{
if (Permission.HasUserAuthorizedPermission(Permission.Camera))
{
// The user authorized use of the camera.
Debug.Log("Camera permission already granted.");
}
else
{
bool useCallbacks = true; // Set to true to use callbacks
if (!useCallbacks)
{
// We do not have permission to use the camera.
// Ask for permission or proceed without the functionality enabled.
Permission.RequestUserPermission(Permission.Camera);
}
else
{
var callbacks = new PermissionCallbacks();
callbacks.PermissionDenied += PermissionCallbacks_PermissionDenied;
callbacks.PermissionGranted += PermissionCallbacks_PermissionGranted;
callbacks.PermissionDeniedAndDontAskAgain += PermissionCallbacks_PermissionDeniedAndDontAskAgain;
Permission.RequestUserPermission(Permission.Camera, callbacks);
}
}
}
}
This still did not fix the issue.
We are just confused as to why the given sample is not functioning by default. Is there anything that we are missing regarding this issue? Thanks.