Connect ov9734 camera to msm8953 (Snapdragon 626) - Android Software/Hacking General [Developers Only]

Hi all,
I try to enable ov9734 sensor to board msm8953 in 64bits (Open-Q 626 by Intrinsyc)
- Add ov9734.c in kernel/msm-3.xx/drivers/media/i2c/soc_camera/
- Modify Kconfig and add
config SOC_CAMERA_OV9734
tristate "ov9734 camera support"
depends on SOC_CAMERA && I2C
help
This is a ov9734 camera driver
- Modify Makefile and add
obj-$(CONFIG_VIDEO_OV3734) += ov3734.o
- Modify msm8953.dtsi
i2c_5: [email protected] {
compatible = "qcom,i2c-msm-v2";
#address-cells = <1>;
#size-cells = <0>;
reg-names = "qup_phys_addr";
reg = <0x7af5000 0x600>;
interrupt-names = "qup_irq";
interrupts = <0 299 0>;
qcom,clk-freq-out = <400000>;
qcom,clk-freq-in = <19200000>;
clock-names = "iface_clk", "core_clk";
clocks = <&clock_gcc clk_gcc_blsp2_ahb_clk>,
<&clock_gcc clk_gcc_blsp2_qup1_i2c_apps_clk>;
pinctrl-names = "i2c_active", "i2c_sleep";
pinctrl-0 = <&i2c_5_active>;
pinctrl-1 = <&i2c_5_sleep>;
qcom,noise-rjct-scl = <0>;
qcom,noise-rjct-sda = <0>;
qcom,master-id = <84>;
dmas = <&dma_blsp2 4 64 0x20000020 0x20>,
<&dma_blsp2 5 32 0x20000020 0x20>;
dma-names = "tx", "rx";
[email protected] {
compatible = "ov9734";
reg = <0x36>;
mclk_khz = "24000";
num_lanes = "1";
/* V4L2 device node location */
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
avdd-reg = "vana";
dvdd-reg = "vdig";
iovdd-reg = "vif";
/* Sensor output flip settings */
vertical-flip = "true";
mode0 { // OV9734_MODE_1280X720
mclk_khz = "24000";
num_lanes = "1";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1280";
active_h = "720";
pixel_t = "bayer_bggr10";
readout_orientation = "0";
line_length = "1478";
inherent_gain = "1";
mclk_multiplier = "6.67";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
};
};
};
- Modify msmcortex_defconfig and add
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y
CONFIG_VIDEO_ADV_DEBUG=y
CONFIG_SOC_CAMERA_OV9734=y
Driver are call, but I have error message during probe function:
[ 6.453473] ov9734 5-0036: Missing platform_data for driver
[ 6.453488] ov9734: probe of 5-0036 failed with error -22
Somebody can help me ?
Michaël

Heya,
That's not an officially supported Intrinsyc camera, right? I have the OpenQ 820 and that comes with a Sony IMX214 camera. Have you created your own adapter board, or what?
Even if you can get it connected/attached you'll still need to make modifications to proprietary Qualcomm files (in vendor/qcom/proprietary) to add support for this camera. These files Intrinsycs BSP doesn't give you access to. You also need the Qualcomm Chromatix tools to generate the driver, and calibrate the sensor.

Yes is not an officially supported Intrinsyc camera. You have all good.
How add my camera ? Impossible ?

Unless you have contacts in Qualcomm then yeah, it's pretty much impossible. See: https://faq.intrinsyc.com/t/can-i-develop-a-camera-sensor-driver-with-your-dev-kits/29
You need Qualcomm tools, internal documentation, access to proprietary source code, etc. Plus, a ton of equipment to verify the camera behaviour.

