yashsingh1/xdaforums huggingface dataset:
[Samsung Gear 2] biktor_gj:
Yes and no ;)

I've been looking into it for the last week while I was doing other things, but I still don't have a clear path on where to start. There are a bunch of problems, and I'm still not sure if some can be solved:

1. The chipset is not open source. It's a Yamaha YMU 831, the closest to it is Galaxy S2's chipset, which is a YMU 823, but audio libraries drop a IOCTL error when starting and don't work (already tried).

2. The libraries from Gear 1 (which does share the same chipset) are too old to be of any use (4.2.2 vs 5.0 / 5.1 for wear lolipop). I looked at them a bit with hexdump & IDA and they seem just ALSA wrappers, but I'm not sure. If that's the case, something can be worked out by rewriting Grouper's audio library along with the configuration files retrieved from Tizen

3. There's no Android Wear watch with internal audio output! They all have a microphone, but none has a speaker, so, even if it could work, audio out will probably be dead. Maybe Android's subsystem will still work, but there's not even a volume selector in Android wear, so, listening to music, for example, might require an A2DP headset / speaker, as a pure Android Wear limitation.

4. Call audio forwarding to the watch: the same applies, that functionality doesn't even exist in Android Wear, it will probably be impossible to make that work, unless someone can manually code an app for it. And I'm not sure if Bluedroid implementation in android allows it to expose the bluetooth adapter as a headset either...
[Samsung Gear 2] Razor29:
What Lollipop ver do you mean 5.1.1 ? regardless Lollipop has massive enhancement under the hood that would be very useful including a much more indepth Class for BT le connection methods
[Samsung Gear 2] jeffc83:
Thanks for your reply Biktor! I should have clarified; I too am aware of the speaker in wear (or lack thereof) but was more or less checking in on the mic to see if it may be possible to text from the watch one day without using default replies. It's certainly not a big deal, especially if you have to reinvent the wheel over it! Besides, you ALWAYS focus on the right areas and this time around is no exception:p
[Samsung Gear 2] bitstra:
I've bought the premium key already bfore two days...

THX though!

... And my wife thought, I've got an Apple watch... LOL
[Samsung Gear 2] kavinzhao:
About 3 and 4, I thought it would be. I noticed that there is no "call audio" option in the Bluetooth settings(Tizen have that) . So we have to implement them OURSELVES (Yes guys I trust we can). About 1 and 2, can we decompile and recompile? And even if we made it, I don't think there are any app that would support it... Google Now won't transmit feedback back and such... Null did that correctly. It ported Android to it. Not wear. Of course it would be best if we can get Android wear running on it.. Just.. Is it to hard for a single developer? Maybe we do have to start from CM, or a Open Source one.

---------- Post added at 22:46 ---------- Previous post was at 22:38 ----------

Hopefully I thought of Xposed Framework: if we can't modify the framework from its source, we can modify it's behavior. (Am I crazy?) with a couple of Xposed Tweaks we may be able to do that;)

Of course we can. Can't we?
[Samsung Gear 2] andrew.mackew:
Yep, it's reasonable, a bit complicated, but pretty reasonable.
[Samsung Gear 2] Jeshter2000:
Wait what!! Maybe you could get audio fixed in the future!
[Samsung Gear 2] andrew.mackew:
Really "sounds" good :)
[Samsung Gear 2] Android6190:
man i am excited. dude you rock. i have been following this since i read it on endgaget http://www.engadget.com/2015/04/26/android-wear-on-samsung-gear-2/. i have been dailying the watch again since i switch from s5 to m8 and for notifications its awesome. i already got my friend upset that he went for the gear s instead of the gear 2. again great job this is awesome. i wanted to ask someone that they mentioned th bubble launcher for the watch. i tried to download it for my watch and it doesn't show in the watch faces. if anyone can let me know how they got it to work would be great.
[Samsung Gear 2] bitstra:
[MENTION=803006]biktor_gj[/MENTION],

found an interesting thread in LG g watch section about fixing memory leaks in wear 5.0.1, 5.0.2...: http://xdaforums.com/g-watch/development/android-5-0-lollipop-memory-leak-fix-lg-t3030871

Maybe it would be helpful for jumping to AW 5.0.1 , 5.0.2 ?!

