[Q] Need a tad bit of help with using commands

Search This thread

milkydude12

Member
Apr 24, 2012
45
0
K, i've got a wii emulator, but i don't understand how to run these commands !!! +_+

To increase stability on Galaxy S4 and other Adreno 3xx devices with driver v14, you need to root and run the following commands on the device as root.
Code:
echo 0 > /sys/kernel/debug/kgsl/kgsl-3d0/fast_hang_detect
echo 0 > /sys/kernel/debug/kgsl/kgsl-3d0/ft_pagefault_policy
echo 0 > /sys/kernel/debug/kgsl/kgsl-3d0/ft_policy
echo 0 > /sys/kernel/debug/kgsl/kgsl-3d0/ib_check
echo 0 > /sys/kernel/debug/kgsl/kgsl-3d0/long_ib_detect

Can someone please educate me on how this is suppose to work? do i need an android terminal? or how do i go about running these commands?
(yes my phone is rooted)

Thanks

Ryan
 

fffft

Senior Member
Jul 16, 2013
1,973
802
i don't understand how to run these commands

These are system commands and you need to run them from the "command line". The easiest way to do that would be to install a terminal application. Android Terminal Emulator by Jack Palevich is one good choice. Or you could run an adb shell.

After you install terminal emulator, enter

"su" is the command for superuser (root access). Then you can use the system configuration commands that you have for your wii emulator.

If any commands need to be reentered each time you use your emulator, then you could use a scripting app like gscript light which can be configured to enter these commands from a bookmark. i.e. just click on a bookmark and it will run a set of commands for you.


.
 

milkydude12

Member
Apr 24, 2012
45
0
Hi,