Hey, did you ever solve this? We are in the exact same situation and don't have the resources to go through Intrinsyc to build new drivers.
m.reignier said:
Hi all,
I try to enable ov9734 sensor to board msm8953 in 64bits (Open-Q 626 by Intrinsyc)
- Add ov9734.c in kernel/msm-3.xx/drivers/media/i2c/soc_camera/
- Modify Kconfig and add
config SOC_CAMERA_OV9734
tristate "ov9734 camera support"
depends on SOC_CAMERA && I2C
help
This is a ov9734 camera driver
- Modify Makefile and add
obj-$(CONFIG_VIDEO_OV3734) += ov3734.o
- Modify msm8953.dtsi
i2c_5: [email protected] {
compatible = "qcom,i2c-msm-v2";
#address-cells = <1>;
#size-cells = <0>;
reg-names = "qup_phys_addr";
reg = <0x7af5000 0x600>;
interrupt-names = "qup_irq";
interrupts = <0 299 0>;
qcom,clk-freq-out = <400000>;
qcom,clk-freq-in = <19200000>;
clock-names = "iface_clk", "core_clk";
clocks = <&clock_gcc clk_gcc_blsp2_ahb_clk>,
<&clock_gcc clk_gcc_blsp2_qup1_i2c_apps_clk>;
pinctrl-names = "i2c_active", "i2c_sleep";
pinctrl-0 = <&i2c_5_active>;
pinctrl-1 = <&i2c_5_sleep>;
qcom,noise-rjct-scl = <0>;
qcom,noise-rjct-sda = <0>;
qcom,master-id = <84>;
dmas = <&dma_blsp2 4 64 0x20000020 0x20>,
<&dma_blsp2 5 32 0x20000020 0x20>;
dma-names = "tx", "rx";
[email protected] {
compatible = "ov9734";
reg = <0x36>;
mclk_khz = "24000";
num_lanes = "1";
/* V4L2 device node location */
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
avdd-reg = "vana";
dvdd-reg = "vdig";
iovdd-reg = "vif";
/* Sensor output flip settings */
vertical-flip = "true";
mode0 { // OV9734_MODE_1280X720
mclk_khz = "24000";
num_lanes = "1";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1280";
active_h = "720";
pixel_t = "bayer_bggr10";
readout_orientation = "0";
line_length = "1478";
inherent_gain = "1";
mclk_multiplier = "6.67";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
};
};
};
- Modify msmcortex_defconfig and add
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y
CONFIG_VIDEO_ADV_DEBUG=y
CONFIG_SOC_CAMERA_OV9734=y
Driver are call, but I have error message during probe function:
[ 6.453473] ov9734 5-0036: Missing platform_data for driver
[ 6.453488] ov9734: probe of 5-0036 failed with error -22
Somebody can help me ?
Michaël
Click to expand...
Click to collapse

parth.darji said:
Hey, did you ever solve this? We are in the exact same situation and don't have the resources to go through Intrinsyc to build new drivers.
Click to expand...
Click to collapse
Hi,
Intrinsyc ask me 28000$ to help me We have switch on IMX8 plateform (Compulab).
Now, my IMX8 detect camera (i2C OK, MIPI OK), but some problems left in driver 9734.c. I make my own driver and is not easy.
Have you a driver source ? Can you help me about driver code ?
Michaël

Hey,
Thanks for the response. Unfortunately, I am not a drivers programmer and cannot help with that. But the manufacturer should be able to give you the drivers right?
I am thinking of using IMX214 sourced from another manufacturer and integrate it into the 8953 SOM. Do you think it will work? Or will it require exactly the one sold by Intrinsyc?
/parth
m.reignier said:
Hi,
Intrinsyc ask me 28000$ to help me We have switch on IMX8 plateform (Compulab).
Now, my IMX8 detect camera (i2C OK, MIPI OK), but some problems left in driver 9734.c. I make my own driver and is not easy.
Have you a driver source ? Can you help me about driver code ?
Michaël
Click to expand...
Click to collapse

parth.darji said:
I am thinking of using IMX214 sourced from another manufacturer and integrate it into the 8953 SOM. Do you think it will work? Or will it require exactly the one sold by Intrinsyc?
Click to expand...
Click to collapse
The problem: Intrinsyc lock the som witch proprietary code. You buy, or you changed to another som (system on module ).
If you want integrate a 9734 camera, you need to implement a driver to this camera...

Sorry for the misunderstanding. I meant if I don't use Omnivision Camera anymore and replace it with an IMX214 sensor from Alibaba, would it work? Or does Intrinsyc want me to use the camera sensor manufactured by them?
m.reignier said:
The problem: Intrinsyc lock the som witch proprietary code. You buy, or you changed to another som (system on module ).
If you want integrate a 9734 camera, you need to implement a driver to this camera...
Click to expand...
Click to collapse

parth.darji said:
Sorry for the misunderstanding. I meant if I don't use Omnivision Camera anymore and replace it with an IMX214 sensor from Alibaba, would it work? Or does Intrinsyc want me to use the camera sensor manufactured by them?
Click to expand...
Click to collapse
This thread talk about 9734, not another sensor. I dont know about IMX214. See Qualcom repository.

