How to connect Android device to WiFi camera + Arduino using Android Studio - Android Studio

Hello Everyone,
I have an OnReal Wifi camera which emits its own wifi an android can connect to. Below is a link to the specific camera:
...amazon.com/OnReal-Camera-Hidden-Compatible-Android/dp/B01K9TQUXC
Now, overall, the ultimate goal is:
1. To wirelessly connect Android device to the camera (using its wifi) {Android Studio}
2. To wirelessly connect to Arduino microcontroller using BLE (the HC-05) module {Android Studio}
- The Arduino microcontroller will be hooked up to an Arduino ultrasonic sensor.
3. Click the video button on the camera to begin video {Physically}
4. Make the pre-connected Android device receive the video stream from the camera {Android Studio}
5. Make the pre-connected Android device receive (Serial?) input from the Arduino microcontroller {Android Studio}
6.1. If the distance is greater than 'x' cm (as received from the Arduino), then save the live frame - preferably to the cloud (Firebase?) - at that instant from camera's video stream {Android Studio}
6.2. Else if the distance is less than 'x' cm (as received from the Arduino), then [nothing new happens; inputs are still continued to be received {Android Studio}
7. (At some point), click the video button on the camera to stop video {Physically}
8. Now, the Android device has sent a number of images to the cloud (Firebase?) {Android Studio}
9. Android device pulls those images from the cloud and calls Image Recognition API - preferably requiring no internet (although MS API would be fine) {Android Studio}
10. Uses API to associate each image with a set of tags + creates a list/vector to store these sets of tags {Android Studio}
11. The user presses a button on the screen and uses (Google?) Voice Recognition to say the name of an object {Android Studio}
12. The Android device tries to find matches of the user's query in the created list/vector {Android Studio}
13. Displays at maximum 3 images which had a match with the user's query {Android Studio}
14. (At some point) user presses a button to clear all frames/images stored in the cloud (Firebase) {Android Studio}
I have researched some broken down examples of my project (the .java's + .xml's + etc...) but none compile... .
I have attached my Arduino Code (which does compile) as well for further reference.
Any code (manifest xml, layout xml's, java's, etc...) and further guidance would be very much appreciated!
Thanks.
Arduino Code
Code:
/*
This Arduino-Code is written for Visualizating measurement data from a microcontroller via Bluetooth.
Before starting this application, the Bluetooth-Module (HC-05) has to be coupled to the Smartphone.In the special case of the HC-05 the default PinCode for initiating the Coupling-Process is "1234".
Wiring: GND of HC-05 to GND Arduino, VCC of HC-05 to VCC Arduino, TX HC-05 to Arduino Pin 10 (RX) RX HC-05 to Arduino Pin 11 (TX)
*/
#include <SoftwareSerial.h>
SoftwareSerial BTserial(10, 11);
//The first two pins are for getting the sensor input from the ultrasonic sensor
//The remaining pin is for the led
int echoPin = 4, trigPin = 5, ledpin = 2;
int distance {};
void setup()
{
pinMode(echoPin, INPUT);
pinMode(trigPin, OUTPUT);
BTserial.begin(9600);
}
void loop()
{
distance = getUltrasonicDistance(trigPin, echoPin);
//The semicolon is there so the Android knows when it will receive a distance value (needed?)
BTserial.print(";");
BTserial.print(distance);
BTserial.print(";");
//I can edit this if needed.
delay(20);
}
//Functions which gets the distance...
int getUltrasonicDistance(int trigPin, int echoPin)
{
int distanceCentimeters;
float pulseLenMicroseconds;
//Bit-bang a small square wave on the trig pin to start the range finder
//The LOW AND HIGHS SIMPLY MEAN ON AND OFF
digitalWrite(trigPin, LOW);
delayMicroseconds(20);
digitalWrite(trigPin, HIGH);
delayMicroseconds(100);
digitalWrite(trigPin, LOW);
//Measures the pulse length from the echo pin
pulseLenMicroseconds = pulseIn(echoPin, HIGH);
//The program calculates the distance (in centimeters) using the speed of sound
distanceCentimeters = pulseLenMicroseconds / 29.387 / 2;
//returns the distance, an int
return distanceCentimeters;
}

Related

Excel VB question: re: Arrays

Hey,
I am working on something for work and it has to do with a simple database (excel file) with data kept in rows. This data is accessed using a userform that looks up a query that happens to be the data kept in the first column of the spreadsheet. Basically, each row contains 46 cells, including the first cell (the query).
I am hoping to use the same userform to search, update, save, print and quit excel. So far search works:
Code:
Sub CommandButton1_Click()
dim query as range
set query = range("A:A")
call readData(query.find(TextBox1, lookat:=xlWhole).row)
End Sub
Private Sub readData(x as integer)
Dim boxes as range
set boxes = range("A:A")
TextBox1 = boxes.cells(x).offset(0,0)
TextBox2 = boxes.cells(x).offset(0,1)
....
End Sub
This works fine for search; however, as there is 45 boxes containing different kinds of data, I would rather read the cells from the spreadsheet using a loop and setting the TextBoxN as a static array:
Code:
Sub readData(x as integer)
***** VB treats array(45) as an array having 46 elements *****
dim textBoxArray(45) as [u]Variant[/u]
set textBoxArray = array(TextBox1, TextBox2... TextBox46)
For i = 1 to 46
textBoxArray(i-1) = cells(x, i)
Next i
End Sub
Note that "query.find(TextBox1, lookat:=xlWhole).row" returns the row number of the query and this is passed as an integer to the readData sub-routine and is referred to as "x".
I would like to do this for the read and then do the same, although opposite for the update (i guess I could call it the 'write' back to the excel worksheet).
The problem is, with this code I get an error that says the array is not declared or arranged (Japanese laptop: 配列は割り当てられません。)
Question 1
Any of you developers with any vb experience know how I can correctly declare my array (would be nice if I could decare the array globally so that I don't have to re-declare it for every sub-routine, and I can just use the for loop in each sub-routine)?
At present, all the code is within the userform and I cannot seem to declare outside of a subroutine:
Code:
Public boxArray(45) as Variant
Sub CommandButton_Click()
...
End Sub
Question 2 SOLVED I removed the "set" from the line where I filled the array with each textbox. Tested it again and all data is flowing correctly. Only need question 1 answered.
Thank you.
Hey all, thanks for the replies; I didn't think the thread would be this popular.
I solved the problem with global variables. Instead of setting a fixed array size in the main code section dec area, I found another way of assigning values to all 46 textboxes.
Instead of:
Code:
Dim boxArray(45) as Variant
boxArray(45) = array(TextBox1, TextBox2, ... TextBox46)
then
Code:
For i = 1 to 46
boxArray(i-1) = cells(x,i)
Next i
I used vb's Control method/function (no array necessary):
Code:
For i = 1 to 46
Control("TextBox" + CStr(i)) = cells(x,i)
Next i
So i turned 46+ lines into 6+ lines into 3 lines.
MODS, this thread may be closed. THanks.

Scientific calculator to calculate dms

Hello, does anyone know a calculator for android to calculate in "dms" (Day,Minute,Second)?
e.g.:
3h50min + 30min = 4h20min
or
3°30' + 0°30' = 4°20'0'

[R&D][MOD]Nexus S Color Correction

This started out as an idea I had while trying to calibrate the screen color of my Nexus S using a colorimeter. While a lot of users are not particularly picky about colors, I do hope quite a number of people would also be interested in this. To give a clearer understanding for all, I'll put in a not-so-short introduction.
As most of us would know, AMOLED screens, while good in terms of brightness and contrast, tend to distort colors. If you're viewing an image on an AMOLED screen, you'll likely notice areas which appear oversaturated and have blown-out details. The reason behind this is that our AMOLED screens have a much wider gamut (i.e. displays more colors) than how images are encoded. If you look at the image below, the bigger triangle represents the set of colors that the AMOLED screen can display. The smaller triangle is the sRGB reference color which is how Android and most images are encoded.
​
Unfortunately for us, the Android OS isn't aware of this difference. A color with value of #00FF00 (pure green) should look like the green at the upper peak of the smaller triangle. But in reality, it is shown to us as the green of the larger triangle. This remapping between the two color spaces causes lighter shades of color to appear darker (or actually more saturated).
So far, the solution to fixing the problem is through the use of voodoo color (cheers to supercurio). Voodoo allows for the modification of gamma which somehow compensates for the saturation levels of the colors. Also, color multipliers allow for the shifting of the white point. White point, you ask? See, the intersection of the dotted lines? That is the white point which is how white would appear on the screen. Some like warm colors (white points to the right) while cool colors are to the left. However, gamma and multipliers only operate on a single color at a time. This means that the larger triangle will always remain the same shape regardless of the settings we use. Colors would look better but still not the same as the original intent.
So what can we do about it? Well one way would be by analyzing the way in which colors are mapped to a visually-oriented reference (such as the xyY/XYZ space shown in the above image). A standard sRGB image would be mapped using:
​
While the Nexus S (using the marmite kernel by bedalus with equal multipliers) would map out like:
​
In effect, you can find a map to convert the intended sRGB colors to the values usable by the screen to simulate the original rendering intent of the colors. This is done by using the following relationship:
​
Note that the other non-labelled matrix here is simply a way to shift the white point from 6500K (warm) to 9300K (cool) to display good colors on our devices using chromatic adaptation. The end effect is a means to fix color by simply mixing together red, green, and blue values (after gamma correction to be strictly accurate but this has its tolerances). The mix is just as shown above or in a more non-scientific notation:
Code:
R = 0.7043 * R + 0.3440 * B - 0.0028 * B
G = 0.0160 * R + 0.8930 * G + 0.0598 * B
B = 0.0195 * R + 0.0846 * G + 1.1185 * B
As an example, I've uploaded a before-and-after comparison of a test image. On a computer display, the right image (modified) would appear weird compared to the left image but if you load it up (or just view it) on your phone, you can see that the right one actually looks better (no oversaturation). This would be better if you have voodoo color with the multipliers set to more or less equal values.
​
The task then is to implement this on a kernel level (or similar) which I will touch on my next post (maybe tomorrow). Note that I have not successfully done the modifications as I lack the development skillz to match. In this regard, I would like to solicit the assitance of the dev community with a much wider experience with these things than I do.
So I decided to continue writing this today...
Unlike the voodoo color codes which rely on hardware (TL2796 AMOLED driver) to implement gamma correction, the color mixing process is a bit more involved on the software end. There are no chips on the Nexus S which can be configured to perform the mixing process natively. Instead, I have a few ideas on the implementation of the mixing process.
1. Rewrite the framebuffer
I've attempted doing this using native code by opening the /dev/graphics/fb0 device but the problem lies in timing. If the timing is off, the mixing either never occurs or is repeated several times for a given frame causing color distortions. This is further complicated by the use of double buffering on the device. Even more so with the switching behavior between double and triple buffering in JB! I've tried hijacking the VSYNC signal to operate on the timing (see colormix.c attached) but the result is still very glitchy. Or I may be doing it wrong...
2. Handle all routines that write to the framebuffer
Another way would be to handle all the writes to the framebuffer device. This eliminates the need for timing as processing occurs only once as the data is transferred to the framebuffer. I've seen the codes for cfbcopyarea.c, cfbimgblit.c, and cfbfillrect.c but I'm not sure where direct writes to the framebuffer (using mmap access) are handled (if at all handled). So again, I'm not too sure about this one.
3. Hijack the interface from the LCD driver
Yet another unsure idea by the way. Since the LCD driver interact with the physical hardware through 24 GPIO pins, there should be some code describing how data is transferred to these pins. At that level, it might be possible to manipulate the signal just before it is sent to avoid timing issues mentioned earlier.
Most of these ideas are speculative from a person who is not really that deep into development (I'm more of an image processing researcher ). Any feedback and ideas from the community would be great!
I'm down with matrices. Sign me up!
some good ideas here, if you manage to calibrate our screens without using voodoo, this idea can potentially be used on other amoled devices such as s3 to calibrate it, removing it's over-saturation
bedalus said:
I'm down with matrices. Sign me up!
Click to expand...
Click to collapse
LOL. Matrices are fun! Thanks bedalus!
By the way, I took a look at the driver codes and it may be possible to find the next framebuffer using ioctl (from an external program).
Code:
case S3CFB_GET_CURR_FB_INFO:
next_fb_info.phy_start_addr = fix->smem_start;
next_fb_info.xres = var->xres;
next_fb_info.yres = var->yres;
next_fb_info.xres_virtual = var->xres_virtual;
next_fb_info.yres_virtual = var->yres_virtual;
next_fb_info.xoffset = var->xoffset;
next_fb_info.yoffset = var->yoffset;
next_fb_info.lcd_offset_x = 0;
next_fb_info.lcd_offset_y = 0;
if (copy_to_user((void *)arg,
(struct s3cfb_next_info *) &next_fb_info,
sizeof(struct s3cfb_next_info)))
return -EFAULT;
break;
Invoking this should at least resolve the double buffering issues if timed correctly with VSYNC. Again, IF.
noobiekins said:
some good ideas here, if you manage to calibrate our screens without using voodoo, this idea can potentially be used on other amoled devices such as s3 to calibrate it, removing it's over-saturation
Click to expand...
Click to collapse
Yes actually. You just need colorimeter readings of the locations of the red, green, and blue primaries to build the matrix for any other device and compensate for it.
So based on my last post I tried looking at the behavior of the framebuffer device. It seems that there are a few parameters which are being used by the device namely:
xres/yres - dimensions of the visible image in pixels
xres_virtual/yres_virtual - dimensions of the virtual image in pixels
xoffset/yoffset - position in the framebuffer being used
Click to expand...
Click to collapse
Dumping from a test program, I get one of two sets of values from the framebuffer device:
Code:
Start address: 4debf000
Visible resolution: 480, 800
Virtual resolution: 480, 5600
Offsets: 0, 800
Start address: 4debf000
Visible resolution: 480, 800
Virtual resolution: 480, 5600
Offsets: 0, 0
This more or less tells us that the framebuffer memory is actually divided into multiple buffers each with the visible size (480x800) of the display. They alternate (using the offsets) to provide the double buffering effect Android uses. However, what I can't understand is why there are 7 buffers allocated for the device instead of at most 3 (for triple buffering). It might be useful to take snapshots of the entire framebuffer and write them to consecutive bitmaps but I won't bother with that at the moment.
I've also tried using this behavior to synchronize the framebuffer writes using changes in the offset as a trigger:
Code:
for (;;)
{
do
{
// Extract variable framebuffer information
if(ioctl(fd, FBIOGET_VSCREENINFO, &next_vi) < 0)
{
perror("Cannot extract variable framebuffer information");
return -1;
}
} while (next_vi.yoffset == cur_vi.yoffset);
...
<insert color mixing here>
...
}
Unfortunately, the screen still doesn't update as desired. Lots of flickering involved. I'm not sure if the memory accesses are just too slow such that the screen refreshes before we completely rewrite the framebuffer or if its some other problem. I've attached the full code for anyone who might be able to shed some light on this. In this code, I just did a dummy rewrite (red = green, blue = green) instead of color mixing to avoid computation therefore minimizing CPU loading and to have a more pronounced effect on the screen.
I'm clueless about video, but I'm digging around... These are the files that compile in /drivers/video/
Code:
/home/dave/android/androidkernel/drivers/video/backlight/lcd.o
/home/dave/android/androidkernel/drivers/video/backlight/backlight.o
/home/dave/android/androidkernel/drivers/video/backlight/built-in.o
/home/dave/android/androidkernel/drivers/video/fb_notify.o
/home/dave/android/androidkernel/drivers/video/display/built-in.o
/home/dave/android/androidkernel/drivers/video/fb.o
/home/dave/android/androidkernel/drivers/video/fbsysfs.o
/home/dave/android/androidkernel/drivers/video/samsung/s3cfb.o
/home/dave/android/androidkernel/drivers/video/samsung/s3cfb_nt35580.o
/home/dave/android/androidkernel/drivers/video/samsung/s3cfb_tl2796.o
/home/dave/android/androidkernel/drivers/video/samsung/s3cfb_fimd6x.o
/home/dave/android/androidkernel/drivers/video/samsung/built-in.o
/home/dave/android/androidkernel/drivers/video/cfbimgblt.o
/home/dave/android/androidkernel/drivers/video/fbmem.o
/home/dave/android/androidkernel/drivers/video/modedb.o
/home/dave/android/androidkernel/drivers/video/cfbcopyarea.o
/home/dave/android/androidkernel/drivers/video/fbcmap.o
/home/dave/android/androidkernel/drivers/video/omap2/displays/built-in.o
/home/dave/android/androidkernel/drivers/video/omap2/built-in.o
/home/dave/android/androidkernel/drivers/video/built-in.o
/home/dave/android/androidkernel/drivers/video/fbcvt.o
/home/dave/android/androidkernel/drivers/video/cfbfillrect.o
/home/dave/android/androidkernel/drivers/video/fbmon.o
I'm combing through these files now to see if there's any obvious points to hack in.
bedalus said:
I'm clueless about video, but I'm digging around... These are the files that compile in /drivers/video/
Code:
/home/dave/android/androidkernel/drivers/video/backlight/lcd.o
/home/dave/android/androidkernel/drivers/video/backlight/backlight.o
/home/dave/android/androidkernel/drivers/video/backlight/built-in.o
/home/dave/android/androidkernel/drivers/video/fb_notify.o
/home/dave/android/androidkernel/drivers/video/display/built-in.o
/home/dave/android/androidkernel/drivers/video/fb.o
/home/dave/android/androidkernel/drivers/video/fbsysfs.o
/home/dave/android/androidkernel/drivers/video/samsung/s3cfb.o
/home/dave/android/androidkernel/drivers/video/samsung/s3cfb_nt35580.o
/home/dave/android/androidkernel/drivers/video/samsung/s3cfb_tl2796.o
/home/dave/android/androidkernel/drivers/video/samsung/s3cfb_fimd6x.o
/home/dave/android/androidkernel/drivers/video/samsung/built-in.o
/home/dave/android/androidkernel/drivers/video/cfbimgblt.o
/home/dave/android/androidkernel/drivers/video/fbmem.o
/home/dave/android/androidkernel/drivers/video/modedb.o
/home/dave/android/androidkernel/drivers/video/cfbcopyarea.o
/home/dave/android/androidkernel/drivers/video/fbcmap.o
/home/dave/android/androidkernel/drivers/video/omap2/displays/built-in.o
/home/dave/android/androidkernel/drivers/video/omap2/built-in.o
/home/dave/android/androidkernel/drivers/video/built-in.o
/home/dave/android/androidkernel/drivers/video/fbcvt.o
/home/dave/android/androidkernel/drivers/video/cfbfillrect.o
/home/dave/android/androidkernel/drivers/video/fbmon.o
I'm combing through these files now to see if there's any obvious points to hack in.
Click to expand...
Click to collapse
Great! And here I was having trouble figuring out which files were actually being used...
I'm not sure about other types of hacks but if we're talking about framebuffer rewriting (like what I've been trying to do), the following segment in s3cfb.c may be useful:
Code:
static irqreturn_t s3cfb_irq_frame(int irq, void *data)
{
struct s3cfb_global *fbdev = (struct s3cfb_global *)data;
s3cfb_clear_interrupt(fbdev);
fbdev->vsync_timestamp = ktime_get();
wmb();
wake_up_interruptible(&fbdev->vsync_wq);
return IRQ_HANDLED;
}
Assuming the system interrupt for VSYNC is enabled (which I assume to be the case otherwise the Choreographer API of JB shouldn't work), then maybe a hack there could be done to process the framebuffer just in time with the frame refresh. This is of course under the assumption that the rewrite is fast enough. I'll try sorting through those files as well to see if there's some easier hack.
Couldn't you pre-process the data before it gets to the fb? It sounds like you want to read it and rewrite it. Did i understand correctly?
bedalus said:
Couldn't you pre-process the data before it gets to the fb? It sounds like you want to read it and rewrite it. Did i understand correctly?
Click to expand...
Click to collapse
Yep, you got it right. Right now, I'm trying to read and re-write but as you said, ideally it should be pre-processed before it even arrives at the framebuffer. I'm not sure if its possible though. Applications can access the framebuffer by mmap-ing it onto shared memory which they can write directly to. I've found functions for fb_write and fb_mmap (both in fbmem.c) but I'm not sure if they're being used internally by the kernel to handle mmap and write requests. I have too little knowledge of kernel processes to know for sure.
fb_write looks fully internal to me.
It looks like the OS is given access in drivers/video/fbsysfs.c
bedalus said:
fb_write looks fully internal to me.
It looks like the OS is given access in drivers/video/fbsysfs.c
Click to expand...
Click to collapse
I'm not quite sure what you mean by internal. Does that mean that if we modify it, we can change how all data is written to the framebuffer?
As for fbsysfs.c, I can see how the OS writes the variable information pertaining to the framebuffer. However, I can't seem to find any reference to the actual data being written to the framebuffer. Did I miss something?
nightsky87 said:
I'm not quite sure what you mean by internal. Does that mean that if we modify it, we can change how all data is written to the framebuffer?
As for fbsysfs.c, I can see how the OS writes the variable information pertaining to the framebuffer. However, I can't seem to find any reference to the actual data being written to the framebuffer. Did I miss something?
Click to expand...
Click to collapse
I'm not 100% sure yet, but I think if you needed to, there is probably a way to hack in at that point.
However supercurio hacked into the gamma here arch/arm/mach-s5pv210/herring-panel.c
...and RGB: drivers/video/samsung/s3cfb_tl2796.c
Is your gamut correction totally independent of RGB/gamma?
EDIT: Oh, I see it now. You have to correct R based partly on G and B etc. Okay. I'll keep looking.
bedalus said:
I'm not 100% sure yet, but I think if you needed to, there is probably a way to hack in at that point.
However supercurio hacked into the gamma here arch/arm/mach-s5pv210/herring-panel.c
...and RGB: drivers/video/samsung/s3cfb_tl2796.c
Is your gamut correction totally independent of RGB/gamma?
EDIT: Oh, I see it now. You have to correct R based partly on G and B etc. Okay. I'll keep looking.
Click to expand...
Click to collapse
Yep... I realized that my attempt at buffer rewrites read and write from the framebuffer one byte at a time! Major I/O overheads! I totally forgot about that.
I'll try rewriting that code as well.
Here's another file:
Code:
include/linux/tl2796.h
It contains the template for the RGB multipliers.
EDIT: I'm trying to see which files use this header now
EDIT: arch/arm/mach-s5pv210/herring-panel.c
...and drivers/video/samsung/s3cfb_tl2796.c
...these are the only two files, so the matrix transformation you want to perform probably needs to happen in one of these files only.
bedalus said:
Here's another file:
Code:
include/linux/tl2796.h
It contains the template for the RGB multipliers.
EDIT: I'm trying to see which files use this header now
EDIT: arch/arm/mach-s5pv210/herring-panel.c
...and drivers/video/samsung/s3cfb_tl2796.c
...these are the only two files, so the matrix transformation you want to perform probably needs to happen in one of these files only.
Click to expand...
Click to collapse
I think the RGB multipliers you're referring to are the same ones used by supercurio and they operate on a per-color basis. In fact, those two files don't directly modify RGB values as far as I can tell. By the time the signal reaches the TL2796 AMOLED driver, they're already mapped to the GPIO_LCD_D<> ports (see /arch/arm/mach-s5pv210/include/mach/gpio-herring.h for the physical mapping).
EDIT:
I did a grep on fb_write and bumped into this code in /include/linux/fb.h:
Code:
/* For framebuffers with strange non linear layouts or that do not
* work with normal memory mapped access
*/
ssize_t (*fb_read)(struct fb_info *info, char __user *buf,
size_t count, loff_t *ppos);
ssize_t (*fb_write)(struct fb_info *info, const char __user *buf,
size_t count, loff_t *ppos);
Since I can confirm that the framebuffers with our devices can support mmap, I suppose this means any app can directly read/write to the framebuffer without going through some intermediate function. This leaves us with framebuffer rewrites or hijacking the transfer of data from framebuffer to physical device. I like the second option better.
nightsky87 said:
I think the RGB multipliers you're referring to are the same ones used by supercurio and they operate on a per-color basis. In fact, those two files don't directly modify RGB values as far as I can tell. By the time the signal reaches the TL2796 AMOLED driver, they're already mapped to the GPIO_LCD_D<> ports (see /arch/arm/mach-s5pv210/include/mach/gpio-herring.h for the physical mapping).
Click to expand...
Click to collapse
After a lot of head scratching, I see what you mean.
I performed a search for S5PV210_GPF* and found these files:
Code:
drivers/gpio/gpio-s5pv210.c
arch/arm/mach-s5pv210/herring-panel.c
arch/arm/mach-s5pv210/setup-fb.c
arch/arm/mach-s5pv210/mach-herring.c
...all of which are compiled into the kernel.
Probably if the best place to intervene is on the GPIOs, it must be in one of these files. I'll keep looking!
EDIT: I just saw your edit in the previous post, and I agree! Option 2 seems preferable.
bedalus said:
After a lot of head scratching, I see what you mean.
I performed a search for S5PV210_GPF* and found these files:
Code:
drivers/gpio/gpio-s5pv210.c
arch/arm/mach-s5pv210/herring-panel.c
arch/arm/mach-s5pv210/setup-fb.c
arch/arm/mach-s5pv210/mach-herring.c
...all of which are compiled into the kernel.
Probably if the best place to intervene is on the GPIOs, it must be in one of these files. I'll keep looking!
EDIT: I just saw your edit in the previous post, and I agree! Option 2 seems preferable.
Click to expand...
Click to collapse
Ironically, register definitions don't seem to be in those files. They probably used a different set of defines. What I did find was this in /drivers/video/samsung/s3cfb_fimd6x.c:
Code:
int s3cfb_set_buffer_address(struct s3cfb_global *ctrl, int id)
{
struct fb_fix_screeninfo *fix = &ctrl->fb[id]->fix;
struct fb_var_screeninfo *var = &ctrl->fb[id]->var;
struct s3c_platform_fb *pdata = to_fb_plat(ctrl->dev);
dma_addr_t start_addr = 0, end_addr = 0;
u32 shw;
if (fix->smem_start) {
start_addr = fix->smem_start + (var->xres_virtual *
(var->bits_per_pixel / 8) * var->yoffset);
end_addr = start_addr + fix->line_length * var->yres;
}
if (pdata->hw_ver == 0x62) {
shw = readl(ctrl->regs + S3C_WINSHMAP);
shw |= S3C_WINSHMAP_PROTECT(id);
writel(shw, ctrl->regs + S3C_WINSHMAP);
}
writel(start_addr, ctrl->regs + S3C_VIDADDR_START0(id));
writel(end_addr, ctrl->regs + S3C_VIDADDR_END0(id));
if (pdata->hw_ver == 0x62) {
shw = readl(ctrl->regs + S3C_WINSHMAP);
shw &= ~(S3C_WINSHMAP_PROTECT(id));
writel(shw, ctrl->regs + S3C_WINSHMAP);
}
dev_dbg(ctrl->dev, "[fb%d] start_addr: 0x%08x, end_addr: 0x%08x\n",
id, start_addr, end_addr);
return 0;
}
Unfortunately for use, this seems to use DMA transfers. The driver sets the start and end addresses for the hardware to automatically transfer the data to the registers representing the GPIO. The only way I can think of to modify this behavior is in this sequence:
1. Create our own "framebuffer" (or double the size of the current framebuffer)
2. Mix colors from the original buffer and write it to ours
3. Repeat every new frame
4. Point the DMA transfer source to our framebuffer instead of the original
Quite a complex process I think... I'm not even sure if its worth the development effort.
nightsky87 said:
Ironically, register definitions don't seem to be in those files. They probably used a different set of defines. What I did find was this in /drivers/video/samsung/s3cfb_fimd6x.c:
Code:
int s3cfb_set_buffer_address(struct s3cfb_global *ctrl, int id)
{
struct fb_fix_screeninfo *fix = &ctrl->fb[id]->fix;
struct fb_var_screeninfo *var = &ctrl->fb[id]->var;
struct s3c_platform_fb *pdata = to_fb_plat(ctrl->dev);
dma_addr_t start_addr = 0, end_addr = 0;
u32 shw;
if (fix->smem_start) {
start_addr = fix->smem_start + (var->xres_virtual *
(var->bits_per_pixel / 8) * var->yoffset);
end_addr = start_addr + fix->line_length * var->yres;
}
if (pdata->hw_ver == 0x62) {
shw = readl(ctrl->regs + S3C_WINSHMAP);
shw |= S3C_WINSHMAP_PROTECT(id);
writel(shw, ctrl->regs + S3C_WINSHMAP);
}
writel(start_addr, ctrl->regs + S3C_VIDADDR_START0(id));
writel(end_addr, ctrl->regs + S3C_VIDADDR_END0(id));
if (pdata->hw_ver == 0x62) {
shw = readl(ctrl->regs + S3C_WINSHMAP);
shw &= ~(S3C_WINSHMAP_PROTECT(id));
writel(shw, ctrl->regs + S3C_WINSHMAP);
}
dev_dbg(ctrl->dev, "[fb%d] start_addr: 0x%08x, end_addr: 0x%08x\n",
id, start_addr, end_addr);
return 0;
}
Unfortunately for use, this seems to use DMA transfers. The driver sets the start and end addresses for the hardware to automatically transfer the data to the registers representing the GPIO. The only way I can think of to modify this behavior is in this sequence:
1. Create our own "framebuffer" (or double the size of the current framebuffer)
2. Mix colors from the original buffer and write it to ours
3. Repeat every new frame
4. Point the DMA transfer source to our framebuffer instead of the original
Quite a complex process I think... I'm not even sure if its worth the development effort.
Click to expand...
Click to collapse
Well, i need a new challenge
bedalus said:
Well, i need a new challenge
Click to expand...
Click to collapse
Great then! Good luck!!
...just kidding
The way I see it, it might not be that hard after all. The way the code is structured, seems to show that you can just retain most of the fb routines. They mostly describe stuff like offsets, dimensions, and the like. If you copy the ENTIRE framebuffer into another memory location and manipulate that, you won't have to concern yourself with the rest of those functions. Yeah it uses up about 17 MB more of precious RAM (if my calculations are right) but at least you only have to set the DMA addresses instead of recoding a lot of things.
Before anything, can you somehow check which files in the /drivers/gpu/ folder are being used/compiled? I think I may see something useful in those files but I'm not sure if its even relevant.

[ ROM ] Flyme V5.1.7.18R [ Stable ] [primary/secondary] [ 22-July-2016 ]

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Mainly I have concentrated on performance & camera
Mainly I have concentrated on performance & camera
I am not responsible for anything that may happen to your phone as a result of installing custom roms and/or kernels. you do so at your own risk and take the responsibility upon yourself.
Meizu Technology Co., Ltd. (Chinese: 魅族科技有限公司; pinyin: Mèizú Kējì Yǒuxiàn Gōngsī) is a Chinese consumer electronics company based in Zhuhai, Guangdong province, China. Founded in 2003, Meizu began as a manufacturer of MP3 players and later MP4 players. As of 2008, Meizu moved its focus from MP3 and MP4 players to smartphones, with their first smartphone being the Meizu M8. Meizu is one of the top ten smartphone manufacturers in China with 8.9 million units sold worldwide in the first half of 2015.
The current flagship device of Meizu is the Meizu PRO 5, a smartphone with an all-metal body, an Exynos 7420 8-core 64-bit processor, Flyme OS 5, and a Sony 21.16-megapixel 4K camera that has a 6P lens, laser-aided focusing and FotoNation 2.0.
Desktop
Floating notice: supports floating inform, to avoid the operation is interrupted.
Multitasking: new card multitasking list, long press to lock individual applications.
Split-screen mode: Multi-screen mode to create a list of tasks while using two applications, you can adjust the window proportions (only part of the application).
Batch finishing icons: Long press the desktop select "sort icon 'batch select the icon to move to a different desktop or folder.
Shake finishing the desktop: Go to “arrange icons” mode, shake your desktop tidy Fast Recovery.
Folders are automatically named: Create a folder, depending on the application type for the folder name is automatically.
Notification bar
Optimize the layout: drop-down notification bar without notice Expand all default switch, when there are multiple notifications pull-down notification to view more.
Notify management: Settings - Notification and Status Bar - application notification management, support each application switching and priority setting for notification.
Lock screen
Music Locker: New music lock screen, lock screen display directly covers and lyrics.
Lock screen notifications: Settings - notification and status bar, select whether to display the notification in the lock screen to notify whether the new bright screen.
Information
Customer Service Assistant: New customer assistant accounts, support online chat.
Floating notice: Supports quick reply message and copy the code in the floating notification.
Smart SMS: Update Smart SMS service menu, more powerful.
Phone
Floating notice: New calls Floating notice.
Dialpad: Suspended dial plate design, support slide switch contacts, call records, the Yellow Pages.
Online Yellow Pages: New independent online Yellow Pages, online services, one-touch access.
Yellow Correction: Yellow Pages for online identification number, the error correction can take the initiative in the contact details.
Number Tags: against harassment calls, support for online marking the contact details.
Recording List: Telephone - setting “recorded message” and “call recording” can see the individual recordings.
Dialpad switch: to enter the phone - setting, open “dial pad input switching,” in the dialpad click on the lower left corner of the keyboard symbol to switch T9 and full keyboard dialpad dialpad.
Flyme communication
Switching numbers: support changing the network telephone number bind.
Set up
The new design: for interaction and functional grouping adjustment.
Search: New search function, support for the use of text and voice search settings.
Volume Category: Settings - Sound and vibration - volume, the new volume category management.
Network Sharing: Settings - Wireless Network, click on the Wi-Fi hotspot to share Wi-Fi network through a two-dimensional code.
Preferred networks: Settings - Wireless Network, click on the Wi-Fi hotspots, set the priority for this network connection.
Energy management: Optimizing power ranking, classification display hardware power consumption.
Default Application: Settings - Application Management - default applications, support for different categories to set the default application.
Analog Color: Settings - Accessibility - Developer Options - simulation color space, color blindness or color weakness mode supported by the analog color space.
Search
Plugin: New weather search 4 * 2 widget.
Home: New Search Home, updated in real time hot search words.
Card: search results by showing the card, the interface cleaner.
Input
Candidate words: new candidate word dropdown, improve the speed choice of words.
Transcriber: New full-screen handwriting keyboard input more casual.
Symbol Keyboard: New independent symbols keyboard, keypad lock symbol support continuous input symbols and expression.
Vibration sense switch: to enter the input settings screen, select whether to open the key vibration.
Mobile butler
Rights management: access rights management - setting, open “cutting each other to start the application” switch, wake each behavior tracking applications, a key force off wakeup path.
Harassment intercept: harassment interception to a safe center to support blocking unknown numbers and hidden numbers.
Garbage clean white list: application cache, redundant installation package, application uninstall remnants supports adding white list, to avoid false cleanup.
Regular cleaning: regular cleaning new “scan and clean” option rubbish more peace of mind.
Notification bar traffic information: traffic management - setting, the new “Notification bar shows the flow of information” switch.
Mobile Acceleration: clean up permanent background, to accelerate the speed of the phone.
Rapid examination and a key optimization: no need to wait to enter the interface will be able to know the phone health status, one-click fix all problems.
Applications whiten: support the detection cottage application, eliminate safety hazards.
Toolbox
New “toolbox” App.
Flashlight: Support SOS mode and brightness adjustment third gear.
Mirror: Support normal, twist, rotate, mirror effect symmetrical four.
Compass: Support orientation and latitude and longitude display.
Level: Intuitive view levelness.
Measurement scale: Supports cm and inch two scales.
Magnifier: supports torch mode can also be used at night.
Shortcuts: frequently used tool to add support for the desktop shortcut.
Browser
Home: Home new design.
Window: Window tag optimization show form.
Card: Added “micro letter headline” card.
Toolbar: new toolbar at the bottom, more intuitive operation.
Music
Music Library: Access shrimp music, comprehensive music library rich resources.
Contents: Introduction of a single song shrimp, shrimp rankings, selection set, you may also like the daily recommended content.
Radio: New offline radio function, WLAN environment to automatically update the music library offline.
Song Roaming: For love of singles, a key roam similar songs.
Singles Comments: New singles comment feature, data access shrimp music reviews.
Artist Collection: Artist Collection features new, easy to find your favorite artists.
Members receive: Music opened Thanksgiving activities, membership users can receive free two-month membership services, after the purchase of non-members can also receive a free membership.
Video
Video Feed: New video feeds, support update reminders, chase drama easier.
Potatoes from Channel: New potatoes from channel content, rich video library.
Online seat selection: Adjust movie theaters interface, more convenient booking.
Dropzone: In video playback applications support floating window, the perfect realization of “picture in picture”; support suspension / full screen seamlessly switch playback, without cache.
Cache management: the same series of video automatic classification, by “cache more” direct cache with other video episodes, cache operations more convenient.
Camera
Shooting GIF: GIF new shooting mode, easy homemade face pack.
Time Watermark: Camera - set new time watermark switch.
Voice camera: Camera - setting new voice camera switch.
Flash: Flash memory setting status, avoid duplication.
Manual mode: increase saturation, contrast and white balance adjustment option.
Gallery
Map Mode: Gallery - set, display photos in a map, generate personal and exclusive travel map.
Pictures: Favourites favorite pictures quickly browse in the collection folder.
Custom Cover: Press folder covers, replace favorite picture as the cover.
Filter Small size: Gallery - setting, the new small-size image filter switch, gallery cleaner.
Silent backup: Gallery - setting new silent backup switch.
Is hidden: Press the folder displayed directly hide unwanted folders.
Photo Week view: two-finger zoom, free to switch month and week views, more convenient management.
Photo Editor: Optimize photo editing features, free to adjust the level of the filter and mosaics.
Set Wallpaper: Set wallpaper function optimization, support for custom fuzzy level and overlay pattern.
Topic landscaping
Font Replacement: support the replacement of system fonts without root and rebooting.
Variety lock screen: New Variety lock screen, unlocking is a pleasure.
App Store
Best application: the most beautiful application and content collaboration, found a small but beautiful application.
Applications Tags: Applications New Applications tab shows details page for easy viewing similar applications.
Permissions Show: The new application details page showing detailed permissions entrance, detailed permissions can understand the application before installation.
Micro-channel sharing: sharing style micro-channel optimization.
Calculator
Rates search: When Conversion Rates support direct search by country name.
Unit operation: When the unit converter supports direct operation.
Uppercase conversion: Press the calculated results can be directly converted to uppercase digital.
Clock
Batch delete: Supports long press batch delete alarm and world clock.
Lock screen weather: it removes the lock screen clock weather animation, text display weather information.
Time scale: Timer setting to adjust the time scale style.
File
Design: Optimizing directory structure, file classification provides entry.
Remote management: new FTP remote management capabilities, the same Wi-Fi environment, no data line management phone files directly on the computer.
Hidden folders: Documents - setting, the freedom to choose whether to display hidden folders / directories.
Storage space display: Docs display remaining storage space.
Display: adjust the length of the file name is displayed, you can view more detailed filenames.
Find the phone
Loss reporting mode: Added a key report the loss, report the loss will temporarily restore the phone to factory state, seal all private data (images, video, etc.), to ensure that the loss of phone, private data will not be disclosed.
On-line reminder: When the phone is lost without waiting for the phone line, on the line after reporting the loss as long as the message will immediately notify the owner.
Intelligent alerts Alert: When a lost handset without knowing the exact location in the vicinity of the time, intelligent alerts using the Alert feature, the phone automatically sound.
Send a message: Find mobile phone service built dialogue channel, even if the missing cell phone SIM card is not inserted, you can still carry on a dialogue with each other.
Intelligent Face capture: After reporting the loss will be smart open face capture, Time Lapse mobile phone users do not face.
Notes
Switching topics: new theme switching capabilities, built-in themes and fonts four different plate.
Search notes: Add notes searching for a more convenient.
Text Share: Add text form of sharing notes.
Graffiti: Graffiti support directly into the drawing board.
Automatic numbering: support number automatically created when editing notes.
Recording Animation: Animation recording new record is inserted.
Desktop plug-in: plug-in supports fast new recordings and photographs, support for displaying the contents of all notes.
Sketchpad
Color: Add more preset color.
User Center
New Independent User Center App.
User level: New user rating system, to enhance the level to get more privileges.
Supplementary Information: Support Extended user details.
Integral Center: new integration center to support exchange gifts, earn points, points sweepstakes.
Information
Column Category: Home columns support the classification display, browsing more convenient.
Data Fusion: Fusion feed data under the same section, read more peace of mind.
Interactive adjustment: Adjust Subscription Center, individual centers, the article details the interaction.
Weather
Interface: The new weather interface, you can see more content in the home.
Share: A long way to share detailed weather information Screenshot.
Urban management: direct display of weather information in different cities in urban management interface.
Weather warnings: New weather warning function to support and friends to share early warning information.
Domestic services
Cinema Movies: online seat selection introduces new movie and the upcoming movie details, the new movie stills View.
Travel: New hotels and airfare booking function.
Calendar
Constellation almanac: Support Calendar Home View constellations and almanac information.
Event Suspension Ball: New event suspension ball, quick to create a new event.
Calendar projection device: New Calendar projections, supports date projections, interval estimation and public Lunar conversion.
Interval Display: Click on any date, the number of days in the calendar left corner Quick View.
Notification: Permanent cancellation notification bar notification, slide cancel.
Game Center
Online content: the game details page to increase the game Raiders, evaluation, information, video, and other content packs.
Micro-channel sharing: sharing style micro-channel optimization.
Mail
Account Settings: Press the mailbox type to add new accounts automatically configure account information.
Gestures Zoom: Theme card supports gestures to zoom, browse more relaxed details.
Attachment: New Attachment Manager functions, optimizing mail attachment display position.
Search: a substantial increase in search speed, highlight keyword.
Go to TWRP
Wipe cache / dalvik cache / data / system......
flash rom (gapps included in rom)
flash lcd patch in yureka plus only
Reboot
After first boot is completed REBOOT you are device ( Important )
NEW VERSION
Flyme OS V5.1.7.18R [NOTE: for primary users you have to increase system partition ]
Lcd patch V5.1.7.18R
Older version
FlymeOS V5.1.7.4R: link STABLE ( NOTE: for primary users you have to increase system partition )
15 sec boot patch :link ( NOTE: if you flash it then rom boot in 15sec )
LCD patch : link
FlymeOS V5.1.6.24R : link STABLE ( NOTE: for primary users you have to increase system partition )
15 sec boot patch : link ( NOTE: if you flash it then rom boot in 15sec )
LCD patch : link
Flyme OS V5.1.6.13R : link Stable ( Note : for primary users should increase system partition )
Lcd patch : link
Flyme V5.1.5.20R : link
Lcd patch : link
flyme os v5.1.5.13R : link
lcd patch : link
Heat reduce patch : link
New versions
Flyme V5.1.5.13R : link beta ( Note : support only as secondary rom )
LCD patch : link
Flyme v5.0R stable : Link
Lcd for yureka plus : Link
flyme 5.0R (beta) : Link
Base rom : Link
Kernel source : Link
YU Televentures.....................for Device
Cyanogen team.......................for cos 12 & cos 12.1
Meizu................................................for flyme team
@Annabathina
YU YUREKA
YU YUREKA PLUS​
XDA:DevDB Information
[ ROM ] Flyme V5.1.7.18R [ Stable ] [primary/secondary] [ 22-July-2016 ], ROM for the YU Yureka
Contributors
uinod3, Annabathina
Source Code: https://github.com/FlymeOS
ROM OS Version: 5.1.x Lollipop
ROM Kernel: Linux 3.10.x
ROM Firmware Required: Newest 5.1.xModem and Bootloader for your device
Based On: flyme
Version Information
Status: Stable
Current Stable Version: 5.1.7.18R
Stable Release Date: 2016-07-22
Current Beta Version: 4.5R
Beta Release Date: 2015-12-14
Created 2016-02-21
Last Updated 2016-09-17
Reserved
Reserved
I am getting error "unmount of /system failed; no such volume" while flashing.
Prabhdeep567 said:
I am getting error "unmount of /system failed; no such volume" while flashing.
Click to expand...
Click to collapse
read installation instructions carefully
not suitable for daily use,wheather and some other settings are in chinies and much hot. cm themes not work. wait for next build
Annabathina said:
read installation instructions carefully
Click to expand...
Click to collapse
I read instructions and did the same but i am still getting the same error.
Reserved for video review
anup34 said:
Reserved for video review
Click to expand...
Click to collapse
Hi this is @Annabathina....
where is video review bro....?
Need Help to turnoff Hardware key backlight
hardware key backlight irritates please guide me to turn it off
Not working!!!
After selecting the language the system crashes giving a message 'settings stopped working.' What should I do????
How to increase system partition?
Could anyone upload it somewhere else because i don't know how to download it?
stuck at yu logo
I flashed successfully but my device is not booting
I flashed this ROM and my phone got stuck in YU logo , what should I do so that it can be flashed in my yureka plus , I flashed the 1gb ROM with lcd patch still it did not work. !! Any solution please.....
I am flashed this ROM on my yureka plus stuck at logo how to fix this problem
does it support volte??
No Bugs? What a lie lol
Battery drain asf
Audio shattering
Oh ,wait
The camera, it's awesome ... It remembered the last time i went to funhouse in carnival....

Tasker Scene WebView JavaScript Interaction

Is it possible to call a Javascript function that exists within a WebView from Tasker? I tried calling a URL on the WebView of "javascript:FUNCTION_NAME()", but that did not seem to work.
This is a completely random example. Lets say, from Tasker, that I want to be able to change the background color of the body of the WebView.
In the webview, I have the code
JavaScript:
function ChangeBGColor(NewColor)
{
document.body.style.backgroundColor=NewColor;
}
I want to be able to call ChangeBGColor() from Tasker with a color.
I remember having this same question a while back and was unable to find a solution that didn't involve sending HTTP requests, so I came up with a really weird hacky solution. I'm not sure its going to work for your situation, but maybe it can give you some ideas.
On the web side- have a transparent div element that occupies a single pixel. Put it in a corner or somewhere you won't accidently touch it. Now, add an event listener to it like this:
element.addEventListener('touchend', (e)=> {
let x = e.changedTouches[0].clientX;
let y = e.changedTouches[0].clientY;
renderColor(x, y);
});
On the Tasker side- If you don't already have it, download AutoInput, which is plugin that was created by Joao Diaz before he took over development of Tasker, and its incredibly cheap for what it does. You can use it to simulate a swipe gesture that starts at that exact spot on the screen, and ends at the coordinates you specify. You now have a way to send two values from tasker to you Javascript with a possible range of your screen resolution.
This might be challenging if you want the full spectrum of colors, because ideally you would want 3 parameters with 256 possibe values (0 for 00 and 256 for FF), so you'll have to figure out a way to encode and decode your color. You could either dumb down the resolution of colors and then use some math involving the modulus operator, but a better way would be to send the data via two swipe gestures, which would give you 4 parameters to work with- so to send white with full opacity (FFFFFFFF), simulate a swipe starting at 0,0 and ending at 256, 256 (FF or 256 for your alpha value, and the same for red), have your Javascript function store that in a variable. Then, send the second swipe which in this case will be the same as the first, and you now have 4 values to give you your color. Keep in mind you'll want to offset everything by 1 or you wouldn't be able to send black, since swiping from 0,0 to 0,0 won't trigger anything.

Categories

Resources