yashsingh1/xdaforums huggingface dataset:
[T-Mobile LG G2x] phitch:
The new kernel fixes the battery indicator.

Edit:

While I am on the topic, I know that the G2x uses the Star board, but it is still a Tegra 2 device, doesn't the Atrix also use a Tegra 2 with the same Qualcomm MDM6600 modem? Would that help at all in getting the Ril activated/properly integrated?

NM just realized that they never released the source code for the leaked ICS. Mother of god...

But the droid razr does use MDM6600 and has released the source code, only problem is it uses an OMAP. I almost get a feeling the Tegra 2 doesn't like the MDM6600.
[T-Mobile LG G2x] apolkosnik:
P970 has also MDM6600 :)

If you flashed the kernel from Mazout360, then the battery indicator is partially fixed there.
[T-Mobile LG G2x] johnwazhere:
Motorola photon has mdm6600 and tegra 2
[T-Mobile LG G2x] phitch:
Motorola Photon doesn't have official ICS source though and the P970 is an OMAP CPU.
[T-Mobile LG G2x] xenoletum:
Guys, please, again, keep all of these discussion posts out of this thread and take them to the user thread. We don't need a list of every device that has the baseband and chipset, mostly because the chipset isn't the same.

There were two variants of the Tegra 2 chipset. One of them is extremely common, one of them is in a few devices. We've got the latter. Second, source codes on other devices are going to be absolutely useless since everything is coded differently. Runs through different PCB boards, etc. It's not as simple as plug and play, and is extremely complicated work to pull something like this off.
[T-Mobile LG G2x] kangi26:
Ok, gang, lets try to stay on topic with your thread. Filling it with things that are not related to the thread at hand only make it more difficult for users to find the answers they need and end up cluttering the thread with even more chatter
[T-Mobile LG G2x] faratl:
So you guys think this is the end of this ROM ?
[T-Mobile LG G2x] apolkosnik:
Do you guys think he should change phones? ;)
[T-Mobile LG G2x] bakedpatato:
He should get a Nexus 4. Oh wait, LG never again :rolleyes:

Anyway,I've been working on the kernel side on my own and I found out I have no idea how SPI works...
[T-Mobile LG G2x] Naberus:
SPI header frames

I was just looking around in the SPI driver source and noticed that the SPI header format changes to "extended" format via a #define in drivers/spi/spi_mdm6600.h at line 29. Undef'ing that appears to reenable a header format compatible with the header format in 2.6.32. I'm sure it can't be that simple, but I haven't seen it mentioned yet so thought it worth chiming in.

Warning: I haven't put that into my own build yet, so no idea if that information is total crap.
[T-Mobile LG G2x] apolkosnik:
I'm kicking off a build to test it.
[T-Mobile LG G2x] eagleeyetom:
Maybe some of you have some problems with the eyes, so in the bigger font:

STAY ON TOPIC!!!​
[T-Mobile LG G2x] kepapas:
As much as I hate LG I have to say the nexus4 doesn't go thru LG for anything I got updates right away...if you want to deal with lg get a lg optimus 9 or optimus g
[T-Mobile LG G2x] apolkosnik:
I've build it and I've also pushed some old blobs and now it just cycles through this:

D/RIL ( 1761): Device /dev/pts1 is not open (No such device). Retrying until success

D/RIL ( 1761): Device /dev/pts1 is not open (No such device). Retrying until success

E/RIL ( 1761): rild_init_watchdog : RILD initilization is not completed!!

E/RIL ( 1761): rild_init_watchdog : Close RILD & restart it again!!

E/RILJ ( 677): Hit EOS reading message length

I/RILJ ( 677): Disconnected from 'rild' socket

I/RIL ( 1992): Opening tty device /dev/ttyspi0

D/RIL ( 1992): mainLoop 1. Current errno: Success

D/RIL ( 1992): lge-ril: main loop routine start

D/RIL ( 1992): mainLoop 2. Current errno: Success

D/RIL ( 1992): mainLoop 3. Current errno: Success

E/RIL ( 1992): fd of /dev/ttyspi0 is 12