Thanks for replying!!! I've a problem though :(, after i enter su (enter) then grant superuser, i type in echo 0 > /sys/kernel/debug/kgsl/kgsl-3d0/fast_hang_detect
then i get no such file or directory :(, what am i doing wrong???
 

jd1639

Inactive Recognized Contributor
Sep 21, 2012
16,833
5,404
Minnesota
Hi,

Thanks for replying!!! I've a problem though :(, after i enter su (enter) then grant superuser, i type in echo 0 > /sys/kernel/debug/kgsl/kgsl-3d0/fast_hang_detect
then i get no such file or directory :(, what am i doing wrong???

Do you have those directories on your phone? Where did you get the commands to type in? Are they specific to the s4?
 

fffft

Senior Member
Jul 16, 2013
1,973
802
I can't add much more than jd1639 already suggested. These commands would just make a temporary configuration change to half a dozen driver settings in aid of your emulator program. The "echo 0" command ensures that a particular setting is set to "0", if the target file exists.

Check for typos. If there weren't any typos, then it would seem likely that the information from the original thread is inaccurate or out of date. What model of phone are you trying this on? The original thread refers to the i9505 and similar phones. Is your phone a i9505? The fact that you're posting this in an AT&T, et al forum suggest that you might actually have a i337 /i337m phone. Depending on what model you actually have, your phone may have a Snapdragon 800 or Exynos processor rather than the Snapdragon 600.

The drivers may or may not be the same across different phones and processors. Or the drivers names may have changed in a subsequent firmware update. You check your filesystem to see if those paths exist or if the file names can be found elsewhere. Then look to the emulator thread for further guidance.

I had a quick look at a S3 and some, but not all of those files exist. If you find the same thing on your S4, then you'll have to refer to the emulator thread to discern if you need to have all of those items to enable your emulator or if a subset will suffice.

You can probably just create any "missing" files for a workable solution. They're just text files that the drivers refer to for guidance. It's something that I'd at least try in your place. However while I don't perceive any real risk in that i.e. worst case it wouldn't boot and you'd need to restore a backup.. don't look to me if your phone unexpectedly wimpers, fails or becomes sentient and disagrees. Anything you actually do is at your own risk.

You can search paths and file names as follows below. And you should be able to use the touch, mv or cp commands (or install a text editor) to create a missing file.

$ su
# cd /sys/kernel/debug/kgsl/kgsl-3d0
# ls -la
# find / -name fast_hang_detect


.
 
Last edited:

milkydude12

Member
Apr 24, 2012
45
0
I can't add much more than jd1639 already suggested. These commands would just make a temporary configuration change to half a dozen driver settings in aid of your emulator program. The "echo 0" command ensures that a particular setting is set to "0", if the target file exists.

Check for typos. If there weren't any typos, then it would seem likely that the information from the original thread is inaccurate or out of date. What model of phone are trying this on? The original thread refers to the i9505 and similar phones. Is your phone a i9505? The fact that you're posting this in an AT&T, et al forum suggest that you might actually have a i337 /i337m phone. Depending on what model you actually have, your phone may have a Snapdragon 800 or Exynos processor rather than the Snapdragon 600.

The drivers may or may not be the same across different phones and processors. Or the drivers names may have changed in a subsequent firmware update. You should look at your filesystem as jd1639 suggested to see if those paths exist or if the file names can be found elsewhere. And if necessary, re-read the emulator thread for further guidance.

I had a quick look at a S3 and some, but not all of those files exist. If you find the same thing on your S4, then you'll have to refer to the emulator thread to discern if you need to have all of those items to enable your emulator or if a subset will suffice.

You can probably just create any "missing" files for a workable solution. They're just text files that the drivers refer to for guidance. It's something that I'd at least try in your place. However while I don't perceive any real risk in that i.e. worst case it wouldn't boot and you'd need to restore a backup.. don't look to me if your phone unexpectedly wimpers, fails or becomes sentient and disagrees. Anything you actually do is at your own risk.

You can search paths and file names as follows below. And you should be able to use the touch, mv or cp commands to create a missing file.

$ su
# cd /sys/kernel/debug/kgsl/kgsl-3d0
# ls -la
# find / -name fast_hang_detect


.

Hi, I have the I337m variety of the Samsung S4 will that make a difference?
 

fffft

Senior Member
Jul 16, 2013
1,973
802
Hi, I have the I337m variety of the Samsung S4 will that make a difference?

The answer to that will be in your emulator thread.

More to the point, you haven't done your homework yet. Do those paths and files exist on your phone? Does the emulator thread clarify if all of those settings are required? And did you try creating any missing files? People are trying to help you here, but we can't see what your phone screen actually shows. And you should be doing most of the work to see what does or doesn't work.


.
 

milkydude12

Member
Apr 24, 2012
45
0
u0_a283@jfltecan:/ $ su
root@jfltecan:/ # cd /sys/kernal/debugkgsl-3d0
tmp-mksh: cd: /sys/kernal/debugkgsl-3d0: No such file or directory
2|root@jfltecan:/ # ls -la
-rw-r--r-- root root 4721 1969-12-31 17:00 MSM8960_lpm.rc
drwxr-xr-x root root 1970-05-26 22:16 acct
drwxrwx--- system cache 2014-02-07 20:41 cache-rwxr-x--- root root 268036 1969-12-31 17:00 charger
dr-x------ root root 1970-05-26 22:16 config
lrwxrwxrwx root root 1970-05-26 22:16 d -> /sys/kernel/debug
drwxrwx--x system system 2014-02-07 19:42 data
drwxrwx--- system system 1970-05-26 22:16 data_1
drwxrwx--- system system 1970-05-26 22:16 data_2
drwxrwx--- system system 1970-05-26 22:16 data_3
-rw-r--r-- root root 165 1969-12-31 17:00 default.prop
drwxr-xr-x root root 2014-02-07 01:35 dev
drwxrwx--x system radio 2014-01-31 20:30 efs
lrwxrwxrwx root root 1970-05-26 22:16 etc -> /system/etc
-rw-r--r-- root root 21233 1969-12-31 17:00 file_contexts
dr-xr-x--- system system 1970-05-26 22:16 firmware
dr-xr-x--- system system 1970-05-26 22:16 firmware-mdm
-rw-r----- root root 1494 1969-12-31 17:00 fstab.qcom
-rwxr-x--- root root 171036 1969-12-31 17:00 init
-rwxr-x--- root root 3068 1969-12-31 17:00 init.carrier.rc
-rwxr-x--- root root 769 1969-12-31 17:00 init.container.rc
-rwxr-x--- root root 6737 1969-12-31 17:00 init.qcom.class_core.sh
-rwxr-x--- root root 2320 1969-12-31 17:00 init.qcom.class_main.sh
-rwxr-x--- root root 4266 1969-12-31 17:00 init.qcom.early_boot.sh
-rwxr-x--- root root 5142 1969-12-31 17:00 init.qcom.lpm_boot.sh
-rwxr-x--- root root 22920 1969-12-31 17:00 init.qcom.rc
-rwxr-x--- root root 3045 1969-12-31 17:00 init.qcom.ril.sh
-rwxr-x--- root root 4486 1969-12-31 17:00 init.qcom.sh
-rwxr-x--- root root 3830 1969-12-31 17:00 init.qcom.syspart_fixup.sh
-rwxr-x--- root root 35468 1969-12-31 17:00 init.qcom.usb.rc
-rwxr-x--- root root 6004 1969-12-31 17:00 init.qcom.usb.sh
-rwxr-x--- root root 41170 1969-12-31 17:00 init.rc
-rwxr-x--- root root 9314 1969-12-31 17:00 init.target.rc
-rwxr-x--- root root 1795 1969-12-31 17:00 init.trace.rc
-rwxr-x--- root root 3915 1969-12-31 17:00 init.usb.rc
drwxrwxr-x root system 1970-05-26 22:16 mnt
drwxrwxr-x root system 1970-05-26 22:16 mnt_1drwxr-xr-x system system 1970-05-26 22:16 persdata
drwxrwx--x system system 1970-05-26 22:16 preload
dr-xr-xr-x root root 1969-12-31 17:00 proc
-rw-r--r-- root root 2838 1969-12-31 17:00 property_contexts
drwxr-xr-x root root 1969-12-31 17:00 res
drwx------ root root 2013-11-15 08:26 root
drwxr-x--- root root 1969-12-31 17:00 sbin
lrwxrwxrwx root root 1970-05-26 22:16 sdcard -> /storage/emulated/legacy
-rw-r--r-- root root 3887 1969-12-31 17:00 seapp_contexts
-rw-r--r-- root root 610434 1969-12-31 17:00 sepolicy
-rw-r--r-- root root 207 1969-12-31 17:00 sepolicy_version
dr-xr-x--- system sdcard_r 1970-05-26 22:16 storage
dr-xr-xr-x root root 1970-05-26 22:16 sys
drwxr-xr-x root root 1970-03-21 22:11 system
drwxr-xr-x root root 2014-01-31 20:30 tmp-mksh
lrwxrwxrwx root root 1970-05-26 22:16 tombstones -> /data/tombstones
-rw-r--r-- root root 6662 1969-12-31 17:00 ueventd.qcom.rc
-rw-r--r-- root root 4794 1969-12-31 17:00 ueventd.rc
lrwxrwxrwx root root 1970-05-26 22:16 vendor -> /system/vendor
root@jfltecan:/ # find / -namefast_hang_detect
find: unrecognized: -namefast_hang_detect
BusyBox v1.21.1-Stericson (2013-09-26 14:33:26 BST) multi-call binary.

Usage: find [PATH]... [OPTIONS] [ACTIONS]

Search for files and perform actions on them.
First failed action stops processing of current file.
Defaults: PATH is current directory, action is '-print'

-follow Follow symlinks
-xdev Don't descend directories on other filesystems
-maxdepth N Descend at most N levels. -maxdepth 0 applies
actions to command line arguments only
-mindepth N Don't act on first N levels
-depth Act on directory *after* traversing it

Actions:
( ACTIONS ) Group actions for -o / -a
! ACT Invert ACT's success/failure
ACT1 [-a] ACT2 If ACT1 fails, stop, else do ACT2
ACT1 -o ACT2 If ACT1 succeeds, stop, else do ACT2 Note: -a has higher priority than -o -name PATTERN Match file name (w/o directory name) to PATTERN
-iname PATTERN Case insensitive -name
-path PATTERN Match path to PATTERN
-ipath PATTERN Case insensitive -path
-regex PATTERN Match path to regex PATTERN
-type X File type is X (one of: f,d,l,b,c,...)
-perm MASK At least one mask bit (+MASK), all bits (-MASK),
or exactly MASK bits are set in file's mode
-mtime DAYS mtime is greater than (+N), less than (-N),
or exactly N days in the past
-mmin MINS mtime is greater than (+N), less than (-N),
or exactly N minutes in the past
-newer FILE mtime is more recent than FILE's
-inum N File has inode number N
-user NAME/ID File is owned by given user
-group NAME/ID File is owned by given group
-size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.))
+/-N: file size is bigger/smaller than N
-links N Number of links is greater than (+N), less than (-N),
or exactly N
-prune If current file is directory, don't descend into it
If none of the following actions is specified, -print is assumed
-print Print file name
-print0 Print file name, NUL terminated
-exec CMD ARG ; Run CMD with all instances of {} replaced by
file name. Fails if CMD exits with nonzero
-delete Delete current file/directory. Turns on -depth option