I thought this thread talked about solving camera interface problems with msm8953, which comes with drivers for IMX214 sensor. Since OV9734 isn't possible, I was wondering if I could get an answer for my other question here. Apologies if it took a tangent.
m.reignier said:
This thread talk about 9734, not another sensor. I dont know about IMX214. See Qualcom repository.
Click to expand...
Click to collapse

Related

[Q] I need help with my thesis project

Hi all, my name is Kostas and I'm facing a problem with my thesis and I need help about solving it.
Well the problem that I'm facing has to do with the communication of a pic microcontroler ( 16f628 ) and a gsm modem (Simens T35i terminal). I can't send or receive commands between those two devices.
For example, I'm trying to send the "AT" command to the modem with a program that I wrote for the microcontroller. The whole idea for the program is to send this command and to receive and read the "OK" response and if it is the right response, light up a led or for everything else, light up anothrer.
The program was made with ccs compiler:
Code:
#include <16F628.h>
#include <string.h>
#fuses XT,NOWDT,PUT,NOBROWNOUT,NOMCLR,NOLVP,INTRC_IO
#use delay(clock=4000000)
#byte PORTB = 0x06
#byte PORTA = 0x05
#use rs232(baud=9600,xmit=PIN_B2,rcv=PIN_B1)
unsigned char cmd_at[]="AT";
unsigned char answer[2];
unsigned char aok[]="OK";
int i;
int p;
void main(void) {
set_tris_a(0x00); //Set PortA as OUTput
delay_ms(7000);
for (i=0; i<sizeof(cmd_at); i++){
putc(cmd_at[i]);
}
putc(13);
delay_ms(100);
gets(answer);
p=strcmp(answer, aok);
if (p=0){
output_high(PIN_A0);
delay_ms(5000);
}
else{
output_high(PIN_A1);
delay_ms(5000);
}
}
here is the circuit:
i.imagehost.org/view/0115/circuit
What do I do wrong and I can't get the result that I want?
Thanks in advance.
PS. I' know that this kind of threads aren't used to be here but I run out of ideas!

HardSPL CDMA Whitelist Code

Guys,
A buddy of mine modified Fenny's code from IMEI Whitelist GSM Hardspl to work with CDMA. I just need someone to compile code and test.
Code:
Random random = new Random();
string imei = textBox1.Text;
string mid = (random.Next().ToString("X8") + random.Next().ToString("X8")).ToLower();
string hid = random.Next().ToString("X8").ToLower();
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
System.Security.Cryptography.SHA256 hasher = System.Security.Cryptography.SHA256.Create();
string hex = BitConverter.ToString(hasher.ComputeHash(encoding.GetBytes(((mid + hid + imei + "6BRSDB*(LNsa;JN5)"))))).Replace("-", "").ToLower(); ;
string request = ("mid=" + mid + "&hid=" + hid + "&imei=" + imei + "&auth=" + hex + "&v=" + 110);
System.Net.ServicePointManager.Expect100Continue = false;
System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create("http://www.htc-unlocks.com/rhodiumw.php");
webRequest.Headers.Clear();
webRequest.KeepAlive = true;
webRequest.Method = "POST";
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.UserAgent = "WinHTTP Example/1.0";
System.IO.Stream webResponse = webRequest.GetRequestStream();
System.IO.StreamWriter webResponseSender = new System.IO.StreamWriter(webResponse);
webResponseSender.Write(request);
webResponseSender.Close();
System.Net.HttpWebResponse didI = (System.Net.HttpWebResponse)webRequest.GetResponse();
System.IO.BinaryReader binaryReader = new System.IO.BinaryReader(didI.GetResponseStream());
byte[] buffered = binaryReader.ReadBytes(512);
if (encoding.GetString(buffered) == "reject")
label2.Text = "Failed";
else
{
System.IO.File.WriteAllBytes(imei+".txt", buffered);
label2.Text = "Success";
}
OK, I have the code compiled.
run the exe file.
enter your IMEI number (do not include last 01)
you shoud get success and it will create a <IMEI_NUMBER>.txt file
rename <IMEI_NUMBER>.txt to chk.txt and copy to windows folders on your phone
now run hardSPL and enjoy.
note if you get a failed message you either enter the last 01, or enter incorrect IMEI or your phone is already blacklisted and it's to late.
My phone is blacklisted so I can not fully test. please post results.
I also want to thank Fenny for his hard work with his GSM version of the whitelister.
With out his code my buddy would have never been able to rewrite to work for CDMA TP2
hopefully you don't mind, i posted this @ geeks....test should come back soon, i linked this thread .
mr8820 said:
hopefully you don't mind, i posted this @ geeks....test should come back soon, i linked this thread .
Click to expand...
Click to collapse
no not at all post in all related sites are fine.