D/RIL ( 1992): mainLoop 3. Current errno: Success

D/RIL ( 1992): mainLoop 3.1 Current errno: Success

D/RIL ( 1992): mainLoop 3.2 Current errno: Success

D/RIL ( 1992): mainLoop 3.3 Current errno: Invalid argument, err:-1

I/RILJ ( 677): Connected to 'rild' socket

I/RILC ( 1992): libril: new connection

D/RILC ( 1992): [UNSL]< UNSOL_RESPONSE_RADIO_STATE_CHANGED {RADIO_UNAVAILABLE}

I/RILC ( 1992): RIL Daemon version: android lge-ril 3.0

D/RILJ ( 677): [UNSL]< UNSOL_RESPONSE_RADIO_STATE_CHANGED RADIO_UNAVAILABLE

D/RIL ( 1992): lge-ril: Device path = /dev/ttyspi0

D/RIL ( 1992): end of if ( fd > 0 )...

D/RIL ( 1992): mainLoop 6. Current errno: Success

D/RIL ( 1992): end of if (s_device_path != NULL)...

D/RIL ( 1992): end of while (fd < 0)...

D/RIL ( 1992): mainLoop 7.Current errno: Success

D/RIL ( 1992): ainLoop: RAT is set to WCDMA

D/RIL ( 1992): lge_ril: RIL_STATE_NEEDS_INITIALIZATION

D/RIL ( 1992): initializeVendorRIL START

D/RIL ( 1992): initializeVendorRIL: product RAT = 1

D/RIL ( 1992): lge_ril: RIL_STATE_INITIALIZATION

D/RIL ( 1992): initializeVendorRIL: USE_ONE_DLC NOT DEFINED

D/RIL ( 1992): lge-ril: mainLoop: Opening DLC devices...

D/RIL ( 1992): Device /dev/pts1 is not open (No such device). Retrying until success

D/RIL ( 1992): Device /dev/pts1 is not open (No such device). Retrying until success

D/RIL ( 1992): Device /dev/pts1 is not open (No such device). Retrying until success

D/RIL ( 1992): Device /dev/pts1 is not open (No such device). Retrying until success

D/RIL ( 1992): Device /dev/pts1 is not open (No such device). Retrying until success

So, the RIL works, just the radio is still off.
[T-Mobile LG G2x] King-Nai:
It still is having issues with pts1. We need to fix that, but spi seems like it may be working
[T-Mobile LG G2x] Mazout360:
What blobs have you used ? And why would it want to open device pts1, it's not even listed in GB tty drivers output
[T-Mobile LG G2x] apolkosnik:
I've used the blobs I had in my old CM9 build tree cloned from VorkTeam p990, but the blobs must have been pretty old:

lge-ril.so - MD5 starts with bfc572

libril.so - MD5 starts with 36259b

There is /system/etc/ipc_channels.config, which might be responsible for pts1 showing up there.

There's also lgcpversion which is pretty interesting as it issues AT%SWOV on /dev/pts29 and is supposed to populate gsm.version.baseband with the answer. The source code for it is in device/lge/p999/bbversion/cpversion.c. You should be able to see what's set by running getprop in the shell.
[T-Mobile LG G2x] Mazout360:
Are you sure that is all ? I just flashed your build 7 along with lge-ril and libril from GB and a kernel without extended headers for mdm6600 and I'm still getting rild socket issues. Did you change anything else ? It used to work on CM10 but not on CM10.1 for me.

ipc_channels.config seems okay. I think it allocates the correct nodes to the RIL functions.
[T-Mobile LG G2x] apolkosnik:
SO in my logcat I saw that it tries to go through the /dev/pts[1-30] but since it's not getting anything there it just keeps on trying. when I looked at the /proc/tty/devices, I saw two devices pointing to /dev/pts... maybe that's our problem there?
[T-Mobile LG G2x] Mazout360:
No that's normal. Please help me get the same logcat as you do I can't help you debug otherwise and I don't know what libs you used in build 7...

