GPS for your Nook? - Nook Touch General

Maybe you've thought, "Oh, if only I had GPS on me ereader I could have it log locations so that it could tell me exactly where I read the last page of Jane Eyre".
Or you could use it for hiking/mapping applications.
I presume that this thread will be more for amusement than actual instruction.
I have a Glow3. I prefer Glow2's for normal reading.
I have a GPS module, the GP-2106.
It's small, not being sold anymore.
The lower corner of the Glow3 PCB is only ground plane with no traces.
You can cut out a bunch of it, then you have about 1/4" depth to put stuff.
The only accessible UART is UART4 (/dev/ttymxc3) since we want to keep the original console in place.
That UART is not already configured or existing as a /dev/
The GP-2106 uses 1.8V interfaces and supply.
I modified the kernel (not rebuilt, just hex modified) to initialize UART4.
I stole 1.8V power supply off a bus.
Currently I am using this directly in an application and not implemented as a LocationProvider (yet).
I have a JNI NDK thread that reads the NMEA data and parses it.
Shown is my own little hiking app that uses my own KML maps.
(On other devices I use this with the standard built-in LocationProvider.)
Yes, the grab is in color, although the Nook is obviously black & white.
That's a bit of a con, but the visibility in bright sunlight is a plus.

So, I took a look at how the whole Android GPS worked.
In the Secure settings you have:
location_providers_allowed = gps
location_mode = 3 (3 = high accuracy, 0 = off)
In /system/framework/framework.jar is android.location.LocationManager
In /system/framework/services.jar is com.android.server.location.GpsLocationProvider
This tries to read /etc/gps.conf (which gives you network resources like NTP and is not strictly required, it's not present)
This uses native code like "native_agps_..." in:
/system/lib/libandroid_servers.so
This uses hw_get_module() in:
/system/lib/libhardware.so
Which uses a search for hardware HAL modules to load, like
/system/lib/hw/gps.default.so
Which does not exist on our Glows
I made a junk file and libhardware.so does try to load it (and fails)
Code:
E/HAL ( 2461): load: module=/system/lib/hw/gps.default.so
E/HAL ( 2461): dlopen failed: "/system/lib/hw/gps.default.so" is too small to be an ELF executable
There are some projects out there for building a generic gps.default.so
FWIW, the whole meat of GPS is in this file, i.e. NMEA decoders, callbacks...
I'll be trying to do that later.
Edit: Well, I built a gps.default.so and it seems to work fine, but somewhere along the way I misplaced my serial port.
In any case:
Code:
GPS: [email protected]

Renate NST said:
So, I took a look at how the whole Android GPS worked.
In the Secure settings you have:
location_providers_allowed = gps
location_mode = 3 (3 = high accuracy, 0 = off)
In /system/framework/framework.jar is android.location.LocationManager
In /system/framework/services.jar is com.android.server.location.GpsLocationProvider
This tries to read /etc/gps.conf (which gives you network resources like NTP and is not strictly required, it's not present)
This uses native code like "native_agps_..." in:
/system/lib/libandroid_servers.so
This uses hw_get_module() in:
/system/lib/libhardware.so
Which uses a search for hardware HAL modules to load, like
/system/lib/hw/gps.default.so
Which does not exist on our Glows
I made a junk file and libhardware.so does try to load it (and fails)
Code:
E/HAL ( 2461): load: module=/system/lib/hw/gps.default.so
E/HAL ( 2461): dlopen failed: "/system/lib/hw/gps.default.so" is too small to be an ELF executable
There are some projects out there for building a generic gps.default.so
FWIW, the whole meat of GPS is in this file, i.e. NMEA decoders, callbacks...
I'll be trying to do that later.
Edit: Well, I built a gps.default.so and it seems to work fine, but somewhere along the way I misplaced my serial port.
In any case:
Code:
GPS: [email protected]
Click to expand...
Click to collapse
Hi Renate !
I was off grid for some time, so i 'm just taking known of your work. Quite impressive, again.
It's look like a very good news, so you made a custom gps.default.so from scratch ?
not sure to undersand perfectly what you mean about misplaced the seral port, but existing projects about generic serial driver seem use directive based from build.prop like this :
Code:
# Custom GPS driver
ro.kernel.android.gps=ttyS1
ro.kernel.android.gps.speed=9600
ro.kernel.android.gps.max_rate=1
BTW you have make a great improvement of GPS support on the NST !
let us know when you will able to release your work
See you later !

liptonthe said:
misplaced the seral port...
Click to expand...
Click to collapse
Oh, I lost track of where the patches for ttymxc3 were.
I found them, tried the built gps.default.so and it was eating all the CPU.
I'll have to do some debugging.
(The GPS module is pretty crappy, slowest fix that I've ever seen.)

Renate NST said:
Oh, I lost track of where the patches for ttymxc3 were.
I found them, tried the built gps.default.so and it was eating all the CPU.
I'll have to do some debugging.
(The GPS module is pretty crappy, slowest fix that I've ever seen.)
Click to expand...
Click to collapse
All right, i guess it would be too easy that work at the first attempt.
But at least it's a progress, i can relate, UsbGps4Droid is not really a fast fix solution too !

Hi @Renate NST, what's up
Did you fix your issue about CPU comsumtion ?
i'm still interessted to try it on my BNRV300 if you want.
See you later.

liptonthe said:
I'm still interested to try it on my BNRV300 if you want.
Click to expand...
Click to collapse
Yeah, the NST gives you a choice of 1.8V or 3.3V also.
I've been busy on other stuff, but I should get back to this.

Renate NST said:
Yeah, the NST gives you a choice of 1.8V or 3.3V also.
I've been busy on other stuff, but I should get back to this.
Click to expand...
Click to collapse
Hi, Okay thats a good news
i'm availble for trying binary's and confs. Let me know when you are ready.

I realized what the problem was with the lost /dev/ttymxc3
I had bodged it into where the Bluetooth goes and it only worked if you had the WiFi on.
I knew this, but I forgot it.
I've got that working a different way now (but I managed to disable the console accidentally).
So now I'm back to something eating all my CPU.
And the stupid GPS module still hasn't gotten a fix after 15 minutes.

Renate NST said:
I realized what the problem was with the lost /dev/ttymxc3
I had bodged it into where the Bluetooth goes and it only worked if you had the WiFi on.
I knew this, but I forgot it.
I've got that working a different way now (but I managed to disable the console accidentally).
So now I'm back to something eating all my CPU.
And the stupid GPS module still hasn't gotten a fix after 15 minutes.
Click to expand...
Click to collapse
Hi Renate !
It look like i have missed the notification of your last response the 10/03..
I'm working myself on the implementation of the gps.default.so from this project : https://github.com/dipcore/gps-glonass-android-driver
i have pushed + chmod the gps.default.so lib in /system/lib/hw/ and edited the /system/build.prop to add :
Code:
# Custom GPS driver
ro.kernel.android.gps=ttyS1
ro.kernel.android.gps.speed=9600
ro.kernel.android.gps.max_rate=1
But actually i'm not able to see anything loading in logcat or dmesg for the moment.
Maybe you could try yourself with this lib ?
---------- Post added at 11:12 PM ---------- Previous post was at 10:35 PM ----------
Actually i set this value but it's not better.
Code:
sqlite> update secure set value=3 where name='location_mode';
sqlite> update secure set value=0 where name='mock_location';
sqlite> update secure set value='gps' where name='location_providers_allowed';
gps.default.so should be natively loaded by HAL scanner as described in the /system/lib/libhardware.so but i don't see it in logs.
Perhaps
Code:
ls /sys/module
seem show the loading of a "garmin_gps" module
Still loaded when gps.default.so is no present in the system, that's strange !
Code:
# ls /sys/module
kernel
printk
wakelock
userwakelock
earlysuspend
spurious
omap3epfb
keyboard
vt
bridgedriver
scsi_mod
sg
usbcore
usb_storage
usbserial
aircable
ark3116
belkin_sa
ch341
cp2101
cyberjack
cypress_m8
digi_acceleport
io_edgeport
io_ti
empeg
ftdi_sio
funsoft
[B]garmin_gps[/B] <---------------
ipaq
ipw
ir_usb
iuu_phoenix
keyspan
keyspan_pda
kl5kusb105
kobil_sct
mct_u232
mos7720
mos7840
navman
omninet
opticon
option
oti6858
pl2303
safe_serial
sierra
spcp8x5
ti_usb_3410_5052
visor
whiteheat
adutux
berry_charge
iowarrior
ldusb
legousbtower
usbtest
musb_hdrc
mousedev
psmouse
omap_hdq
w1_bq27000
usbhid
binder
lowmemorykiller
snd
snd_timer
snd_pcm
snd_dummy
snd_usb_audio
oprofile
rfkill
pvrsrvkm
omaplfb
bc_example
tiwlan_drv

It loads and correctly accesses the GPS module and decodes the NMEA correctly.
You can see that if you edit gps.h and rebuild it.
Code:
#define GPS_DEBUG 1
//#undef GPS_DEBUG
(You get lots more messages.)
My stupid GPS module was being so annoying. It would take 20 minutes to capture.
I've been looking for a new module, but all the small ones use a stupid scheme where pulsing a pin cycles it through various modes.
You can never tell what mode you're in.
In any case, I was still left with the Android world not getting GPS updates and "top" was showing 99% CPU.
Does yours react this way?

Renate NST said:
It loads and correctly accesses the GPS module and decodes the NMEA correctly.
You can see that if you edit gps.h and rebuild it.
Code:
#define GPS_DEBUG 1
//#undef GPS_DEBUG
(You get lots more messages.)
Click to expand...
Click to collapse
Hum great tips ! I've been able to find and edit the .h file but i'm not common with the rebuilt / compile process of C programs.
did you use GCC, make and stuff to do that ?
In any case, I was still left with the Android world not getting GPS updates and "top" was showing 99% CPU.
Does yours react this way?
Click to expand...
Click to collapse
A quick look on "top" was not showing an overstimulated CPU, maybe it's due to the debug params.
---------- Post added at 02:03 AM ---------- Previous post was at 01:55 AM ----------
I'm using a little app to get somes indicatives values about GPS data.
--> https://apkpure.com/just-gps/net.thenumber42.android.justgps
When i launch it i get a pop-up about "The GPS is not enabled" however i have set the settings.db properly.
This app is running like charm when i use the moc location trick.
Maybe i missed something, when this app is launched the result in logcat is :
Code:
E/LocationManagerService( 1026): requestUpdates got exception:
E/LocationManagerService( 1026): java.lang.IllegalArgumentException: provider=gps
E/LocationManagerService( 1026): at com.android.server.LocationManagerService.requestLocationUpdatesLocked(LocationManagerService.java:863)
E/LocationManagerService( 1026): at com.android.server.LocationManagerService.requestLocationUpdates(LocationManagerService.java:833)
E/LocationManagerService( 1026): at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:79)
E/LocationManagerService( 1026): at android.os.Binder.execTransact(Binder.java:287)
E/LocationManagerService( 1026): at com.android.server.SystemServer.init1(Native Method)
E/LocationManagerService( 1026): at com.android.server.SystemServer.main(SystemServer.java:514)
E/LocationManagerService( 1026): at java.lang.reflect.Method.invokeNative(Native Method)
E/LocationManagerService( 1026): at java.lang.reflect.Method.invoke(Method.java:521)
E/LocationManagerService( 1026): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/LocationManagerService( 1026): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/LocationManagerService( 1026): at dalvik.system.NativeStart.main(Native Method)
I/PowerManagerService( 1026): setPowerState: mPowerState=0x3 newState=0x3 noChangeLights=false reason=2
E/LocationManagerService( 1026): isProviderEnabled got exception:
E/LocationManagerService( 1026): java.lang.IllegalArgumentException: provider=gps
E/LocationManagerService( 1026): at com.android.server.LocationManagerService._isProviderEnabledLocked(LocationManagerService.java:1387)
E/LocationManagerService( 1026): at com.android.server.LocationManagerService.isProviderEnabled(LocationManagerService.java:1361)
E/LocationManagerService( 1026): at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:237)
E/LocationManagerService( 1026): at android.os.Binder.execTransact(Binder.java:287)
E/LocationManagerService( 1026): at dalvik.system.NativeStart.run(Native Method)
---------- Post added at 02:31 AM ---------- Previous post was at 02:03 AM ----------
Also i just found this project dedicated to generic serial GPS driver : https://tinkerboarding.co.uk/forum/thread-671.html && https://github.com/joerg65/libGPS_TinkerBoard

Hmm, do you have secure / location_providers_allowed=gps
My GPS is working (when the GPS module finally captures).
The CPU being eaten is possibly unrelated.
It's the Alarm Manager spamming on an alarm set for the year 2000!
It may be trying to set the time constantly.
If I delete gps.default.so it stops.
But, in any case, the clock is not even syncing to the NMEA.
I tried the beaglebone one, it builds fine and does about the same. Oops, I was rebuilding the first one.

Renate NST said:
Hmm, do you have secure / location_providers_allowed=gps
Click to expand...
Click to collapse
I think it should be good, there is my setup sequence :
Code:
adb connect xxx.xxx.x.x:5555
adb shell mount -o rw,remount -t ext2 /dev/block/mmcblk0p5 /system
adb push gps.default.so /system/lib/hw/
adb shell chmod 644 /system/lib/hw/gps.default.so
cd /data/data/com.android.providers.settings/databases
sqlite3 settings.db
update secure set value=3 where name='location_mode';
update secure set value=0 where name='mock_location';
update secure set value='gps' where name='location_providers_allowed';
.q
reboot
But my apps (Oruxmaps or Just GPS) still saying GPS is disabled :/
My GPS is working (when the GPS module finally captures).
Click to expand...
Click to collapse
I'm happy to ear that ! A great improvement I hope reproducing it too.
The CPU being eaten is possibly unrelated.
It's the Alarm Manager spamming on an alarm set for the year 2000!
It may be trying to set the time constantly.
If I delete gps.default.so it stops.
Click to expand...
Click to collapse
A really strange glitch..
But yes it's could be the time updating system, but the alarm.. this is really strange.
But, in any case, the clock is not even syncing to the NMEA.
Click to expand...
Click to collapse
That's strange because that should be updated ! maybe this is a linked to the high power consumtion (infinite retry of time setup after failed attempt ?)
I tried the beaglebone one, it builds fine and does about the same. Oops, I was rebuilding the first one.
Click to expand...
Click to collapse
I'm not sure to understand, do you try the other GPS project's lib ?
---------- Post added at 12:26 AM ---------- Previous post was at 12:24 AM ----------
Maybe you could share me the lib you recompile with log enabled ?
---------- Post added at 12:50 AM ---------- Previous post was at 12:26 AM ----------
It seem this command has no effect in my case :
Code:
sqlite> update secure set value=3 where name='location_mode';
I can't see it in the DB
Code:
sqlite> select * from secure;
1|android_id|1e70509c-cb20-4b12-8ce2-2a3fce741da9
2|bluetooth_on|0
3|data_roaming|1
4|install_non_market_apps|1
5|location_providers_allowed|gps
6|assisted_gps_enabled|1
7|network_preference|1
8|usb_mass_storage_enabled|1
11|wifi_networks_available_notification_on|0
12|preferred_network_mode|0
13|cdma_cell_broadcast_sms|1
14|preferred_cdma_subscription|1
15|mock_location|0
16|backup_enabled|0
17|backup_transport|
18|demo_mode|off
19|wifi_max_restart_supplicant_attempts|3
20|enabled_input_methods|com.android.inputmethod.latin/.LatinIME
26|device_provisioned|1
274|wifi_on|1
277|default_input_method|com.android.inputmethod.latin/.LatinIME
278|adb_enabled|0
sqlite>
---------- Post added at 01:17 AM ---------- Previous post was at 12:50 AM ----------
I just create a row mannualy in the DB.
But i still gett "GPS disabled in apps"
Code:
insert into secure (name) VALUES('location_mode');
Code:
select * from secure;
...
279|location_mode|3
...

Hello @Renate NST
I've retry to setup the gps library on a brand new NST BNRV300 from ebay this week to create an second topographic eReader like mine.
The result is the same i'm stuck with the gps.default.so, i don't know how to rebuilt it to integrate debug and check if it's loaded correctly. On the other hand it seem the OS has not GPS settings enabled. (But my params has been pushed successfully by sqlite). i'm really confused about that point.
I'm still getting thoses errors in logcat when i'm launching an app with GPS location needs :
Code:
E/LocationManagerService( 822): requestUpdates got exception:
E/LocationManagerService( 822): java.lang.IllegalArgumentException: provider=gps
E/LocationManagerService( 822): at com.android.server.LocationManagerService.requestLocationUpdatesLocked(LocationManagerService.java:863)
E/LocationManagerService( 822): at com.android.server.LocationManagerService.requestLocationUpdates(LocationManagerService.java:833)
E/LocationManagerService( 822): at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:79)
E/LocationManagerService( 822): at android.os.Binder.execTransact(Binder.java:287)
E/LocationManagerService( 822): at dalvik.system.NativeStart.run(Native Method)
I/PowerManagerService( 822): setPowerState: mPowerState=0x3 newState=0x3 noChangeLights=false reason=2
E/LocationManagerService( 822): isProviderEnabled got exception:
E/LocationManagerService( 822): java.lang.IllegalArgumentException: provider=gps
E/LocationManagerService( 822): at com.android.server.LocationManagerService._isProviderEnabledLocked(LocationManagerService.java:1387)
E/LocationManagerService( 822): at com.android.server.LocationManagerService.isProviderEnabled(LocationManagerService.java:1361)
E/LocationManagerService( 822): at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:237)
E/LocationManagerService( 822): at android.os.Binder.execTransact(Binder.java:287)
E/LocationManagerService( 822): at dalvik.system.NativeStart.run(Native Method)
I guess the glowlight 3 you are using has some differences about that in the firmware.
Do you have an opinion on that ?
##### Other Subject #####
I just read your thread about the SD card soldering perfomed on Glows 2/3/4 and it's very interesting
I will maybe buy a BNRV510 (Glow2) and try to reproduce the SD card mod but also soldering a GPS on the UART. I'm not totally sure but i guess it will be easier to make it work natively with a 4.4 Android OS.
The BNRV510 is waterproof, has SD card (after mod) and an UART serial input so it's a good setup for me but i'm not aware about what expect.
Advices ?
By the way, thank's for your time !

