fixed, MXS sticks need a permissions hammer
authordavilla <davilla@4pi.com>
Fri, 22 Feb 2013 17:08:18 +0000 (12:08 -0500)
committerTrent Nelson <trent.a.b.nelson@gmail.com>
Mon, 11 Nov 2013 01:33:24 +0000 (20:33 -0500)
xbmc/utils/AMLUtils.cpp
xbmc/utils/AMLUtils.h
xbmc/windowing/egl/EGLNativeTypeAndroid.cpp

index 6104c54..4986169 100644 (file)
@@ -100,6 +100,28 @@ bool aml_present()
   return has_aml;
 }
 
+void aml_permissions()
+{
+  // most all aml devices are already rooted.
+  int ret = system("ls /system/xbin/su");
+  if (ret != 0)
+  {
+    CLog::Log(LOGWARNING, "aml_permissions: missing su, playback might fail");
+  }
+  else
+  {
+    // certain aml devices have 664 permission, we need 666.
+    system("su -c chmod 666 /sys/class/video/axis");
+    system("su -c chmod 666 /sys/class/video/screen_mode");
+    system("su -c chmod 666 /sys/class/video/disable_video");
+    system("su -c chmod 666 /sys/class/tsync/pts_pcrscr");
+    system("su -c chmod 666 /sys/class/audiodsp/digital_raw");
+    system("su -c chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq");
+    system("su -c chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq");
+    CLog::Log(LOGINFO, "aml_permissions: permissions changed");
+  }
+}
+
 int aml_get_cputype()
 {
   static int aml_cputype = -1;
index d90fd5a..34fe519 100644 (file)
@@ -25,6 +25,7 @@ int aml_set_sysfs_int(const char *path, const int val);
 int aml_get_sysfs_int(const char *path);
 
 bool aml_present();
+void aml_permissions();
 int  aml_get_cputype();
 void aml_cpufreq_limit(bool limit);
 void aml_set_audio_passthrough(bool passthrough);
index 5f68630..105e50b 100644 (file)
@@ -43,6 +43,10 @@ bool CEGLNativeTypeAndroid::CheckCompatibility()
 
 void CEGLNativeTypeAndroid::Initialize()
 {
+#if defined(TARGET_ANDROID) && (defined(HAS_AMLPLAYER) || defined(HAS_LIBAMCODEC))
+  aml_permissions();
+#endif
+
   return;
 }
 void CEGLNativeTypeAndroid::Destroy()