have you tried doing a chmod 0660 /dev/pts* ? It's maybe only a dumb permissions issue.
[T-Mobile LG G2x] apolkosnik:
nope, not a permission issue, also not an ownership issue either.
[T-Mobile LG G2x] Mazout360:
You really don't want to give me the list of changes you did to get that rild socket working don't you ?
[T-Mobile LG G2x] Naberus:
I believe at least /dev/pts1 might be related to the ts0710 (major device numbers match), which also appears to have some protocol differences... But they're not wrapped up in a neat little bow like the MDM6600 changes were.

I did a little bit of comparison while taking a break from annoying-non-p999-work-code earlier today, and did notice a few little things but I'm not sure if they're even related to the issues you guys are seeing. I'll investigate more when I have time.

(ts0710 stuff in lge-kernel-star android-tegra-2.6.32(-ics)/drivers/star/ts0710mux v.s. jellybean/drivers/spi/ts0710mux_mdm)

(Take this with a grain of salt - this stuff isn't my area of expertise. I'm just an inexperienced amateur. :)
[T-Mobile LG G2x] apolkosnik:
Relax, adb push rild, lgdrmserver and ril related libs from an old ICS build, and also put in there the liblgdrm, libbridge, libbridges, libsecureclock that solved the dependency problems when starting up rild and lgdrmserver on the command line. I've also changed the rild.libpath in build.prop to point to lge-ril.so. You can use setprop command to do that on the fly though.
[T-Mobile LG G2x] Core Memory:
Which old ICS build did you use?

What is the source of liblgdrm, libbridge, libbridges, libsecurelock you used?

---------- Post added at 04:48 PM ---------- Previous post was at 04:34 PM ----------

It appears that Qualcomm does the engineering work to make their chips work with new Android releases. Here's an advert from Qualcomm for a Telephony Engineer to do it: http://www.submitresume.in/telephony-engineer-hyderabad-secunderabad-jobs-2828789.html

Looks to me that the reason no ICS/JB updates for phones with Qualcomm is due to the cell phone manufacturer not paying Qualcomm to do the work. That could also be why there's missing "stuff" related to the G2X/P999 in the P990 ICS source code LG released although most of the work to provide ICS for the G2X/P999 is evident in that source code.

Job Description

The person will work on android telephony middleware layer as development engineer. He will work on porting new android releases to Qualcomm chipsets; involve in customer support, work on feasibility study of new features, upstream the changes to Android Open Source Community.

Responsibilities (Briefly describe the major duties and responsibilities of this position)

The person will be responsible for telephony middleware development, working with customer engineering team thus helping multiple carriers with their commercial launches, understanding the Android new releases and porting them to Qualcomm chipsets. We expect the person should be strong at object oriented design/programming and make use of them in development phase.
[T-Mobile LG G2x] XeoNoX:
wow this looks so promising, this is beyond amazing. keep up the good work guys. Ill pull out my old G2X and try this out, really wish the radio work but i have faith in u guys, thanks again for all your guys hard work and time and effort into this project.
[T-Mobile LG G2x] TeeJay3800:
Thread cleaned again. Please ask all questions in the user thread. Development threads are generally for posting of legitimate new bugs, preferably with a logcat attached. Thanks for your cooperation. :)
[T-Mobile LG G2x] jhayton:
From the OP

404 Page Not Found
The page you requested was not found.
[T-Mobile LG G2x] apolkosnik:
Fixed, thanks!
[T-Mobile LG G2x] xp99:
Ignore this post, will join the user discussion post of this topic.
[T-Mobile LG G2x] Naberus:
Just reporting my recent efforts in case they're of use to anyone. I'm currently stuck on the TS0710 MUX (drivers/spi/ts0710mux_mdm) - rild fails opening /dev/pty[1-32]. The GB rild appears to open the tty without using the TS0710 line discipline (defined alongside the MUX driver). Because the tty and line discipline are tightly integrated, the tty open returns ENODEV when not using the right line discipline. (Specifically, ipc_tty is null when mux_open is called.)

The 2.6.32 and 2.6.39 source register the ts0710 line discipline with different numbers because the old number would conflict in 2.6.39... So at first I thought it would just require registering the line discipline using the old number, but that doesn't seem to have any effect.