Thanks for all your work!
[Samsung Gear 2] jeffc83:
Once you purchase the Bubble Launcher license key, the launcher will remain on the screen after the screen is turned off/back on. If you don't purchase it, it will slide back to the side you chose after the screen is turned off. (left or right) At least that's what happened in my case... I'm happy with it but am already getting tired of people asking me about my Apple Watch:crying:

[MENTION=2981094]bitstra[/MENTION] - I've been skimming through all Wear threads myself and have noticed that many owners are experiencing unusual battery drain with the latest version of Wear Manager. I updated it last night as a test and my watch AND phone both took a 30+% hit in less than an hour. Wonder what the problem was!? (maybe it was just re-syncing BUT the problem persists for many) I also noticed that after updating to the latest version of Wear and then downgrading back to v1.0.5, I can still use apps that access the internet on the watch...before that, Wear Browser and Aeris Weather would always fail.
[Samsung Gear 2] bitstra:
The bubble launcher can be used as watchface ONLY in Android wear 5.0.2.

With the current image of wear 4.4.2 the bubble launcher can only be used as APP!

After installing on phone and syncing you can get it over the watchface by swiping from right (top half) screen border to left.

---------- Post added at 08:03 PM ---------- Previous post was at 07:59 PM ----------

No problems here with latest wear manager! Battery life time about 38 hour on gear2 with current AW image and in LG g watch with AW 5.0.2!...
[Samsung Gear 2] jeffc83:
That figures...lol. Thanks for the reply:good:
[Samsung Gear 2] lordmorphous:
I know this late, but I paired the watch with a Jawbone Icon (A2DP) today. It reported successfully paired on both the watch and the BT, but nothing seemed to happen when playing around with it.
[Samsung Gear 2] biktor_gj:
Just a quick reply, I need to get back to work. Given the recent unpleasant things that happen with some user, I updated the first post with a new recovery method, newbie friendly. It does what the 'emergency recovery method' did, but automatically. I've tested in my watch and works nicely.

By the way, I got myself a donor for the Lolipop image, I will be trying to port it this weekend, don't have much time during work days... If there's someone from the gear s thread here, I owe you guys, I will try to get it all done this weekend too ;)

Be good!
[Samsung Gear 2] kavinzhao:
I think the pedometer and other sensors' issue may be because of the communication between the kernel and the software. How does the logcat say ?
[Samsung Gear 2] geri005:
Btw, im pretty sure im not saying anything New, but eventualy it passed the just a minute screen on its own. It took a while( a minute or two) but It did
[Samsung Gear 2] jeffc83:
Set CPU governor

To change the governor, root using TWRP then install WearControl for Android Wear from the play store. After it is installed, open the app on the watch to change the governor...I'm testing powersave now;) You can also reboot to bootloader and recovery!

7 hours in and I've lost 10% on powersave...NICE!

Yes, we have root;) (the superuser app is not functional)
[Samsung Gear 2] bitstra:
How got you root usin TWRP?

It fails here...

Edit: got it to root. All is fine now!
[Samsung Gear 2] jeffc83:
[MENTION=2981094]bitstra[/MENTION] - Glad you got it working!

Additional SU Info: You can delete the Superuser.apk in TWRP by selecting ADVANCED then FILE EXPLORER. Go to system/app, delete the apk by log-pressing it and reboot...you can now continue to enjoy root without the app since it doesn't work anyway;) Yes, the SU notification was annoying me!