1|root@jfltecan:/ #




That is what i get, for the life of me i can't figure out if that means i have it or i don't. "On the Thread it says To increase stability on Galaxy S4 and other Adreno 3xx devices with driver v14, you need to root and run the following commands on the device as root."
So I'm assuming i require all of them to work in order for any difference. Certain sites list the I337m varient as one of which supports Open Gl ES 3 so i assume it would work :(
 

fffft

Senior Member
Jul 16, 2013
1,973
802
All right, I can understand how a lot of this might be a challenge to understand if you have no experience with linux. But you at least need to make sure that you aren't making typos when using these commands.

e.g.
root@jfltecan:/ # find / -namefast_hang_detect

You missed a space between -name and the actual file name. And yes, that is critical. Nothing here is likely to work if you have typos. Try the following and paste the results back here. And I or someone else will better understand what is going on::

$ su
# cd /sys/kernel/debug/kgsl/kgsl-3d0
# ls -la

(exactly as above and paste the result for us).

If you are ambitious then also try the following for any "missing" files and let us know if that succeeds in getting your emulator up and running.

e.g.
# touch /sys/kernel/debug/kgsl/kgsl-3d0/fast_hang_detect
# echo 0 > /sys/kernel/debug/kgsl/kgsl-3d0/fast_hang_detect