My next step is to try to reverse engineer the old GB rild with strace to try to see why it isn't using the correct line discipline.

Anyway, progress is super-slow with only a few hours a week to work on it. Basically, expect nothing further from me... But I'm still plugging away when I can find a few minutes. (I.e. nothing in my github, because I have nothing to report other than educational failures.)
[T-Mobile LG G2x] Mazout360:
Please report any info you can get from rild, this will be useful.

Do you think this wrong line discipline could interfere with the fact that the newer kernel does not seem to be able to open numbered nodes from pts ?

Another thing... If theres a problem with the node name you could probably symlink it to the real node ? I already got PTS1 working like that for some time, then it got closed again...I don't really have any explanations for this.

Maybe working with other blobs, from a device using the newer kernel with TS0710MUX could prove your theory here.
[T-Mobile LG G2x] Naberus:
I can guarantee that if the kernel doesn't open the line discipline at some point, the ril won't be able to open the pty. There's a line in mux_open that says something like:

if (!(ipc_tty && dlci)) return -ENODEV;

A few printk's later, and I know ipc_tty is null on mux_open - and it's the ldisc open that sets ipc_tty.

What I don't know is why this worked before and doesn't now.... So I want to find out what the ril is doing, so I'll have to strace it. If/when I get an strace, I'll post it here.

AFAIK, the mux driver should still be called "pts" like the old one.... Though I really can't comment much though because I really have very little clue how rild and lge-ril.so behave in terms of what they open/close when.... So perhaps an strace will help us both out. :)
[T-Mobile LG G2x] Core Memory:
Is there anything useful here, from android-porting:

https://groups.google.com/forum/?fromgroups#!searchin/android-porting/ril

If there isn't, post questions about what is not working and you may get the answer about how to solve it.

---------- Post added at 01:27 PM ---------- Previous post was at 01:15 PM ----------

Here's someone who wrote a tutorial about getting the RIL to wok with Gingerbread, he also answers questions:

http://afewe.wordpress.com/android-...ith-the-radio-layer-interface-ril-in-android/

---------- Post added at 01:40 PM ---------- Previous post was at 01:27 PM ----------

Here's something about the RIL not loading in porting from GB to ICS/JB:

https://groups.google.com/forum/?fromgroups#!searchin/android-porting/$20-ENODEV;/android-porting/cAtzfHnitjg/9zQcb8Zo0uYJ

Yeah, your rild is not being loaded. Make sure that you copied over the changes from your 2.3.7 init.rc or your device *.rc file and set the startup class to the new format ICS and JB uses.
[T-Mobile LG G2x] Core Memory:
Not sure if this is directly relevant but here's something related to the problem you've stated in a P990 CM 7 thread:

http://xdaforums.com/showpost.php?p=17925565&postcount=56

pastime1971

27th September 2011, 08:26 PM

# 56

drivers/star/ts0710mux/ts0710_mux.c

--------------------------------------------------------------------------------

shouldn't there be "kfree(framebuf);" around line 506 in function mux_send_frame in drivers/star/ts0710mux/ts0710_mux.c ?

Code:

#ifdef LGE_KERNEL_MUX

res = node_put_to_send( dlci, framebuf, pos);

kfree(framebuf);

if(res == -ENOMEM){

return res;

}

#else

res = ipc_tty->ops->write(ipc_tty, framebuf, pos);

kfree(framebuf);

#endif

edit: it looks like framebuf is freed from node_put_to_send when the task is successful.

http://xdaforums.com/showpost.php?p=17936709&postcount=57

hackworks

28th September 2011, 07:22 AM

# 57

Originally Posted by pastime1971

shouldn't there be "kfree(framebuf);" around line 506 in function mux_send_frame in drivers/star/ts0710mux/ts0710_mux.c ?

Code:

#ifdef LGE_KERNEL_MUX

res = node_put_to_send( dlci, framebuf, pos);

kfree(framebuf);

if(res == -ENOMEM){

return res;

}

#else

res = ipc_tty->ops->write(ipc_tty, framebuf, pos);

kfree(framebuf);

#endif

edit: it looks like framebuf is freed from node_put_to_send when the task is successful.

The code path in node_put_to_send() returning '-ENOMEM' frees the memory. In the caller function mux_send_frame(), it returns with out freeing only on -ENOMEM which is safe. You have figured it out yourself seeing your edit.
[T-Mobile LG G2x] Core Memory:
Here's a search I did on github for:

if (!(ipc_tty && dlci)) return -ENODEV;

github search:

https://github.com/search?q=if+(!(ipc_tty+&&+dlci))+return+-ENODEV;&p=1&ref=searchbar&type=Code&l=

Which, I think, is actually:

if (!(ipc_tty && line))

return -ENODEV;

github search:

https://github.com/search?q=if+(!(ipc_tty+&&+line))+return+-ENODEV;&p=1&ref=searchbar&type=Code&l=
[T-Mobile LG G2x] Naberus:
- CM kernel source, which in our case in https://www.github.com/CyanogenMod/lge-kernel-star

- Jellybean branch

- TS0710 driver is in drivers/spi/ts0710mux_mdm/

- grep for ipc_tty

... or to send you right there ...

https://github.com/Naberus/lge-kern.../drivers/spi/ts0710mux_mdm/ts0710_mux.c#L2021

(Lines 2021/2022.)
[T-Mobile LG G2x] Core Memory:
It is very different than the CM701 version.

https://github.com/CyanogenMod/lge-...a84c/drivers/star/ts0710mux/ts0710_mux_p999.c
[T-Mobile LG G2x] Core Memory:
It is substantially recoded.

These may be relevant:

At line 2896 this appears:

MUX_DBG(9, "line discipline changed for pts%d to %s", tty->index, tty->ldisc->ops->name);

At line 3249 this appears:

MUX_DBG(9, "termios changed for pts%d", tty->index);

At lines 3325 - 3331 this appears:

mux_driver = alloc_tty_driver(TS0710_MAX_CHANNELS);

if (!mux_driver)

return -ENOMEM;

mux_driver->owner = THIS_MODULE;

mux_driver->driver_name = MUX_DRIVER_NAME;

mux_driver->name = "pts";
[T-Mobile LG G2x] Mazout360:
First two lines are debug comments for logcats, the rest is identical to the newer version with a slightly different syntax.

Actually, I already tried using the older version (ts0710mux_p999.c) and it didn't work. It would also surprise me that LG fixed the MDM6600 driver and changed the 0710 driver even though the first version was to be functional on the newer kernel.

We should concentrate on two points, which are : What is calling pts* nodes, and Why are they not responding ? Up to now, I am not convinced that the issue comes specifically from the ts0710 driver as it works on other devices.
[T-Mobile LG G2x] apolkosnik:
It's awesome to see you guys trying to get it working. In dmesg output I saw that there is a crash in one of the ifx_ functions (grep for crash), it might be our show stopper right there.
[T-Mobile LG G2x] H3XAPL3X:
Let's have a Christmas miracle and get the RIL fixed :) haha in due time ... I know I know .. merry Christmas xda Devs and users!
[T-Mobile LG G2x] Mazout360:
What is the error message? Is it mdm calling repeatedly ifx_spi_open?

Envoyé depuis mon LG-P999 avec Tapatalk
[T-Mobile LG G2x] King-Nai:
Here ya go:

Edit:

I don't think this has to do with the ril ifx.
[T-Mobile LG G2x] Core Memory:
Maybe it has to do with:

spi_mdm6600.c
[T-Mobile LG G2x] Naberus:
FYI, my TS0710 issues appear to have been a bit of a wild goose chase. The mux_open ENODEV I was seeing was just lgcpversion doing an open on /dev/pts29 - the error is expected if the ril hasn't otherwise opened things correctly....

So, I learned a bunch about the tty layer, but am no further ahead... Please don't pay too much attention to my previous posts about the TS0710, as they may not be relevant.
[T-Mobile LG G2x] King-Nai:
I checked
[T-Mobile LG G2x] Core Memory:
Or this:

ifx_n721_spi.c
[T-Mobile LG G2x] Naberus:
Adam, do you still have a build that does the above?