Evening post: Biktor, can you explain why the clocks start to work after "x" amount of time!?!? Its awesome so I'm not complaining;)
[Samsung Gear 2] sandvich123127:
HOW DID YOU GET THE FACES TO WORK? I thought opengl is currently bugged the f*#! Up. As I just tried, no faces can work until the environment is ready... :what:
[Samsung Gear 2] jeffc83:
Oh it is...the watch face froze as of now and I set the same face again. Black screen:( I have to think it has something to do with the weather app I'm using but I can't duplicate it, it just shows up after several hours of use, sometimes less. Trust me, I've tried EVERY app and face to get a watch going here:cyclops:
[Samsung Gear 2] biktor_gj:
So... The mot********* ends up working? I knew I had fixed opengl but didn't think that made any difference in mixed compositions... If you find a way for me to repeat it, or if you can get me a logcat of when it starts working and when it stops, may be I can even debug it!
[Samsung Gear 2] Magik_Breezy:
Everyone try to reproduce so Biktor can get a logcat
[Samsung Gear 2] jeffc83:
Biktor - Lol, it does but not for long. I am watching this thing like a hawk at the office today...at least I'm near a PC so I can get you the logcat. I still think it has something to do with the Aeris weather app. When the face would appear, I was swiping the weather card down to hide it. Its bugging the s*** out of me here!!!

GOT IT....YES!!!! Biktor, I pulled the logcat the second the watch face showed up so the attached file should show it is WORKING! Son of a bi***, the watch is still working after 5 screen on/off events!? I'm not touching it;)

It's interesting that the logcat shows that it skipped "66 frames" and "no buffer, bailing out" for example because I can see it working and is not skipping any frames. (at least to the naked eye) It also throws - "Unexpected advanceFrame() in PREPARED state on GLES/MIXED frame"

EDIT: It's still working! I'm afraid to touch it now;) Biktor, let me know if you need another logcat or if I should try to trigger a failure THEN pull another logcat.
[Samsung Gear 2] biktor_gj:
I can confirm this DOESN'T come from using any app. My watch just did this after sitting idle two hours after a factory reset while I was reading your logcat. After it starts working, chaning between clocks hasn't made it stop working (even between basic and OpenGL). I think, though can't confirm by now, that at some point some power management triggers a change in the framebuffer and then it starts working. The rest of the time it's working, but the framebuffer doesn't show it

A reboot makes it fail again ;)

A little bit frustrating though, I don't see anything strange in the kernel log and /or logcat... :(
[Samsung Gear 2] jeffc83:
Interesting...I wonder if my powersave governor has anything to do with this showing up more often for me!?
[Samsung Gear 2] biktor_gj:
You had it connected with USB when it showed up?
[Samsung Gear 2] jeffc83:
I did have it connected with USB but connected the watch to pull the logcat AFTER the face started showing. (I should've left it plugged in but I wasn't sure when it would show up for me) I selected the powersave option again last night after rebooting but I rebooted again in between, which may have reset it back to the default. The governor was just a thought but who knows, it may be it! The watch IS still working, no issues (yet) with it today...provided I don't restart OR change the face of course;)
[Samsung Gear 2] Lord AnubiS:
Do you have set the Always on screen to OFF?
[Samsung Gear 2] jeffc83:
We ALL have it set that way plus I am the one who discovered that:silly:

Maybe it is the governor, I have it currently set for powersave and the watchface is still going after several hours. Thoughts?
[Samsung Gear 2] biktor_gj:
In theroy, the governor is already set to powersave from the kernel... besides I didn't modify anything from powersaving and reproduced the result just by letting it stay idle. Something overflows, crashes, or resets at some point when the watch has been powered up for more than 900 seconds and has been idle for more than X minutes. I don't know if having been connected to USB makes a difference or not... I'll keep trying to trace it!
[Samsung Gear 2] jeffc83:
OK, I will let that theory go too. I don't think the USB connection makes a difference because I wasn't connected the first three times the face showed up. Thanks for your help trying to trace this! (I'm still digging too)

Just pulled another logcat and it displays this over and over:

W/SurfaceFlinger( 110): DisplayDevice::makeCurrent failed. Aborting surface composition for display ActivityViewVirtualDisplay

E/libEGL ( 110): eglSwapBuffers:1051 error 300d (EGL_BAD_SURFACE)

E/SurfaceFlinger( 110): eglSwapBuffers(0x1, 0x0) failed with 0x0000300d

W/SurfaceFlinger( 110): [ActivityViewVirtualDisplay] Unexpected advanceFrame() in PREPARED state on GLES/MIXED frame

E/SurfaceFlinger( 110): [ActivityViewVirtualDisplay] advanceFrame: no buffer, bailing out

E/SurfaceFlinger( 110): [ActivityViewVirtualDisplay] failed pushing new frame to HWC: -12

E/libEGL ( 110): eglMakeCurrent:775 error 3009 (EGL_BAD_MATCH)
[Samsung Gear 2] bitstra:
This line could be a good Entry point for debugging:

E/libEGL ( 110): eglSwapBuffers:1051 error 300d

:good:

BTW: same errs in logcat here☺
[Samsung Gear 2] bitstra:
[MENTION=803006]biktor_gj[/MENTION],

thank you very much for this outstanding explanation!
[Samsung Gear 2] kavinzhao:
Good explanatiom, but why not disable power management and force the GPU to be ready...until power is fixed?
[Samsung Gear 2] kavinzhao:
...well, cant help but 'd like to give some suggestions as before.....I think the next most important things to solve are : (sorted by how much people(at least I) want them)

Step Counter

Mic

Camera(should be easy since the camera use simple drivers, and I will work on camera app(try port one))

OpenGL

Tilt wake

Audio

IR

The rest..

As before...only suggestion....
[Samsung Gear 2] andrew.mackew:
Good one.. let us see if these priorities matches with our beloved dev.. what is your thoughts [MENTION=803006]biktor_gj[/MENTION] ?
[Samsung Gear 2] Razor29:
I wonder if the soon to be downloadable new Gear Live 5.1.1 Image will be of any use to the general efforts
[Samsung Gear 2] AntwonJenkins:
I sure hope so! They added Wi-Fi support to the Gear Live!
[Samsung Gear 2] kavinzhao:
Our device is missing a antenna. Can't really use wifi.

BTW.. Think our first priority should be the mic?
[Samsung Gear 2] AntwonJenkins:
The Gear Live has all the bells and whistles then huh?
[Samsung Gear 2] Lord AnubiS:
I was checking about the weather app and the watchfaces and guess what? As long as I have a notification of that app my watchfaces works!!!, this is what I did: When I got a notification of that app the first time my watchfaces started to work, then I received other Whatsapp notifications and they stopped working again, but then I went to the weather notification, start moving between the cards without closing them, press the home button and voila!!! the watch started working again. I know it is not a very scientific test and I was away from my computer so I couldn't save a logcat but now I have it connected and as soon as it happens again I will save one and I will check what's the difference.

BTW: I was checking about the eglSwapBuffers and one of the first result that appears talk about that been an issue with some older dalvik-sdk and was solved on dalvik-sdk 8u40-b1. I don't know if that can be of any help.
[Samsung Gear 2] jeffc83:
^^ That's how I've been keeping my face working 100% of the time...go to the map in Aeris weather, it'll bring it right back:)
[Samsung Gear 2] DAGr8:
Not to be captain obvious here but open gl clearly is working but the chipset driver seems to be the culprit here, any alternative one?
[Samsung Gear 2] biktor_gj:
I've so far tried disabling most of the power management features but it still does the same. Maybe the problem relies directly on the code, after all Samsung's power management code for the mali gpu in the Gear 2 is completely different than the one for the exynos 3470.... I could be veery wrong though so don't take my word for it ;)

I don't really have a list on what to go with first, I'm mostly trying to fix the kernel issues as I go, but I think that most of what remains are the hard things to fix ;)

Step Counter: I thought it would work when I got the Sensorhub to work... but of course it doesn't.

Mic & audio: Already talked about it two pages ago, no need to repeat it

Camera: As far as I've seen, until the OpenGL is fixed you won't be able to see anything on the camera. That's apart from the rest, the kernel is trying to power it up, but don't know if exynos3470's libraries will work, if Tizen's camera firmware for the.. s5k8b was the name of the camera? will work... and then there's the app issue. Have you tried pushing the camera app from Gear1? if it's made for jellybean I'm not too sure that it'll work...

Tilt wake: I was sure that would work the second sensorhub worked. The accelerometer is working nicely (you can test it with the typical sensor checker app). Maybe it's using the gyro sensor or the magnetic sensor? I need to check on that.

Lolipop project is postponed until I can get my hands on a official Samsung rom with Android L for the Samsung Galaxy S5 Mini. I've tried porting it but the hardware composer crashes on missing code dependencies. The most I could do is transplant apps, framework etc while mantaining the libraries, but that's only going to give more issues. And given that now it's booting and doing half the things right, let's stay focused on making it work...

One little thing... we haven't talked about the Play Store and the Android Wear app. They don't know which watch is this, and don't let us change certain settings because of it. I'm going to try to revert all that is saying that's a Gear 2 so the phone thinks it's a wear live, maybe that way we can get all the settings that are missing from the wear app? Haven't you guys noticed that you can't change the watchface from the app itself?
[Samsung Gear 2] kavinzhao:
Null's camera doesn't looks good..can't even install.

Will keep trying with libs:)

1489 KB/s (381239 bytes in 0.250s)
pkg: /data/local/tmp/samcam.apk
Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]

---------- Post added at 21:09 ---------- Previous post was at 20:51 ----------