Yeah, I've got to get back on this.
I had tried the two different sources for gps.default.so, the one with a bunch of files, the one with one big source file.
I'm just building them using the stock Android NDK toolchain.
The bunch-of build is detected as GPS but it does weird stuff like using NaN for no fix and I think it's reporting erroneous time which drives the AlarmManager crazy and eats CPU.
The big-file build is not recognized as GPS. I haven't really looked at it, but it doesn't touch the serial port at all.
When troubleshooting it helps to look at the serial port and see if the driver has set baud rate and characteristics.
Code:
# busybox stty -F /dev/ttymxc3
(Or whichever your device is.)
You should be able to cat it and see NMEA sentences. (Although it "steals" the text while you are doing this.)
Code:
# cat /dev/ttymxc3
Are you sure that your serial port is accessible?
I added this to ueventd.rc
Code:
/dev/ttymxc3 0666 root root
Adding an SD card on the Glow2 & Glow4 is easy.
The Glow3 needs a kernel mod and/or NTX hwcfg mod.
Oh! I see a problem with my build of the single-source gps.default.so:
Code:
E/HAL ( 2454): dlopen failed: cannot locate symbol "floor" referenced by "gps.default.so"...
Interesting, the other one didn't use math.
Also, I had to patch the source to understand 4800 baud, slow, but the official baud for NMEA-0183.
So, here's gps.default.txt, just rename it gps.default.so (it's not zipped or anything).
MD5=4c3eb7408a1ef94ec90ea44d045b7df2
The setup goes in /system/etc/gps.conf (not in build.prop like the other one).
Code:
GPSPORT /dev/ttymxc3
GPSSPEED 4800