Need help with Visual C#

Hello!
I have an old barcode reader with Windows CE.
I'm trying to make a simple application, that saves the scanned barcode into a file.
The next is working code, that show the scanned barcode and exits. I want the value scanned ( lpScanBuf ) to be saved into a textfile. Not to overwrite the existing file, but add to existing values (append) inside the file:
#include <windows.h>
#include <ScanCAPI.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpszCmdLine, int nCmdShow)
{
HANDLE hScanner = NULL;
LPSCAN_BUFFER lpScanBuf = NULL;
DWORD dwScanSize = 7095;
SCAN_Open(TEXT("SCN1:"), &hScanner);
SCAN_Enable(hScanner);
lpScanBuf = SCAN_AllocateBuffer(TRUE, dwScanSize);
SCAN_ReadLabelWait(hScanner, lpScanBuf, 0);
MessageBox(NULL,(LPTSTR)SCNBUF_GETDATA(lpScanBuf),TEXT("HelloScan"),MB_OK);
<< HERE SHOULD BE SOMETHING, THAT SAVES THE VALUE lpScanBuf INTO A TEXTFILE >>
SCAN_Disable(hScanner);
SCAN_DeallocateBuffer(lpScanBuf);
SCAN_Close(hScanner);
return 0;
}
Click to expand...
Click to collapse
I have tried in several ways, but always get an error:
using System;
using System.IO;
File.WriteAllText(@"test.txt", lpScanBuf);
or
System.IO.File.AppendAllText(@"test.txt", lpScanBuf);
Click to expand...
Click to collapse
-----------------------------------------
Found some ideas... but i don't know how to apply these..
lstrcpy (qty,buffer);
memset(buffer,0,sizeof(buffer));
swprintf(buffer,TEXT("%s,%s\n"),barcode);
fr=fopen("barcode.txt","a+"));
fwrite(fr, s_str);
fwrite(buffer,sizeof(TCHAR),lstrlen(buffer),fr);
fclose(fr);
Click to expand...
Click to collapse
And another idea...
string filename = "myFile.txt";
using (StreamWriter writer = new StreamWriter(filename, true))
{
writer.Write(lpScanBuf + " ");
}
Click to expand...
Click to collapse

[DEV] Framebuffer console

Make a backup first.
So i have managed to get framebuffer console output , but its stil not working.
So any help is wellcome.
The error i get is more the same as This.
You can try this kernel ( fastboot flash zimage zImage ) <- Dont flash if you dont know what your doing .
more info about whats going on is here.
Vids
With framebuffer active , but display is scrambled!.
With framebuffer console and display fixed.
For thoose that dont know what this is , its simpel.
For GNU/Linux we need this to work.
Some Info:
You could use any kernel that works with DHD , mine is Leedroid's Ace Kernel
.Config File
Mod file /drivers/video/msm/msm_fb.c to look (ADD) like this ( add x = 0; y = 0; w = msmfb->xres; h = msmfb->yres; )
x = msmfb->update_info.left;
y = msmfb->update_info.top;
w = msmfb->update_info.eright - x;
h = msmfb->update_info.ebottom - y;
x = 0; y = 0; w = msmfb->xres; h = msmfb->yres; <-----------Do not add this airow
Thats it. Start modding
change log space
0.1 - Enabled frambuffer -> makes screen scrambled
0.2 - Fixed lcd but got atomic panic.
0.3 - fixed Frambuffer console and lcd trying to boot ubuntu but sdcard is mounted after command line partition list is mmcblk0** needs to be mmcblk1p2
Did we realy need console output to the framebuffer to boot ubuntu nativ, or would it only be a importend debug feature during porting?
Following video shows meego booting on an desire, but the have no console output during the boot. Maybe the have the same bug when the use tty on the framebuffer!?
http://www.youtube.com/watch?v=GtnfHNjcdzg
Not needed !!!! -->
Most for debugging , and evry thing i try i cant get ubuntu to boot.
Also did find sometging about cmdline hack as command line seems to be skipt --> look at setup.c the modded command line.
This could be an alternative:
http://sven.killig.de/android/N1/serial/
Try following zImage.
Jhinta said:
Make a backup first.
So i have managed to get framebuffer console output , but its stil not working.
So any help is wellcome.
The error i get is more the same as This.
You can try this kernel ( fastboot flash zimage zImage ) <- Dont flash if you dont know what your doing .
more info about whats going on is here.
Vids
With framebuffer active , but display is scrambled!.
With framebuffer console and display fixed.
For thoose that dont know what this is , its simpel.
For GNU/Linux we need this to work.
Some Info:
You could use any kernel that works with DHD , mine is Leedroid's Ace Kernel
.Config File
Mod file /drivers/video/msm/msm_fb.c to look (ADD) like this ( add x = 0; y = 0; w = msmfb->xres; h = msmfb->yres; )
x = msmfb->update_info.left;
y = msmfb->update_info.top;
w = msmfb->update_info.eright - x;
h = msmfb->update_info.ebottom - y;
x = 0; y = 0; w = msmfb->xres; h = msmfb->yres; <-----------Do not add this airow
Thats it. Start modding
Click to expand...
Click to collapse
Hi can you help out on enabling Mediatek framebuffer, Alcatel OT918D ?
On compiling I get this error
http://pastebin.com/N6Ct51ub
I think the problem is the files are not in the linux/kernel/drivers/video directory
here is the makefile in linux/kernel/drivers/video
http://pastebin.com/3kfRnrKA
while in the mediatek/drivers directory we have :
http://pastebin.com/mDSTthG0
I need framebuffer console for debugging, please help out if you can.