(Your build #7 appears to have a newer rild.)

With any of the rild/lge-ril.so combinations I've tried, I just get "radio disabled". I've even gone so far as to strace the damn thing, and all it does is load it's libraries, open file descriptors for logging, then write "radio disabled" to the radio log.
[T-Mobile LG G2x] Core Memory:
Cyanogenmod had the same problem:

http://code.google.com/p/cyanogenmo...ad.txt&token=e48604543066a5f0c8c367ea63d32d87
[T-Mobile LG G2x] Naberus:
I *want* that error so I can dig into its cause. For some reason, any combination of blobs I use doesn't even go as far as to open pts[0-9]+.
[T-Mobile LG G2x] Mazout360:
Same here.

Use build 6 and push rild and RIL-related libs with adb. I can't get to that error on build 7.
[T-Mobile LG G2x] Core Memory:
Edit: Content removed.

This post can be deleted.
[T-Mobile LG G2x] Naberus:
Content no longer relevant. This post can be deleted.
[T-Mobile LG G2x] Naberus:
Okay, another report of no progress...

I decided that I'd had enough messing around with the rild binary, so I plugged in the default CM rild figuring I could at least find the cause of the error in the source code.... But it seems to open librilswitch.so and the lge-ril.so just fine.

The ril still can't open /dev/pts1 (error is the same as reported here before), but at least this gets me an error from the kernel:

ts0710mux(23-mar-12):mux_open: MUX: Can't connect to server channel 0! ret = -19

... So ...

ts0710_open_channel is returning -ENODEV, which could be caused by a couple things so I won't venture a guess yet.

Time for more thrashing around in kernel code! (Again, don't expect much from me. I'm just some idiot.) I've pushed my stuff to my github account in case anyone wants to build a broken firmware or see what my thrashing around looks like. ;)

(If anyone wants a copy of my build, PM me. People wanting a build for non-development use should use adampk's build and (optionally) Mazout's kernel.)
[T-Mobile LG G2x] Mazout360:
That's already a starting point...the ts0710_open_channel function itself didn't change much since GB though, excepted for the dlci_data->rx.workqueue = NULL verification. This could be a problem with the chip DLCI I guess.

Please share your build if you got the pts* errors directly, I won't have to push back the RIL libs everytime I want to do some debugging.

EDIT I just got another way of opening the channels using mutex lock..it should look like this :

If you want to try it... this will require some adaptation though.
[T-Mobile LG G2x] Naberus:
The GB tx code uses a transmit loop (effectively: while (1) { write available data to tty }), but the ICS code uses a work queue which is far more elegant. (I.e. The workqueue == NULL check shouldn't exist in the GB code.)

PM'ed.

Not even sure how to use that. :)

I got as far as checking the send routines and the packing of the data sent to the MUX. As far as I can tell they look the same.... But for some reason, the kernel doesn't get (or see) a response from the MUX. No idea... Still poking around.
[T-Mobile LG G2x] grantusmantus:
I don't know squat abt code or anything really but I was wondering if anyone has tried Harsh's newest kernel with this. I'm planning on trying it tonight. Ill post a log cat when I'm done...if I can figure out how to get a log cat that is.

Here's the post for Harshs latest.

http://xdaforums.com/showthread.php?t=1567097

Sent from my Hellg-p999.
[T-Mobile LG G2x] Mazout360:
Useless. It will not even boot.
[T-Mobile LG G2x] Naberus:
Just talking out loud in case my ramblings are useful to anyone...

As best I can tell from a couple hours of digging, the ts0710 interfaces should be compatible between GB and ICS/JB kernels. It seems however that from the perspective of the kernel ts0710 code that data is not going through. The tx functions think they've sent off the data but the rx functions never see any response. I have a feeling that this is because the send doesn't actually go through either.

Basically, the driver tries to send a "sabm" packet, but it never receives a response so the ts0710 driver can't initialize.

.... So I'm nowhere again...
[T-Mobile LG G2x] Mazout360:
Well if the nodes are closed it should not receive a response nor send it correctly...Have you tried using mux* nodes instead, like the non-lge_kernel_mux settings on GB ?