I added libraries about camera to it and now it want's more

W/InterfaceController( 325): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library

Then I'll feed it...until I flash the rootfs back

Also,video is not working

EDIT: Not so easy

E/HAL ( 111): load: module=/system/lib/hw/hwcomposer.exynos3.so
E/HAL ( 111): dlopen failed: could not load library "libmedia.so" needed by "hwcomposer.exynos3.so"; caused by could not load library "libcamera_client.so" needed by "libmedia.so"; caused by cannot locate symbol "_ZN7android10VectorImpl19reservedVectorImpl1Ev" referenced by "libcamera_client.so"...

---------- Post added at 21:22 ---------- Previous post was at 21:09 ----------

Back on pedometer...

I/ActivityManager( 413): Start proc com.google.android.apps.fitness for broadcast com.google.android.apps.fitness/.PedometerTriggerBroadcastReceiver: pid=806 uid=10013 gids={50013}
I/ActivityManager( 413): Delay finish: com.google.android.apps.fitness/.PedometerTriggerBroadcastReceiver
D/PermissionCache( 413): checking android.permission.BODY_SENSORS for uid=10013 => granted (144 us)
I/pedometer( 806): starting pedometer listener
D/Sensors ( 413): StepCounterSensor (15) setDelay = 200000000
I/Sensors ( 413): StepCounterSensor (15) old sensor_state 2097152, new sensor_state : 2228224 en : 1
E/Sensors ( 413): StepCounterSensor write failed. ret = -1, sensor_state = 2228224
E/SensorService( 413): Error activating sensor 15 (Operation not permitted)
[Samsung Gear 2] andrew.mackew:
Maybe is possible to adapt an antenna? :confused:
[Samsung Gear 2] iferlive:
Sure it is possible just connect a usb dongle to the watch.
[Samsung Gear 2] bitstra:
A good one! LOL
[Samsung Gear 2] Razor29:
Sorry for the general ignorance if no antenna is connected the wifi could not pick up any signal, wouldn't it have really bad or minimum reception

If that assumption is ridiculous I would not be against trying a minor hardmod an antenna if it can be done without screwing up the watch to much

I generally mostly waiting for 5.0 and up because the BT le libraries are needed for iOS connection
[Samsung Gear 2] iferlive:
Just to clarify things, the wireless chip that the gear 2 has is a generic chip that is capable of managing fm radio, Bluetooth and WiFi, THAT DOES NOT mean that the gear 2 will have WiFi or fm radio functionalities because the watch was not built with radios (antennas) for those functionalities, those are specific antennas that work a certain frequencies is not like you can build one and attach it to your watch.

Gear 2 will never have WiFi because is was not planned and built thinking on that. That's it.

Kind regards
[Samsung Gear 2] Chamopak:
Got it to work on my gear 2.

Did revert back to tizen. Will wait until it's more stable, but great job you guys!!!!!!

Maybe the gear 2 will get a new life after all.
[Samsung Gear 2] kavinzhao:
We can attach an antenna to it.. If you value WiFi and Radio more than water resistance.... Also you have to know where to attach those antenna.

And out of curiousity, how big is the source of a kernel?
[Samsung Gear 2] andrew.mackew:
Yep, and maybe, using the correct tools to open it up, it's possible even to keep the water resistance.. otherwise how Sammy would repair these watches?
[Samsung Gear 2] DAGr8:
double post agin
[Samsung Gear 2] DAGr8:
[MENTION=803006]biktor_gj[/MENTION] ?
[Samsung Gear 2] kavinzhao:
Yeah.. So Let's just hope we can do it.

Also.. I wonder why sensorhub is not working.. Isn't it the same one in Gear 1&Gear Live? Should be very easy to port them?
[Samsung Gear 2] biktor_gj:
It's not only the antenna, I guess you'll also need the antenna amplifier as well... Anyway first thing to check if that chipset part can be powered up. The bluetooth controller uses a high speed uart to communicate, but from what I've read, wifi is connected through SDIO. Maybe it's not even internally wired, in that case there's nothing to do.

About water resistance, if you keep the rubber band (see the ifixit teardown) in place when closing it you should be fine. The watch doesn't support more than 1m of water resistance, so air pressure won't be an issue just for opening it and closing it down.

The kernel source is about 80Mb compressed
[Samsung Gear 2] cool2004:
Biktor, is there a promotion in your job?