[Q] Load SQLite DB

I have SQLite DB file. I copy him to StorageFile and open it by SQLite
Code:
...............................
using SQLiteClient;
using Community.CsharpSqlite;
namespace PhoneApp1
{
public partial class MainPage : PhoneApplicationPage
{
// Конструктор
private string fileName = "DB";
public MainPage()
{
InitializeComponent();
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
System.IO.Stream src = Application.GetResourceStream(new Uri(fileName, UriKind.Relative)).Stream;
IsolatedStorageFileStream dest = new IsolatedStorageFileStream(fileName, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, store);
src.Position = 0;
CopyStream(src, dest);
dest.Flush();
dest.Close();
src.Close();
dest.Dispose();
IsolatedStorageFile tmp= IsolatedStorageFile.GetUserStoreForApplication();
if (!tmp.FileExists(fileName))
{
return;
}
SQLiteConnection db = new SQLiteConnection(fileName);
try
{
db.Open();
SQLiteCommand cmd = db.CreateCommand("SELECT * FROM table");
var lst = cmd.ExecuteQuery<Test>();
ApplicationTitle.Text = "Selected " + lst.ToList().Count + " items\r\nTime ";
}
catch (SQLiteException ex)
{
ApplicationTitle.Text = "Error: " + ex.Message;
}
}
private static void CopyStream(System.IO.Stream input, IsolatedStorageFileStream output)
{
byte[] buffer = new byte[32768];
long TempPos = input.Position;
int readCount;
do
{
readCount = input.Read(buffer, 0, buffer.Length);
if (readCount > 0)
{
output.Write(buffer, 0, readCount);
}
} while (readCount > 0);
input.Position = TempPos;
}
}
public class Test
{
public Test()
{
}
int _id;
public int id
{
get { return _id; }
set { _id = value; }
}
}
}
Result : ApplicationTitle = unable to opendatabase file.
Why? Plz help.
Probably because you doing something wrong, for example, opening SQLiteConnection
Seems like correct syntax should be
Code:
new SqliteConnection("Version=3,uri=file:db")
Download and try source code from http://wp7sqlite.codeplex.com/SourceControl/list/changesets#
error "Couldn't open database file version=3,urlB"
file DB i created from command "backup DB File". It's right?
I have no idea what kind of file do you have. I just downloaded and ran example from sources mentioned above and it works fine (but with few assertions). BTW you should have a complete source code of SQLite, just debug into SQLite procedures and check what's wrong.
Example work fine. I want read database from project file (Content).He isn't located in StorageFile. I use him after i'm saving myfile to StorageFile .
evgen_wp said:
Example work fine. I want read database from project file (Content).He isn't located in StorageFile. I use him after i'm saving myfile to StorageFile .
Click to expand...
Click to collapse
I already understood you. Add your code (to save database file from resource stream to isf) to example, and test conn.Open() call using F11 (Step Into). You'll see what's wrong. I don't have your database file and have no idea what did you put inside
File did not have time to create. It is ... work now.he can open empty file but can't open file with data
P.S. I use Sqlite Client for Windows Phone from http://sqlitewindowsphone.codeplex.com/
Why don't you use another codeplex project I've posted above? It works fine for me (tested because of your question).
P.S. Don't forget to push "Thanks" button. It's not a paid Microsoft customer service and I'm not your support guy.

Categories

Resources