Renate NST said:
When troubleshooting it helps to look at the serial port and see if the driver has set baud rate and characteristics.
Code:
# busybox stty -F /dev/ttymxc3
(Or whichever your device is.)
Click to expand...
Click to collapse
Yes, the GP-735 is running well at 9600 baud on ttyS1 in my case :
Code:
# busybox stty -F /dev/ttyS1
speed 9600 baud;
Renate NST said:
You should be able to cat it and see NMEA sentences. (Although it "steals" the text while you are doing this.)
Code:
# cat /dev/ttymxc3
Click to expand...
Click to collapse
Yeap this is work perfectly too, i'm able to see NMEA sentences :
Code:
# cat /dev/ttyS1
$GPRMC,224350.00,V,,,,,,,271120,,,N*78
$GPVTG,,,,,,,,,N*30
$GPGGA,224350.00,,,,,0,00,99.99,,,,,,*64
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,02,26,,,33,30,,,24*7A
$GPGLL,,,,,224350.00,V,N*48
Renate NST said:
Are you sure that your serial port is accessible?
I added this to ueventd.rc
Code:
/dev/ttymxc3 0666 root root
Click to expand...
Click to collapse
Yes it was 0660, but worked perfectly with the UsbGps app.
But i changed it to try with 0666, it seem not changing the matter.
Renate NST said:
Adding an SD card on the Glow2 & Glow4 is easy.
The Glow3 needs a kernel mod and/or NTX hwcfg mod.
Click to expand...
Click to collapse
This is a very good news, do you think the UART serial port is also ready to use on the Glow2 ?
Renate NST said:
Oh! I see a problem with my build of the single-source gps.default.so:
Code:
E/HAL ( 2454): dlopen failed: cannot locate symbol "floor" referenced by "gps.default.so"...
Interesting, the other one didn't use math.
Also, I had to patch the source to understand 4800 baud, slow, but the official baud for NMEA-0183.
So, here's gps.default.txt, just rename it gps.default.so (it's not zipped or anything).
MD5=4c3eb7408a1ef94ec90ea44d045b7df2
The setup goes in /system/etc/gps.conf (not in build.prop like the other one).
Code:
GPSPORT /dev/ttymxc3
GPSSPEED 4800
Click to expand...
Click to collapse
Thank's you, i have tried with the gps.default.so an gps.conf you provide (but with adapted params).
I'm not able to see anything in logcat or dmesg at this time. But the error about GPS not enabled in Android still present.
This last error is not a problem with the lib for sure but with the android system itself about his settings parameters. I will continue to try things with the settings.db

Since you're using the default of 9600 that won't tell you anything.
If stty says "echo" then the driver hasn't touched it.
It should show "-echo".
Check to see if it even tried to load.
I'll get you the debug version in a bit.
Edit: Charging up my old Nook NST to check what the scoop with that is...
Edit^2: What I posted above is actually the verbose one (that spams logcat) but works fine on the Glows.
The NST needs a different build.
I'll post a non-logcat-spamming versions for the Glows in a bit.

Renate NST said:
Since you're using the default of 9600 that won't tell you anything.
If stty says "echo" then the driver hasn't touched it.
It should show "-echo".
Check to see if it even tried to load.
I'll get you the debug version in a bit.
Click to expand...
Click to collapse
I guess i have understand what you want mean. It's about using the "GPSSPEED" value to check with stty if the lib module is correctly loaded by alterating the link speed ?
So to test it i have changed the value to 4800 has you recommanded. But the stty stil give back the 9600 default value.
Code:
# busybox stty -F /dev/ttyS1
speed 9600 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-brkint -imaxbel
#
nothing revelent about :
Code:
/ # dmesg | grep gps
/ # logcat | grep gps
Renate NST said:
Edit: Charging up my old Nook NST to check what the scoop with that is...
Edit^2: What I posted above is actually the verbose one (that spams logcat) but works fine on the Glows.
The NST needs a different build.
I'll post a non-logcat-spamming versions for the Glows in a bit.
Click to expand...
Click to collapse
Alright !

[If I can only figure out how this forum works now...]
Ok, so the problem was getting this to run on the NST, which is still running Android 2.1, API 7.
Android forced us to Clang for builds, there's an incompatibility with libdl.so, dladdr() is too modern.
So, here's a version that should work on both old and new.
I haven't double-checked it on the Glow3 yet.
It loads on the NST but I don't have any hardware check of it yet.
This is called gps.default.txt, rename it gps.default.so
MD5 188477c37d86b7a3ae43573e7174238b

Related

NTP server dead