.
 

milkydude12

Member
Apr 24, 2012
45
0
:S thanks i didn't know i had missed a space, and yea i have little to no experience with linux.

u0_a283@jfltecan:/ $ su
root@jfltecan:/ # cd /sys/kernal/debug/kgsl/3d0
tmp-mksh: cd: /sys/kernal/debug/kgsl/3d0: No such file or directory
2|root@jfltecan:/ # ls -la
-rw-r--r-- root root 4721 1969-12-31 17:00 MSM8960_lpm.rc
drwxr-xr-x root root 1970-05-26 22:16 acct
drwxrwx--- system cache 2014-02-07 22:44 cache
-rwxr-x--- root root 268036 1969-12-31 17:00 charger
dr-x------ root root 1970-05-26 22:16 config
lrwxrwxrwx root root 1970-05-26 22:16 d -> /sys/kernel/debug
drwxrwx--x system system 2014-02-07 19:42 data
drwxrwx--- system system 1970-05-26 22:16 data_1
drwxrwx--- system system 1970-05-26 22:16 data_2
drwxrwx--- system system 1970-05-26 22:16 data_3
-rw-r--r-- root root 165 1969-12-31 17:00 default.prop
drwxr-xr-x root root 2014-02-07 01:35 dev
drwxrwx--x system radio 2014-01-31 20:30 efs
lrwxrwxrwx root root 1970-05-26 22:16 etc -> /system/etc
-rw-r--r-- root root 21233 1969-12-31 17:00 file_contexts
dr-xr-x--- system system 1970-05-26 22:16 firmware
dr-xr-x--- system system 1970-05-26 22:16 firmware-mdm
-rw-r----- root root 1494 1969-12-31 17:00 fstab.qcom
-rwxr-x--- root root 171036 1969-12-31 17:00 init
-rwxr-x--- root root 3068 1969-12-31 17:00 init.carrier.rc
-rwxr-x--- root root 769 1969-12-31 17:00 init.container.rc
-rwxr-x--- root root 6737 1969-12-31 17:00 init.qcom.class_core.sh
-rwxr-x--- root root 2320 1969-12-31 17:00 init.qcom.class_main.sh
-rwxr-x--- root root 4266 1969-12-31 17:00 init.qcom.early_boot.sh
-rwxr-x--- root root 5142 1969-12-31 17:00 init.qcom.lpm_boot.sh
-rwxr-x--- root root 22920 1969-12-31 17:00 init.qcom.rc
-rwxr-x--- root root 3045 1969-12-31 17:00 init.qcom.ril.sh
-rwxr-x--- root root 4486 1969-12-31 17:00 init.qcom.sh
-rwxr-x--- root root 3830 1969-12-31 17:00 init.qcom.syspart_fixup.sh
-rwxr-x--- root root 35468 1969-12-31 17:00 init.qcom.usb.rc
-rwxr-x--- root root 6004 1969-12-31 17:00 init.qcom.usb.sh
-rwxr-x--- root root 41170 1969-12-31 17:00 init.rc
-rwxr-x--- root root 9314 1969-12-31 17:00 init.target.rc
-rwxr-x--- root root 1795 1969-12-31 17:00 init.trace.rc
-rwxr-x--- root root 3915 1969-12-31 17:00 init.usb.rc
drwxrwxr-x root system 1970-05-26 22:16 mnt
drwxrwxr-x root system 1970-05-26 22:16 mnt_1
drwxr-xr-x system system 1970-05-26 22:16 persdata
drwxrwx--x system system 1970-05-26 22:16 preload
dr-xr-xr-x root root 1969-12-31 17:00 proc
-rw-r--r-- root root 2838 1969-12-31 17:00 property_contexts
drwxr-xr-x root root 1969-12-31 17:00 res
drwx------ root root 2013-11-15 08:26 root
drwxr-x--- root root 1969-12-31 17:00 sbin
lrwxrwxrwx root root 1970-05-26 22:16 sdcard -> /storage/emulated/legacy
-rw-r--r-- root root 3887 1969-12-31 17:00 seapp_contexts
-rw-r--r-- root root 610434 1969-12-31 17:00 sepolicy
-rw-r--r-- root root 207 1969-12-31 17:00 sepolicy_version
dr-xr-x--- system sdcard_r 1970-05-26 22:16 storage
dr-xr-xr-x root root 1970-05-26 22:16 sys
drwxr-xr-x root root 1970-03-21 22:11 system
drwxr-xr-x root root 2014-01-31 20:30 tmp-mksh
lrwxrwxrwx root root 1970-05-26 22:16 tombstones -> /data/tombstones
-rw-r--r-- root root 6662 1969-12-31 17:00 ueventd.qcom.rc
-rw-r--r-- root root 4794 1969-12-31 17:00 ueventd.rc
lrwxrwxrwx root root 1970-05-26 22:16 vendor -> /system/vendor
root@jfltecan:/ # find / -name fast_hang_detect
find: /proc/718/task/1014/fdinfo/459: No such file or directory
find: /proc/718/task/1015/fd/459: No such file or directory
find: /proc/718/task/1040/fd/459: No such file or directory
find: /proc/718/task/1331/fd/459: No such file or directory
find: /proc/718/task/1702/fd/459: No such file or directory
find: /proc/718/task/15245/fdinfo/459: No such file or directory
1|root@jfltecan:/ # touch /sys/kernal/debug/kgsl/kgsl-3d0/fast_hang_detect
gsl/kgsl-3d0/fast_hang_detect <
tmp-mksh: can't create /sys/kernal/debug/kgsl/kgsl-3d0/fast_hang_detect: No such file or directory
1|root@jfltecan:/ #
 

fffft

Senior Member
Jul 16, 2013
1,973
802
You're still making multiple typos, so we didn't get the information that we need.


.

.
 

milkydude12

Member
Apr 24, 2012
45
0
After fixing all my typos and spending hours trying to get it to work, ive come to the conclusion, yea ive got the wrong phone model :S .... well that was a waste of time
:cyclops: