Closed Bug 1038276 Opened 7 years ago Closed 7 years ago

Not getting LTE on a Nexus 5

Categories

(Firefox OS Graveyard :: RIL, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S4 (12sep)

People

(Reporter: khuey, Assigned: jessica)

References

Details

Attachments

(5 files, 3 obsolete files)

I have a Nexus 5 running master that's only getting HSDPA or HSPA+, not LTE.  If I borrow another Nexus 5 running Android it gets LTE with no problems.  This is on T-Mobile's network in San Francisco, if that matters.

What logs/etc can I provide to debug?
Flags: needinfo?
Flags: needinfo? → needinfo?(htsai)
Hi Kyle:
 My guess is the default network type is unset, or incorrect.

1. Please help provide device/radio log beginning from boot.

Command:
adb logcat -b radio -b main -v threadtime > /tmp/1038276.log

2. Please also provide system property.

Command:
adb shell getprop > /tmp/properties.log
Flags: needinfo?(htsai)
AOSP uses below property to determine the preferred network type.

[ro.telephony.default_network]: [10]

And, FxOS uses below property to do the similar thing.

[ro.moz.ril.0.network_types]: [gsm,wcdma]
[ro.moz.ril.1.network_types]: [gsm]
Hi Kyle:
 Please check comment 1/comment 2. Thanks!!

Shawn
Flags: needinfo?(khuey)
Thanks, I'll check that tomorrow.
Attached file radio.log
Flags: needinfo?(khuey)
Attached image 2014-06-21-15-32-25.png
Screenshot for adding LTE attribute to property on Dolphin.
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #6)
> Created attachment 8456284 [details]
> properties.log

Hi Kyle:
 After checking, there is no properties set properly on N5.
And, there is no SET_PREFERRED_NETWORK_TYPE (9|10) via Gecko/Gaia for sure.

(see [1] for below definition)
9: GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM
10: GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM_CDMA_EVDO


You can try the steps below to see if it works for you.
1. adb pull /system/build.prop /tmp
2. # modify build.prop in /tmp
   # add below line
   ro.moz.ril.0.network_types=gsm,wcdma,lte
3. adb remount
4. adb push /tmp/build.prop /system/build.prop
5. adb shell
   chmod 644 /system/build.prop
6. reboot

[1] - http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/ril_consts.js?from=ril_consts.js&case=true#424
That still doesn't work.

On my Nexus 5 it's set at Auto 2G/3G in the screenshot from comment 7.  If I change the setting to either Automatic or LTE I get 4G.
Hi Kyle, after following the instructions in comment 8 and selecting 'Automatic' or 'LTE' in Network type settings, I can get LTE on my nexus-5.
Are you still having problems with this? Note that, for now, we must select the network type manually in Settings to make it work.
Yeah, if I go select the network type manually it works just fine and I get 4G.

But why is the default "Auto (2G/3G)" instead of just "Automatic"?
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #11)
> Yeah, if I go select the network type manually it works just fine and I get
> 4G.
> 
> But why is the default "Auto (2G/3G)" instead of just "Automatic"?

As far as I remember, on first boot, gaia will try to select the option that covers most of the hardware supported network types. Since on first boot, there wasn't 'lte' in the supported network types, 'Automatic' doesn't get selected (not even shown on the list). Maybe wiping user data after the instructions in comment 8 will get you 'Automatic' selected by default, haven't tried it yet though.
I guess I could try that next time I flash my phone before I put my data back on there.
Ok, if I do the steps from comment 8 before the first run everything works: Gaia properly detects that the phone can do 4G and selects the fully Automatic network and I get a 4G connection.

So what do you want to do with this bug?  Is the build.prop something that the OEM is expected to set up correctly?
Flags: needinfo?(jjong)
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #14)
> Ok, if I do the steps from comment 8 before the first run everything works:
> Gaia properly detects that the phone can do 4G and selects the fully
> Automatic network and I get a 4G connection.
> 
> So what do you want to do with this bug?  Is the build.prop something that
> the OEM is expected to set up correctly?

Since there is no OEM for Nexus 5, I think we can add this property on our own. I will send a PR to address this.
Flags: needinfo?(jjong)
Attached file mozilla-b2g/device-hammerhead PR#4 (obsolete) —
Hi Michael, may we add a system property on hammerhead for LTE to work by default? Thanks.
Attachment #8462458 - Flags: review?(mwu)
Why don't we use ro.telephony.default_network if it's available?
Yeah, it's not a good solution when you have more than one sim, but for the very common case where your phone only has one sim slot, using ro.telephony.default_network is better than not.
(In reply to Michael Wu [:mwu] from comment #19)
> Yeah, it's not a good solution when you have more than one sim, but for the
> very common case where your phone only has one sim slot, using
> ro.telephony.default_network is better than not.

In fact, ro.telephony.default_network is for AOSP, b2g gecko deals with ro.moz.ril.x.network_types. Not all of our devices have ro.telephony.default_network, e.g. sprd devices don't seem to have this property, and some devices have the wrong value set, e.g. flame has this property set to 5 (CDMA only). So if we are going to use ro.telephony.default_network, we will need to revise our gecko ril's code to handle single/multi sim differently and recheck all of our supported devices' build.prop. I am not sure if it's a good idea.
(In reply to Jessica Jong [:jjong] [:jessica] from comment #20)
> In fact, ro.telephony.default_network is for AOSP, b2g gecko deals with
> ro.moz.ril.x.network_types. Not all of our devices have
> ro.telephony.default_network, e.g. sprd devices don't seem to have this
> property, and some devices have the wrong value set, e.g. flame has this
> property set to 5 (CDMA only). So if we are going to use
> ro.telephony.default_network, we will need to revise our gecko ril's code to
> handle single/multi sim differently and recheck all of our supported
> devices' build.prop. I am not sure if it's a good idea.

The flame sets this to 5 because we don't read this value. If we started reading the value, it would have to be set correctly.

I'm not saying we should handle single/multi sim properties differently though. I'm proposing a fallback when our preferred property (ro.moz.ril.x.network_types) isn't available. We should check our preferred one first, but if nothing is set, then check ro.telephony.default_network. If nothing else, this will make it easier for any vendors trying to port single SIM devices to Firefox OS. It's not worth forcing every vendor to set ro.moz.ril.x.network_types if they already use the standard one correctly.
(In reply to Michael Wu [:mwu] from comment #21)
> (In reply to Jessica Jong [:jjong] [:jessica] from comment #20)
> > In fact, ro.telephony.default_network is for AOSP, b2g gecko deals with
> > ro.moz.ril.x.network_types. Not all of our devices have
> > ro.telephony.default_network, e.g. sprd devices don't seem to have this
> > property, and some devices have the wrong value set, e.g. flame has this
> > property set to 5 (CDMA only). So if we are going to use
> > ro.telephony.default_network, we will need to revise our gecko ril's code to
> > handle single/multi sim differently and recheck all of our supported
> > devices' build.prop. I am not sure if it's a good idea.
> 
> The flame sets this to 5 because we don't read this value. If we started
> reading the value, it would have to be set correctly.
> 
> I'm not saying we should handle single/multi sim properties differently
> though. I'm proposing a fallback when our preferred property
> (ro.moz.ril.x.network_types) isn't available. We should check our preferred
> one first, but if nothing is set, then check ro.telephony.default_network.
> If nothing else, this will make it easier for any vendors trying to port
> single SIM devices to Firefox OS. It's not worth forcing every vendor to set
> ro.moz.ril.x.network_types if they already use the standard one correctly.

Hmm, sounds reasonable. I will work on it soon, thanks Michael!
Attachment #8462458 - Flags: review?(mwu)
Attached patch patch, v1. (obsolete) — Splinter Review
Hi Edgar, if mozRIL system property is not available, we'll try to fallback to AOSP system property. May I have your review? Thanks.
Attachment #8462458 - Attachment is obsolete: true
Attachment #8483302 - Flags: review?(echen)
Comment on attachment 8483302 [details] [diff] [review]
patch, v1.

Review of attachment 8483302 [details] [diff] [review]:
-----------------------------------------------------------------

Please see my comments below. Thank you.

::: dom/system/gonk/RadioInterfaceLayer.js
@@ +2073,5 @@
> +    // If mozRIL system property is not available, fallback to AOSP system
> +    // property for support network types.
> +    if (supportedNetworkTypes.length === 1 && supportedNetworkTypes[0] === "") {
> +      key = "ro.telephony.default_network";
> +      let indexString = libcutils.property_get(key, "0");

How if "ro.telephony.default_network" isn't available?
Should we fall back to GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT?
If so, we should not give "0" as default value, maybe ""?

@@ +2078,5 @@
> +      let index = parseInt(indexString, 10);
> +      if (DEBUG) this.debug("Fallback to " + key + ": " + index)
> +
> +      let networkTypes = RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[index];
> +      supportedNetworkTypes = networkTypes ? networkTypes.split("/") :

Just split("/") isn't enough.
We need to filter out "-auto" for "gsm-auto" [1]. :(

[1] http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/ril_consts.js?from=ril_consts.js#405
Attachment #8483302 - Flags: review?(echen)
(In reply to Edgar Chen [:edgar][:echen] from comment #24)
> Comment on attachment 8483302 [details] [diff] [review]
> patch, v1.
> 
> Review of attachment 8483302 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Please see my comments below. Thank you.
> 
> ::: dom/system/gonk/RadioInterfaceLayer.js
> @@ +2073,5 @@
> > +    // If mozRIL system property is not available, fallback to AOSP system
> > +    // property for support network types.
> > +    if (supportedNetworkTypes.length === 1 && supportedNetworkTypes[0] === "") {
> > +      key = "ro.telephony.default_network";
> > +      let indexString = libcutils.property_get(key, "0");
> 
> How if "ro.telephony.default_network" isn't available?
> Should we fall back to GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT?
> If so, we should not give "0" as default value, maybe ""?

Oh, I just though "0" is the same as GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT now. But yes, it would be safer to fallback to GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT. Will do it in the next version.

> 
> @@ +2078,5 @@
> > +      let index = parseInt(indexString, 10);
> > +      if (DEBUG) this.debug("Fallback to " + key + ": " + index)
> > +
> > +      let networkTypes = RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[index];
> > +      supportedNetworkTypes = networkTypes ? networkTypes.split("/") :
> 
> Just split("/") isn't enough.
> We need to filter out "-auto" for "gsm-auto" [1]. :(

Sure, will do that. Thanks.

> 
> [1]
> http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/ril_consts.
> js?from=ril_consts.js#405
Attached patch patch, v2. (obsolete) — Splinter Review
Address review comment 24:
- empty string as default value if ro.telephony.default_network is not available.
- filter out unused parts in network types, e.g. -auto.
Attachment #8483302 - Attachment is obsolete: true
Attachment #8483925 - Flags: review?(echen)
Comment on attachment 8483925 [details] [diff] [review]
patch, v2.

Review of attachment 8483925 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/RadioInterfaceLayer.js
@@ +2079,5 @@
> +      if (DEBUG) this.debug("Fallback to " + key + ": " + index)
> +
> +      let networkTypes = RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[index];
> +      supportedNetworkTypes = networkTypes ? networkTypes.split("/") :
> +        RIL.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT.split(",");

'-auto' should only be allowed when we take RIL_PREFERRED_NETWORK_TYPE as supported type.
So let's handle '-auto' here.
You can use replace() [1] to remove it, eg. networkTypes.replace("-auto", "", "g").split("/");

@@ +2087,5 @@
> +      let type = supportedNetworkTypes[i];
> +      // Remove unsed part, e.g. '-auto' in 'gsm-auto'.
> +      let index = type.indexOf("-");
> +      if (index != -1) {
> +        supportedNetworkTypes[i] = type = type.substring(0, index);

As mention above, please remove this.
Thank you.
Attachment #8483925 - Flags: review?(echen)
(In reply to Edgar Chen [:edgar][:echen] from comment #27)
> Comment on attachment 8483925 [details] [diff] [review]
> patch, v2.
> 
> Review of attachment 8483925 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/system/gonk/RadioInterfaceLayer.js
> @@ +2079,5 @@
> > +      if (DEBUG) this.debug("Fallback to " + key + ": " + index)
> > +
> > +      let networkTypes = RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[index];
> > +      supportedNetworkTypes = networkTypes ? networkTypes.split("/") :
> > +        RIL.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT.split(",");
> 
> '-auto' should only be allowed when we take RIL_PREFERRED_NETWORK_TYPE as
> supported type.
> So let's handle '-auto' here.
> You can use replace() [1] to remove it, eg. networkTypes.replace("-auto",
> "", "g").split("/");

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace

> 
> @@ +2087,5 @@
> > +      let type = supportedNetworkTypes[i];
> > +      // Remove unsed part, e.g. '-auto' in 'gsm-auto'.
> > +      let index = type.indexOf("-");
> > +      if (index != -1) {
> > +        supportedNetworkTypes[i] = type = type.substring(0, index);
> 
> As mention above, please remove this.
> Thank you.
Attached patch patch, v3.Splinter Review
Address review comment 28:
- use replace() for filtering '-auto' and do it only when we take RIL_PREFERRED_NETWORK_TYPE as supported network type.
Attachment #8483925 - Attachment is obsolete: true
Attachment #8484008 - Flags: review?(echen)
Comment on attachment 8484008 [details] [diff] [review]
patch, v3.

Review of attachment 8484008 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you. :)
Attachment #8484008 - Flags: review?(echen) → review+
https://hg.mozilla.org/mozilla-central/rev/32cf494262d2
Assignee: nobody → jjong
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S4 (12sep)
You need to log in before you can comment on or make changes to this bug.