Regardless of ROM used, I always see this line in logcat:
Code:
D/GpsLocationProvider( 162): NetworkThread out of wake loop
D/GpsLocationProvider( 162): Requesting time from NTP server north-america.pool.ntp.org
D/SntpClient( 162): request time failed: java.net.SocketTimeoutException: The operation timed out
D/GpsLocationProvider( 162): requestTime failed
D/GpsLocationProvider( 162): NetworkThread wait for 300000ms
north-america.pool.ntp.org host always appears to be dead, so is there any way to change it to something alive? Like pool.ntp.org?
Time sync is quite important as GPS fix delay depends on it.
As you are in canada, try ca.pool.ntp.org.
For what its worth my time even w/o a sim always set itself over wifi. But i have not checked the logs. Is ntp configurable via the gui somewhere?
Vadimus_ca said:
Regardless of ROM used, I always see this line in logcat:
Code:
D/GpsLocationProvider( 162): NetworkThread out of wake loop
D/GpsLocationProvider( 162): Requesting time from NTP server north-america.pool.ntp.org
D/SntpClient( 162): request time failed: java.net.SocketTimeoutException: The operation timed out
D/GpsLocationProvider( 162): requestTime failed
D/GpsLocationProvider( 162): NetworkThread wait for 300000ms
north-america.pool.ntp.org host always appears to be dead, so is there any way to change it to something alive? Like pool.ntp.org?
Time sync is quite important as GPS fix delay depends on it.
Click to expand...
Click to collapse
Thanks for pointing this out, I need to change my router's NTP server now.
I'm trying to find where time server hostnames are kept. For now you could do a simple /etc/hosts hack and reroute that hostname to a working NTP server.
EDIT: It's in /system/etc/gps.conf
grep rules, found it in /system/etc/gps.conf:
Code:
NTP_SERVER=[COLOR="Red"]north-america.pool.ntp.org[/COLOR]
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
SUPL_HOST=supl.google.com
SUPL_PORT=7276
Vadimus_ca said:
grep rules, found it in /system/etc/gps.conf:
Code:
NTP_SERVER=[COLOR="Red"]north-america.pool.ntp.org[/COLOR]
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
SUPL_HOST=supl.google.com
SUPL_PORT=7276
Click to expand...
Click to collapse
Yea a bit late for that, but two is better than 1 I guess.
If anyone wants to do the fix easily just do:
Code:
mount -o rw,remount -t rootfs /
sed -i 's/north-america.//g' /system/etc/gps.conf
in a terminal or:
Code:
adb remount
adb shell sed -i 's/north-america.//g' /system/etc/gps.conf
with adb
Requires a reboot
happyface_0 said:
Yea a bit late for that, but two is better than 1 I guess.
If anyone wants to do the fix easily just do:
Code:
mount -o rw,remount -t rootfs /
sed -i 's/north-america.//g' /system/etc/gps.conf
in a terminal or:
Code:
adb remount
adb shell sed -i 's/north-america.//g' /system/etc/gps.conf
with adb
Requires a reboot
Click to expand...
Click to collapse
Great! I had to pull it out, edit and push it back.
By the way is there any way to use cursor keys in vi either in terminal emulator on the phone, or using adb shell? First does not have keys, second does not follow ANSI emulation...
Vadimus_ca said:
By the way is there any way to use cursor keys in vi either in terminal emulator on the phone, or using adb shell? First does not have keys, second does not follow ANSI emulation...
Click to expand...
Click to collapse
I know that in a ConnectBot terminal (including local), the trackball maps to the cursor keys, which works fine in vi. Your terminal of choice may vary.
olearyp said:
I know that in a ConnectBot terminal (including local), the trackball maps to the cursor keys, which works fine in vi. Your terminal of choice may vary.
Click to expand...
Click to collapse
Thanks, I will try it!
That is pretty weird, the hostname "north-america.pool.ntp.org" is not a single server but rather a load-balanced virtual host to many different servers in a pool - currently over 600 servers!
The likelihood of all them being down is probably impossible, I wonder if this is something like your provider restricting certain ports for network security? If you are running DroidWall, NTP works over port 123 so that will need to be open. Did changing to another server fix it?
You can see the list of server pools here http://www.pool.ntp.org/en/, you can use just pool.ntp.org or specify by continent or even country. Here in Australia I use au.pool.ntp.org for all my Linux machines, now I will use it on my phone too
Also, Root Explorer paid app includes a text editor, I find that's the easiest way to edit config files on the fly.

Looking for kernel / build Without Audio stuttering on Blackstone!

Trying to solve audio stuttering...
I'm currently running the Eclair build from Kenia from
http://forum.xda-developers.com/showthread.php?t=827537
Like the speed, most things working fine.
... but playing media results in audio stutter.
Problem is apparently well known and affects more devices, see also
http://forum.xda-developers.com/showthread.php?t=711692&page=364
Indeed, killing battery service solves stuttering, but I'd like to keep it running, of course
Any build/kernel out there that does not suffer from this?
I'd like to find out what's different, since in the past it seemed to have worked, but with pushing more accurate battery readout in the latest kernels, this problem was introduced...
Maybe just putting an old battery service in a current kernel could work?
Cheers,
Robbert
I can confirm that audio shuttering is a common problem, but I wasn't aware it can be related to the battery code. Can anyone check if killing battery service helps with shuttering audio (youtube maybe?) on other build (e.g. FRX03)?
TBH battery code is unfinished since Camro (the guy who did most of it) bricked his phone. If it's really a kernel issue maybe I'd could build test kernel w/o battery code sometime next week.
g3rm0 said:
I can confirm that audio shuttering is a common problem, but I wasn't aware it can be related to the battery code. Can anyone check if killing battery service helps with shuttering audio (youtube maybe?) on other build (e.g. FRX03)?
TBH battery code is unfinished since Camro (the guy who did most of it) bricked his phone. If it's really a kernel issue maybe I'd could build test kernel w/o battery code sometime next week.
Click to expand...
Click to collapse
Hi, g3rm0,
Always happy to do some more testing!
Took me some time to get a FRX03 build back working (not my daily build, Froyo is just too slow on blackstone, I'm afraid)
Anyway: Using the FRX03 build from
http://forum.xda-developers.com/showthread.php?t=711692
(full package, so using the included rootfs, zimage and modules.)
I can *confirm* that audio still stutters, and also on this build stuttering immediately disappears when battery service is killed!
Hope it helps?
If there's need to test different rootfs/zimage/modules/startup/..., just let me know!
Actually, for me, I just want to disable battery service so I can listen to music on my 15min bike ride to work!
But I am a linux Noob, so although "kill -9" is in my power to stop the service, actually restarting a service is momentarily out of reach...
Any help with restarting the [battery] service would be greatly appreciated!
Cheers,
Robbert
You don't need to compile a kernel tbh, why don't you just create an init script which includes the "kill -9 28" command? The init script will get launched on startup therefore killing the battery service as desired.
Best Regards,
ST1Cl<^^aN
Stickman89 said:
You don't need to compile a kernel tbh, why don't you just create an init script which includes the "kill -9 28" command? The init script will get launched on startup therefore killing the battery service as desired.
Best Regards,
ST1Cl<^^aN
Click to expand...
Click to collapse
Hi, Stickman89,
Yes, I read this also somewhere, thanks for reminding me!
My bigger wish is to be able to restart the battery service after finishing listening to music, not having to restart Android (and first WinMo) because that takes way too much time.
How do I restart the service, any idea?
Cheers,
Robbert
well to do that you would need to install a mobile terminal app from the market and create two scripts, one to disable the service and the other to enable it. Only problem is this would not be automated and you would need to execute the script via the terminal app installed.
Best Regards,
ST1Cl<^^aN
Stickman89 said:
well to do that you would need to install a mobile terminal app from the market and create two scripts, one to disable the service and the other to enable it. Only problem is this would not be automated and you would need to execute the script via the terminal app installed.
Best Regards,
ST1Cl<^^aN
Click to expand...
Click to collapse
I could live with that (still hoping for a proper fix, of course!)
Most builds come with a terminal app (Busybox is popular, if I remember correctly) that's what you mean?
But still I need the command line / script lines to execute, and that's where I'm stuck, since I know how to kill the service from the prompt of my terminal in the phone, but not how to "unkill" it!
"Disable/enable" sounds much better than "kill/unkill", but how???
As a side note, I also get the impression that the android terminal does not give me full access to a shell environment, since, for example, the "ps" command is severely limited! (wanted to find out more information on process "[battery]", but no chance with the crippled "ps" command...)
Maybe there are better (more functional) terminals out there?
Or do we actaully have access to "enable/disable service" commands in this "busybox" and I just don't know the proper command?
(just for reference: I'm running Kenia's eclair build that includes busybox 1.5 as terminal)
Cheers, Robbert
Even better, look what I just found for you: http://forum.xda-developers.com/showthread.php?t=486486
Basically you can create a homescreen icon and assign a shell command to it, simply create an icon and assign the "kill -9 28" command to it which will kill the battery service, I would have to check out the process name to be able to start it again. Let me take a look for you (I don't think "start -9 28" will work as we have only issued the process ID and since it is no longer running will be useless)
Best Regards,
ST1Cl<^^aN
If you have a working adb setup then type: "adb shell ps -w"
or download a mobile terminal and type: "ps -w"
Ok here are the processes running, PID 28 is krpcserversd in our case which is incorrect so we need to look for the battery service which is PID 29 for me.
Code:
# ps
ps
PID USER VSZ STAT COMMAND
1 0 312 S /init.android
2 0 0 SW [kthreadd]
3 0 0 SW [ksoftirqd/0]
4 0 0 SW [watchdog/0]
5 0 0 SW [events/0]
6 0 0 SW [khelper]
7 0 0 SW [suspend]
8 0 0 SW [kblockd/0]
9 0 0 SW [cqueue]
10 0 0 SW [kmmcd]
11 0 0 SW [btaddconn]
12 0 0 SW [btdelconn]
13 0 0 SW [kondemand/0]
14 0 0 SW [smd_tty]
15 0 0 DW [rpcrouter]
16 0 0 SW [kadspd]
17 0 0 SW [detection/0]
18 0 0 SW [button/0]
21 0 0 SW [kswapd0]
22 0 0 SW [aio/0]
23 0 0 SW [panel_on/0]
24 0 0 SW [tty_wq/0]
25 0 0 SW [usb_mass_storag]
26 0 0 SW [kstriped]
27 0 0 SW< [krfcommd]
28 0 0 SW [krpcserversd]
29 0 0 DW [battery]
54 0 0 SW [mmcqd]
71 0 0 SW< [loop2]
90 0 0 SW< [loop0]
94 0 0 SW< [loop1]
133 0 1736 S busybox telnetd -b 192.168.20.1 -l /bin/sh
1168 0 1740 S /bin/sh /bin/userinit.sh -c /sdcard/conf/froyo.user.
1226 0 1740 S /bin/sh
1227 1000 812 S /system/bin/servicemanager
1228 0 3728 S /system/bin/vold
1229 0 1736 S /bin/sh /bin/netd
1231 0 668 S /system/bin/debuggerd
1232 1001 5464 S /system/bin/rild -l /lib/froyo/libhtcgeneric-ril.so
1233 0 87964 S zygote /bin/app_process -Xzygote /system/bin --zygot
1234 1013 26664 S < /system/bin/mediaserver
1238 1002 1260 S /system/bin/dbus-daemon --system --nofork
1239 0 824 S /system/bin/installd
1240 1017 1612 S /system/bin/keystore /data/misc/keystore
1241 0 3340 R /sbin/adbd
1243 0 3720 S /system/bin/netd
1258 1000 246m S system_server
1330 10054 124m S com.swype.android.inputmethod
1345 10011 129m S N com.google.process.gapps
1434 1001 134m S < com.android.phone
1685 1000 123m S com.android.settings
2847 0 0 DW [audmgr_rpc]
3391 0 0 DW [ksdiorqd]
3392 0 0 SW [tiwlan_wifi_wq]
3400 1010 3004 S /system/bin/wpa_supplicant -Dtiwlan0 -itiwlan0 -c/da
3588 10007 107m S com.android.quicksearchbox
4937 10053 159m S android.process.acore
5076 10058 108m S com.appspot.swisscodemonkeys.apps
5083 10023 105m S com.android.voicedialer
5095 10004 110m S com.android.vending
5106 10026 114m S com.google.android.googlequicksearchbox
5113 10002 126m S android.process.acore
5233 10037 105m S com.android.defcontainer
5243 10030 112m S com.google.android.apps.genie.geniewidget
5273 10010 111m S < android.process.media
5284 10014 114m S com.google.android.gm
5338 0 0 SW [pdflush]
5462 10064 106m S mobi.infolife.taskmanager
5524 0 0 SW [pdflush]
5532 10070 123m S stericson.busybox
5584 10061 115m S com.facebook.katana
5631 0 1736 S sleep 500
5635 10059 114m S cn.miren.browser
5662 0 740 S /system/bin/sh -
5665 10060 122m S com.voxmobili.phonebook2
5691 10056 108m S com.miui.player
5697 10028 108m S com.google.android.apps.uploader
5705 0 1740 R ps
Once the battery service has been located so in my case PID 29 then to kill that PID via adb simply issue "adb shell kill 29" (PID number may vary so please check) and to start the PID issue "command-removed".
So if you want to use the application i linked you to over at the G1 thread then simply assign the commands "kill 29" to kill the service and "command-removed" (remember that the PID number may vary so please check) to start the service again.
FYI charging will stop at this point and battery stats will freeze at there current percentage.
Best Regards,
ST1Cl<^^aN
Stickman89 said:
Ok here are the processes running, PID 28 is krpcserversd, interestingly we also have the PID 29 which is battery.
Click to expand...
Click to collapse
Same here for me: PID is 29 (it may different in some builds) but... when I killed battery service (kill -9 29) audio shuttering stopped. It also solved "audpp: DMA missed" messages in dmesg so maybe we're on the right track.
IMHO killing battery service every time is not a solution. Maybe code just needs to be cleaned up a little.
Anyway, for now kill -9 is the only (known) way to achieve smooth playback.
Ok then all we need to do is adjust the scheduling priority until we find the sweet spot via renice
That way we wouldn't need to kill anything and that can be added to init fairly easy, we would have to test some values first.
Best Regards,
ST1Cl<^^aN
Stickman89 said:
Ok then all we need to do is adjust the scheduling priority until we find the sweet spot via renice
That way we wouldn't need to kill anything and that can be added to init fairly easy, we would have to test some values first.
Best Regards,
ST1Cl<^^aN
Click to expand...
Click to collapse
Tried that already, afraid it might not be so easy...
Gave the audiomanager -20 or so, and the battery service +20 or so, no effect, still stuttering...
But maybe your mileage may vary, did you try this on your build?
Cheers,
Robbert
Stickman89 said:
If you have a working adb setup then type: "adb shell ps -w"
or download a mobile terminal and type: "ps -w"
Ok here are the processes running, PID 28 is krpcserversd in our case which is incorrect so we need to look for the battery service which is PID 29 for me.
Click to expand...
Click to collapse
Also for me, number 29 it is.
Stickman89 said:
Once the battery service has been located so in my case PID 29 then to kill that PID via adb simply issue "adb shell kill 29" (PID number may vary so please check) and to start the PID issue "--locating-process--".
So if you want to use the application i linked you to over at the G1 thread then simply assign the commands "kill 29" to kill the service and "--locating-process--" (remember that the PID number may vary so please check) to start the service again.
Click to expand...
Click to collapse
Huh?
Something must have gotten "lost in translation" here, I have really no idea what is meant by the command "--locating-process--", I guess it's not literally typing in this phrase, what am I missing?
Ah, just noticed your statement in an earlier post "I would have to check out the process name to be able to start it again", I guess that's what you meant by "--locating-process--" in the next post...?
Well, to be continued...
Cheers,
Robbert
The service isn't successfully starting after being killed, I initially thought it had but it appears it failed to kill on first try therefore it was still running. I will keep looking into this though, stuttering isn't that bad on my build. I will upload it soon, it is there but isn't too bad.
Best Regards,
ST1Cl<^^aN
Stickman89 said:
The service isn't successfully starting after being killed, I initially though it had but it appears it failed to kill on first try therefore it was still running. I will keep looking into this though, stuttering isn't that bad on my build. I will upload it soon, it is there but isn't too bad.
Best Regards,
ST1Cl<^^aN
Click to expand...
Click to collapse
Yeah, noticed that too, sometimes the service takes a few seconds to unload (or at least "ps" still shows it.)
Maybe someone else has some bright ideas, posted it also at Neopeek, some good guys over there, too
I just hoped someone had a quick solution, but we may have to wait for some more kernel development. I'll keep my eyes open, if something pops up I'll update.
Cheers,
Robbert
May I ask what application you guys are using to kill the process? I downloaded the terminal emulator app, however when I type "kill 29" it says operation not allowed.
I'm assuming this is because of a rights issue. I am using Android 2.2 (FroYo) by the Brilliant Mistake [03 Sep 2010] (V1.6) with the latest kernel, zimage, rootfs along with FRX03 update.
I'm a bit confuse as to how I can "root" my device in order kill the battery process so I too can listen to my music without the annoying stuttering.
Any info would be appreciated. Thanks
Just type "su" first
g3rm0 said:
Just type "su" first
Click to expand...
Click to collapse
Thank you for your reply.
I type "su" then enter...
I get a "#" prompt
then I type "kill 29" enter
I don't get any type of confirmation just another "#" prompt
I try listening to my music, stuttering is still there... What am I doing wrong?
James62370 said:
Thank you for your reply.
I type "su" then enter...
I get a "#" prompt
then I type "kill 29" enter
I don't get any type of confirmation just another "#" prompt
I try listening to my music, stuttering is still there... What am I doing wrong?
Click to expand...
Click to collapse
"kill -9 29" has a better chance
Did you check before killing it, that [battery] is process 29 for you? (use "ps" command in shell)
Did you check afterwards that process 29 [battery] is indeed gone?
Just wait for viruscrazy submit the patch to phh to be merge in the main tree.It already in Jerome tree HERE
Code:
/* Patch to fix "audpp DMA missed" messages on AMSS version 52.62.25.34 */
1423 if ( machine_is_htcdiamond() || machine_is_htcblackstone() ) {
1424 if( !(snd_state & SND_STATE_PLAYBACK) ) {
1425 dex.cmd = PCOM_GET_BATTERY_DATA;
1426 msm_proc_comm_wince(&dex, 0);
1427 } /* else {
1428 printk("Skipping battery pcom call to avoid audppp DMA miss\n");
1429 } */
1430 }

CyanogenMod9 and AOKP for TF101G (NEW BUILD)

Working now. Check my rom
You mean you want to try if you can activate the 3G module?
I flashed it but it doesn't work. There isn't even the mobile data option. You know where you can change APNs etc.
I couldn't grab the adb output though. Adb doesn't see my TF I'll try again in the evening.
Sent from my Galaxy Nexus using XDA
Nebucatnetzer said:
I flashed it but it doesn't work. There isn't even the mobile data option. You know where you can change APNs etc.
I couldn't grab the adb output though. Adb doesn't see my TF I'll try again in the evening.
Sent from my Galaxy Nexus using XDA
Click to expand...
Click to collapse
You can also put "ls /dev" in Terminal Emulator and give me the output
Nebucatnetzer said:
I flashed it but it doesn't work. There isn't even the mobile data option. You know where you can change APNs etc.
I couldn't grab the adb output though. Adb doesn't see my TF I'll try again in the evening.
Sent from my Galaxy Nexus using XDA
Click to expand...
Click to collapse
1. Make sure you have usb debugging enabled on the transformer (this is often not the case on new installs)
2. try the naked drivers
Naked drivers: http://forum.xda-developers.com/showthread.php?t=1379875
You can also put "ls /dev" in Terminal Emulator and give me the output
Click to expand...
Click to collapse
Here you go.
Code:
[email protected]:/ $ export PATH=/data/local/bin:$PATH
[email protected]:/ $ ls /dev
accelirq
alarm
android_adb
ashmem
asusec
battery
binder
block
bus
compassirq
console
cpu_dma_latency
cpuctl
device-mapper
dsp_fm34
full
fuse
graphics
i2c-0
i2c-1
i2c-2
i2c-3
i2c-4
input
kmsg
knvmap
lightsensor
log
maXTouch
maXTouch_messages
max_online_cpus
mem
mi1040
mpu
mpuirq
mtp_usb
nct1008
network_latency
network_throughput
null
nvhdcp1
nvhost-ctrl
nvhost-display
nvhost-dsi
nvhost-gr2d
nvhost-gr3d
nvhost-isp
nvhost-mpe
nvhost-vi
nvmap
ov5640
port
ppp
ptmx
pts
random
rfkill
rtc0
snd
socket
tegra-crypto
tegra_avp
tegra_camera
tegra_dc0
tegra_dc1
tegra_mediaserver
tegra_rpc
tegra_sema
timerirq
touch_debug
touchpanel
tps6586x
tty
ttyHS1
ttyHS2
ttyHS3
ttyS0
ttyS1
ttyS2
ttyS3
ttyUSB0
ttyUSB1
ttyUSB2
ttyUSB3
ttyUSB4
ttyUSB5
tun
uinput
urandom
usb
usb_accessory
vga_arbiter
wm8903
xt_qtaguid
zero
[email protected]:/ $
do you have a public source tree for your work ?
Nebucatnetzer said:
Here you go.
Code:
[email protected]:/ $ export PATH=/data/local/bin:$PATH
[email protected]:/ $ ls /dev
accelirq
alarm
android_adb
ashmem
asusec
battery
binder
block
bus
compassirq
console
cpu_dma_latency
cpuctl
device-mapper
dsp_fm34
full
fuse
graphics
i2c-0
i2c-1
i2c-2
i2c-3
i2c-4
input
kmsg
knvmap
lightsensor
log
maXTouch
maXTouch_messages
max_online_cpus
mem
mi1040
mpu
mpuirq
mtp_usb
nct1008
network_latency
network_throughput
null
nvhdcp1
nvhost-ctrl
nvhost-display
nvhost-dsi
nvhost-gr2d
nvhost-gr3d
nvhost-isp
nvhost-mpe
nvhost-vi
nvmap
ov5640
port
ppp
ptmx
pts
random
rfkill
rtc0
snd
socket
tegra-crypto
tegra_avp
tegra_camera
tegra_dc0
tegra_dc1
tegra_mediaserver
tegra_rpc
tegra_sema
timerirq
touch_debug
touchpanel
tps6586x
tty
ttyHS1
ttyHS2
ttyHS3
ttyS0
ttyS1
ttyS2
ttyS3
ttyUSB0
ttyUSB1
ttyUSB2
ttyUSB3
ttyUSB4
ttyUSB5
tun
uinput
urandom
usb
usb_accessory
vga_arbiter
wm8903
xt_qtaguid
zero
[email protected]:/ $
Click to expand...
Click to collapse
Many thanks for that, now I can see kernel supports it, so it should be possible to integrate 3G
I'll fix the build later
Cool looking forward to this. Maybe it stops my TF from rebooting when it's unconnected to a power source.
Sent from my Galaxy Nexus using XDA
new build on the first post
still no public source ?
rhaaa said:
still no public source ?
Click to expand...
Click to collapse
I'll provide it when everything is working
It doesn't work. I can't save any APNs because there is no save button.
And if I want to choose the network operator it fails at the search.
Do you need any specific logs?
Nebucatnetzer said:
It doesn't work. I can't save any APNs because there is no save button.
And if I want to choose the network operator it fails at the search.
Do you need any specific logs?
Click to expand...
Click to collapse
A logcat would be nice, when you try to search for networks
ricardopvz said:
A logcat would be nice, when you try to search for networks
Click to expand...
Click to collapse
Et voilà
10 char

[SOLVED][Q] Commands not properly executing

EDIT:
The problem was that i was trying to read a line from the inputreader, when there was no line, so it was waiting for a response there...
Hello,
I am currently building an app to fix a little problem that exists on some devices with the wifi-mac and bluetooth addresses constantly changing (for me it's a N4 but I read somewhere that there are other devices with that problem too)
The thing the app should do is (steps taken from another xda thread: http://forum.xda-developers.com/showpost.php?p=43164157&postcount=1 )
- Mount /persist
- create the folders wifi and bluetooth
- create a text file in each of these directories containing the addresses that should be used in future
- fix the owners and permissions of these files and directories
- execute /system/bin/conn_init as su
The app is mostly done but somehow not working at all.
Everything from generating random adresses to saving them in a temporary file seems to work fine, but as soon as I try to mount the persist directory, the app stops to react.
At first, this was the first thing done by the SU Shell class that I wrote for executing su shell commands, so I thought that might be not working, but when I let that execute echo test it returns test just fine...
The code that is used could be expressed like that (this is missing some debug info and strings that get passed, but it should technically have the same result):
Code:
try {
shell = Runtime.getRuntime().exec("su");
outputStream = new DataOutputStream(shell.getOutputStream());
inputStream = new BufferedReader(new InputStreamReader(shell.getInputStream()));
outputStream.writeBytes("mount /dev/block/mmcblk0p20 /persist");
outputStream.flush();
} catch (IOException e) {
e.printStackTrace();
}
The attached zip file contains my main activity and the before mentioned su shell.
The complete source code of the app is available via my git server: http://greensserver.redirectme.net/greenchris/WiFi-MAC-and-Bluetooth-Adress-Fix.git
Does anybody have an idea why this isn't working?
Greetings
GreenChris
Edit:
I forgot to add the logcat...
Code:
04-09 23:33:21.289 3903-3903/com.janchristiangruenhage.macfixer I/art﹕ Late-enabling -Xcheck:jni
04-09 23:33:21.791 3903-3949/com.janchristiangruenhage.macfixer D/OpenGLRenderer﹕ Render dirty regions requested: true
04-09 23:33:21.797 3903-3903/com.janchristiangruenhage.macfixer D/Atlas﹕ Validating map...
04-09 23:33:21.951 3903-3949/com.janchristiangruenhage.macfixer I/Adreno-EGL﹕ : QUALCOMM Build: 10/28/14, c33033c, Ia6306ec328
04-09 23:33:21.953 3903-3949/com.janchristiangruenhage.macfixer I/OpenGLRenderer﹕ Initialized EGL, version 1.4
04-09 23:33:21.985 3903-3949/com.janchristiangruenhage.macfixer D/OpenGLRenderer﹕ Enabling debug mode 0
04-09 23:33:22.318 3903-3903/com.janchristiangruenhage.macfixer I/Timeline﹕ Timeline: Activity_idle id: [email protected] time:14543691
04-09 23:33:31.781 3903-3919/com.janchristiangruenhage.macfixer I/art﹕ Background sticky concurrent mark sweep GC freed 11333(680KB) AllocSpace objects, 3(44KB) LOS objects, 13% free, 4MB/5MB, paused 5.706ms total 39.550ms
04-09 23:33:31.843 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ address-bytes generated
04-09 23:33:43.923 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ save .bdaddr
04-09 23:33:43.925 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ address written: .bdaddr
04-09 23:33:43.954 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ su shell started
04-09 23:33:43.955 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ added outputstream
04-09 23:33:43.957 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ added inputstreamreader
04-09 23:33:43.957 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ echo test
04-09 23:33:43.973 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ test
04-09 23:33:43.974 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ mount /dev/block/mmcblk0p20 /persist

[Guide][G800F/M/Y][7.1.2][UNOFFICIAL] Build Slim ROM 7 Nougat from Source

Overview
I've created a very simple #!/bin/bash script (attached) to automate the initial build or subsequent rebuild of SpookCity138's ROM:
Slim Rom 7 for the Samsung S5 mini G800f (kminilte). The script simply automates the steps and processes created by others (none of which is my own work - all credit goes to the original creators). I have only tested this script on my own working environment: Gnome Ubuntu 17.04; 16GB RAM; i7-7700HQ; If your environment differs from this your experience may differ from mine.
How to Execute script
See readme at: https://github.com/fidoedidoe/build_scripts
Thanks
@spookcity138, @jimmy999x. Taking the time to educate me at each and every tentative step and demonstrating great patience
Contributors
spookcity138
jimmy999x
Script Source
The latest version of the script (and others for different devices) can be found here: https://github.com/fidoedidoe/build_scripts
SpookCity138's ROM
https://forum.xda-developers.com/galaxy-s5-mini/development/rom-slim-rom-7-nougat-t3558926
Created 2017-09-20
Last Updated 2017-12-09
There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...
wow, excellent, I have reviewed the code (I have not executed it yet) looks pretty good, it should work, I have to copy your script and modify it for other roms, thanks!
edit 1: it is possible to use this script (I use it and it works perfect) to automate even more the process of configuring the compilation environment https://github.com/akhilnarang/scripts
Also, for Ubunt 16.04 I added a couple more to make it easier some things:
cmake
nautilus (optional)
phablet-tools
unrar
silversearcher-ag (this is optional, but extremely useful for me, allows me to find the problematic lines inside a document or folder)
lfom said:
There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...
Click to expand...
Click to collapse
You need to apply some SELinux, CAF, And CM/LOS Patches to build a Nougat ROM for G800H, or that rom will not boot, or will shall not pass from build errors.
Is not a easy task.....
lfom said:
There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...
Click to expand...
Click to collapse
i found this on YT
so far so good for me
give it a try
https://youtu.be/UPOpJgqnlf8
not working for me -- using xubuntu 17.10
ko_taka said:
not working for me -- using xubuntu 17.10
Click to expand...
Click to collapse
Script updated on github (follow links for build_slimrom7_kminilte.sh). Tested on my laptop (Ubuntu gnome 17.04) and SlimRom7 version 1.17 builds successfully (although I have yet to test the build on the device). I'll update the attached zip in the opening page in the coming days, but as a general rule github is the best place to find latest version(s).
Thanks to @spookcity138 (again) for taking time the time and offering sound help / advice identifying the issues and resolve (the issue was within applying device specific patches ./apply.sh).
I am on 40GB partition. Not enough?
perly terminated.
Fetching projects: 70% (381/544) fatal: unable to access 'https://android.googlesource.com/platform/hardware/akm/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Fetching projects: 73% (398/544) fatal: unable to access 'https://android.googlesource.com/platform/system/connectivity/shill/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
fatal: unable to access 'https://android.googlesource.com/platform/external/jsr330/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Fetching projects: 74% (403/544) fatal: unable to access 'https://android.googlesource.com/platform/external/jsr330/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
error: Cannot fetch platform/external/jsr330
Fetching projects: 78% (425/544) fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: index-pack failed
error: index-pack died
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
error: Cannot fetch SlimRoms/frameworks_base
Click to expand...
Click to collapse
ko_taka said:
I am on 40GB partition. Not enough?
Click to expand...
Click to collapse
Yeah,you're running out of space. I don't recall exactly what the sources and the build of a nougat ROM take,space wise. It seems a little weird you were running out of space syncing the sources. If I recall correctly nougat sources are somewhere between 25-30GB. I could be wrong though. The actual build itself (the out folder) also takes a fair bit of space. Again,just guessing,but around 15-20GB. I would say 60GB would be what you need.
hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
build_slimrom7_kminilte.sh: 176: build_slimrom7_kminilte.sh: [[: not found
Remove references to OmniRom recovery...
remove config_uriBlruEnabled references, spoils the build...
alter local manifest files for slimrom 7 build compatability...
insert text into file: frameworks/base/core/res/res/values/config.xml...
delete file cm_arrays.xml...
remove flipflap stuff from device/samsung/smdk3470-common/smdk3470-common.mk...
build_slimrom7_kminilte.sh: 205: read: Illegal option -t
build_slimrom7_kminilte.sh: 210: build_slimrom7_kminilte.sh: [[: not found
patching file include/telephony/ril.h
Hunk #1 FAILED at 31.
Hunk #2 succeeded at 395 (offset -1 lines).
Hunk #3 succeeded at 409 (offset -1 lines).
Hunk #4 succeeded at 569 (offset -1 lines).
Hunk #5 succeeded at 624 (offset -1 lines).
Hunk #6 succeeded at 1023 (offset -1 lines).
Hunk #7 succeeded at 5217 (offset -1 lines).
Hunk #8 succeeded at 5866 (offset -1 lines).
1 out of 8 hunks FAILED -- saving rejects to file include/telephony/ril.h.rej
manually reapplying failed Hunk #1...
patching file ril/Android.mk
patching file ril/libril/Android.mk
patching file ril/libril/ril.cpp
patching file ril/libsecril-client/Android.mk
applying frameworks_av to frameworks/av
Applying: av: Add samsung wfd service
Applying: add Android M MediaBufferGroup:MediaBufferGroup() for libwvm.so
applying frameworks_native to frameworks/native
Applying: Revert "Remove Parcel::writeIntPtr."
Applying: add missing const getSensorList() for MM gpsd (G800FXXU1CPK5)
applying hardware_libhardware to hardware/libhardware
applying hardware_ril to hardware/ril
Applying: ril: recover on crash
applying hardware_samsung_ril to hardware/samsung/ril
Applying: add SetAudioMode and SetSoundClockMode for MM audio-ril
applying packages_services_Telephony to packages/services/Telephony
./apply.sh: line 24: cd: /home/ferran/android/build_scripts/packages/services/Telephony: No such file or directory
build_slimrom7_kminilte.sh: 238: read: Illegal option -t
build_slimrom7_kminilte.sh: 243: build_slimrom7_kminilte.sh: [[: not found
prepare device specific code...
build_slimrom7_kminilte.sh: 249: build_slimrom7_kminilte.sh: source: not found
build_slimrom7_kminilte.sh: 250: build_slimrom7_kminilte.sh: lunch: not found
running croot...
build_slimrom7_kminilte.sh: 253: build_slimrom7_kminilte.sh: croot: not found
build_slimrom7_kminilte.sh: 262: read: Illegal option -t
build_slimrom7_kminilte.sh: 267: build_slimrom7_kminilte.sh: [[: not found
running mka bacon...
build_slimrom7_kminilte.sh: 273: build_slimrom7_kminilte.sh: mka: not found
Click to expand...
Click to collapse
ko_taka said:
hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
Click to expand...
Click to collapse
The build did not start. It applied the patches successfully (all but one where there was an error) Then it is just a serious of failures. I have not used this script so I cant say specifically where you are going wrong. Does the script have executable permissions? (I assume so as it partially worked) Do you have all of the need dependencies for building Android? Thats not the issue I don't think,but you need them either way. Other than that I am not real sure honestly. You may need to wait for @fidoedidoe to help you. I'll reply back if any possible reason comes to mind.
ko_taka said:
hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
Click to expand...
Click to collapse
Hi @ko_taka
@spookcity138 is correct, the script failed...when it succeeds it's pretty clear the last few messages published will read along the lines of: "Package Complete: .../out/target/product/kminilte/Slim-kminilte-7.1.2.build.1.17-UNOFFICIAL-20171209-1401.zip" followed by "#### make completed successfully (24:30 (mm:ss)) ####" (note the build time will vary depending on the power of your build machine and utilisation of ccache). Oh, FYI - my build folder is ~95GB in size (the ../out/ folder is 26GB and the ../.repo/ folder is 47GB!!)
Back to the script failure....first verify the following variable in the build_slimrom7_kminilte.sh is defined correctly for your environment:
Code:
WORK_DIRECTORY="$HOME/android/slimrom7"
For my personal build environment I keep the script (build_slimrom7_kminilte.sh) in a separate folder to where the source is located and the build is output to (just so i can purge those folders without losing the build script). FYI on your laptop your folder structure should look something like that shown below, with build_slimrom7.kminilte.sh stored in the folder .../build_scripts
Code:
/home/ferran/android/build_scripts
/home/ferran/android/slimrom7
Once the above is verified...the primary issue you have is every time you see "...[[: not found", the script is hitting an issue. Check that the first line of the script contains the line "#!/bin/bash ", this is called "shebang" and it tells your shell what program to interpret the script with, in our case we need "Bash". I'm now wondering what OS / Shell you're using (I use Ubuntu Gnome 17.04 with Bash version 4.4.7) does yours differ from this? To verify your Bash version:
Code:
$ bash -version
GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)
Copyright © 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
You could try forcing your shell to use bash (from memory), by switching to the /build_scripts/ folder and running the following command (do not use sudo or any elevated permissions):
Code:
$ cd /home/ferran/android/build_scripts
$ ./build_slimrom7_kminilte.sh
Let me know how you get on, in essence the script is failing on the evaluation lines where "if [[....]]" is used. if we can't get it to work, in your case, the script may need to be altered to change the evaluation (perhaps "if [...]" would be more suitable). Anyway - give me some feedback and lets see if we can get you a little further.
my bash is 4.4.12
working directory had been set correctly
I removed the double [[ leaving a simple [ same with ]] closing brackets
it says Illegal option -t in line 238
this is line 238: read -r -p "6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
it also says [: Y: unexpected operator on line 243
this is line 243: if [ ! $PROMPT =~ ^[Yy]$ ]; then
Timte to time I was getting errors while fetching
TLS errors
I found it is due gnutls package and applied the following solution:
compile git with openssl. To do this, run the following commands:
sudo apt-get update
sudo apt-get install build-essential fakeroot dpkg-dev libcurl4-openssl-dev
sudo apt-get build-dep git
mkdir ~/git-openssl
cd ~/git-openssl
apt-get source git
dpkg-source -x git_1.7.9.5-1.dsc
cd git-1.7.9.5
(Remember to replace 1.7.9.5 with the actual version of git in your system.)
Then, edit debian/control file (run the command: gksu gedit debian/control) and replace all instances of libcurl4-gnutls-dev with libcurl4-openssl-dev.
Then build the package (if it's failing on test, you can remove the line TEST=test from the file debian/rules):
sudo dpkg-buildpackage -rfakeroot -b
Install new package:
x86_64: sudo dpkg -i ../git_1.7.9.5-1_amd64.deb
Click to expand...
Click to collapse
I'm using git-openssl build now
Just started the fetching process again
I'm under virtual machine on a host with a proper firewall configuration -- maybe that caused the connection problems while fetching
ko_taka said:
my bash is 4.4.12
working directory had been set correctly
I removed the double [[ leaving a simple [ same with ]] closing brackets
it says Illegal option -t in line 238
this is line 238: read -r -p "6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
it also says [: Y: unexpected operator on line 243
this is line 243: if [ ! $PROMPT =~ ^[Yy]$ ]; then
Click to expand...
Click to collapse
Sounds like we're making progress. This is good. So, reading around the subject of square brackets vs double. It transpires converting the evaluations from double square brackets ([[..]]) to singles ([..]) may** change how variables are referenced. In my script I was forced to use double square brackets to correctly evaluate the response from the "read -r....." (read input) command (where it evaluates when upper or lower case Y is entered). If this command is changed from double square brackets to single ones the command then fails (on my setup). Further to this, in your reply it appears you're also having issues with the "read" command, for some reason your version doesn't support the -t directive (which waits for N seconds - ie: -t 5 will wait 5 seconds for user input).
For now the easiest thing to do is to remove *all* of the steps in the script that awaits input from the user to continue processing the script (they are non essential vanity items primarily used while I was building out the script). There are 7 is these in the script (look for "1/7", "2/7", "3/7", etc etc), just comment out (insert # at beginning of each line) for all 7 instances. There are ~10 lines per instance, examples of how instance #1 and #7 should look after editing is below. Just do the same for all 7 instances in your script and re run the script.
Code:
...
...
#PROMPT=""
#read -r -p "1/7. Initialise/Reinitialise Repo, first 'repo init' will take hours <Y/n>? (automatically continues unpromted after 5 seconds): " -t 5 -e -i Y PROMPT
#echo
#if [ -z "$PROMPT" ]; then
# PROMPT="Y"
#fi
#if [[ ! $PROMPT =~ ^[Yy]$ ]]; then
# echo "Response: '$PROMPT', exiting!"
# exit 1
#fi
...
...
#PROMPT=""
#read -r -p "7/7. Build rom (this segment can take hours) <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
#echo
#if [ -z "$PROMPT" ]; then
# PROMPT="Y"
#fi
#if [[ ! $PROMPT =~ ^[Yy]$ ]]; then
# echo "Response: '$PROMPT', exiting!"
# exit 1
#fi
...
I'd be really interested in knowing what OS you're using (Ubuntu, Mac, etc along with version) perhaps I can use this detail to come up with a more generic version of the script.
Good luck, let me know how you get on.
ko_taka said:
Timte to time I was getting errors while fetching
TLS errors
I found it is due gnutls package and applied the following solution:
I'm using git-openssl build now
Just started the fetching process again
I'm under virtual machine on a host with a proper firewall configuration -- maybe that caused the connection problems while fetching
Click to expand...
Click to collapse
I'd also try changing the value of the variable: REPO_SYNC_THREADS in the script to something lower (more suitable to your internet bandwidth / performance), try 2 or 4 and build up from there. ie: REPO_SYNC_THREADS=2
I think the problem was on GIT .. confusing I think so
I would be waiting a message like (file doesnt exist or something like that)
anyway I still with compiling errors but now is quite different
I am using virtualbox (Xubuntu 17.10) on Mac OS 10.13.2 Mac Mini 2014 entry level
applying packages_services_Telephony to packages/services/Telephony
./apply.sh: line 24: cd: /home/ferran/android/slimrom7/packages/services/Telephony: No such file or directory
6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): Y
prepare device specific code...
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips64/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/samsung/kminilte/vendorsetup.sh
build/envsetup.sh: line 1716: vendor/slim/build/envsetup.sh: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
build/envsetup.sh: line 624: vendor/slim/build/tools/roomservice.py: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
cat: /home/ferran/android/slimrom7/vendor/slim/build/envsetup.sh: No such file or directory
cat: /home/ferran/android/slimrom7/vendor/slim/build/envsetup.sh: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
** Don't have a product spec for: 'slim_kminilte'
** Do you have the right repo manifest?
running croot...
mka clean/clobber needed...
./build_slimrom7_kminilte.sh: line 257: mka: command not found
7/7. Build rom (this segment can take hours) <Y/n>? (automatically continues unprompted after 10 seconds): Y
running mka bacon...
./build_slimrom7_kminilte.sh: line 273: mka: command not found
Click to expand...
Click to collapse
ko_taka said:
I think the problem was on GIT .. confusing I think so
I would be waiting a message like (file doesnt exist or something like that)
anyway I still with compiling errors but now is quite different
I am using virtualbox (Xubuntu 17.10) on Mac OS 10.13.2 Mac Mini 2014 entry level
Click to expand...
Click to collapse
Thanks for the feedback. At first glance it looks to me like your issue is less to do with the script and more to do with not having all the source locally. Seeing commands such as running ./apply.sh (puled down with the source) error reporting "file not found" is the smoking gun.
Right now I'd be tempted to say ensure you've successfully pulled the primary SlimRom7 source locally. It may be easier to do this outside of the script by running the following:
Code:
$ cd /home/ferran/android/slimrom7/
$ repo forall -vc "git reset --hard" --quiet
$ repo sync --jobs="2"
Keep an eye out of timeouts / 404 while it's syncing the repo's (the third of the three commands above). If you get errors just keep rerunning the "repo sync" command given above while in the correct directory until it completes without error. Once you have that done successfully, change the the build_scripts directory and re-run the script. If you see timeouts / 404 in the script output then you might have to manually run the "git clone" commands to see which one is causing the issue(s).
why does need that much space?
I was executing
$ repo forall -vc "git reset --hard" --quiet
$ repo sync --jobs="2"
Click to expand...
Click to collapse
I am getting the message "out of space"
80GB full of source code and even need more space??
ko_taka said:
why does need that much space?
I was executing
I am getting the message "out of space"
80GB full of source code and even need more space??
Click to expand...
Click to collapse
Use a disk usage analysis tool to find out whether earlier failed attempts pulled source down to multiple locations (when the script was failing).. I mentioned in an earlier post the size of the repo, look back 5 or 6 posts. Don't forget the bulk of the source will be contained in a hidden folder named /.repo/ check this folder doesn't exist outside of the build folder (/slimrom7/)...looking at earlier attempts I'd fist check your /build_scripts/ folder for the hidden .repo folder and if there delete it. Good luck

Categories

Resources