How I achieved dual SIM operation on RP2

updateing

Senior Member
Aug 25, 2012
489
1,140
0
Wuhan
I was planning to get a new phone with a great display, and that was exactly when RP2 went on sale. I'm otherwise satisfied with the phone, but single SIM is definitely a deal breaker in China. Given that I could not find any other phone matching my criteria, I decided to get the RP2 and tried to enable dual SIM on it. Till now I've had some success, and here is what I have done.

If you have strong demand for dual SIM like I do, you may try these steps. This thread, however, is NOT a proper nor complete guide on this topic. It is just a record of my trials - they are highly experimental, risky, and potentially broken. There is absolutely no guarantee on signal quality, stability, power consumption or even the success rate. Your device can be permanently damaged if any detail goes wrong. Make sure you understand all the risks and you are able to justify every command before typing it to your phone!

I do appreciate suggestions for the correct way, though. Comments are greatly welcomed!

My environment

QPST 2.7.477 - only PDC is used here, so any version with standalone PDC tool might do the job. But new versions required if you want to use other tools.
QXDM Professional 3.14.1144 - this one is optional. It's used to tweak some parameters, but dual SIM does work without the tweaks.
Qualcomm USB drivers 2.1.2.0 from 2015/7/8 - older versions might work as well.
Windows 10, 1803
arter97's kernel and Magisk-patched stock kernel images readily at hand. The latter can be obtained by patching a stock kernel image in Magisk Manager with "Keep dm-verity/avb 2.0" UNTICKED. I had the latter installed on the phone.
Make sure root shell can be obtained during boot with ALL kernel images. This is an important recovery approach if the phone bootloops.

Steps

I've gone through a tricky path to confirm that there is indeed a second IMEI in the phone prior to the steps, which supported follow-up researching. This thread will not cover this part as this is merely trial-and-error. I will provide suggestions on diag connection though.

1. make a backup of all partitions on the phone, leaving out system, vendor and userdata partitions of course. There are 88 partitions in my backup.

2. make a QCN backup of modem NV. This step could be optional as modemst1/2 has already been backed-up in previous step - I'm not sure about this, and have completed this step whatsoever.

3. make a backup of /vendor/etc/vintf/manifest.xml, and add slot2 instances to the following HALs:

  • android.hardware.radio - this one has 2 interfaces, and both of them need the slot2 addition
  • vendor.qti.hardware.radio.am
  • vendor.qti.hardware.radio.qtiradio - this one has 2 versions, and both of them need the slot2 addition

4.
Code:
adb shell su -c setprop persist.radio.multisim.config dsds
5. find any USB mode with rmnet in /vendor/etc/init/hw/init.msm.configfs.rc, and switch to it. I used "diag,serial_cdev,rmnet,dpl,adb", and that's

Code:
adb shell su -c setprop sys.usb.config diag,serial_cdev,rmnet,dpl,adb
6. Windows shows a lot of new USB devices. Force-install Qualcomm WWAN driver for the RmNet device. I chose "Network Adapters -> Qualcomm -> Qualcomm HS-USB WWAN Adapter 90B8", but anything named after "Qualcomm HS-USB WWAN Adapter" should do.

7. open PDC. There are 3 dual SIM (DSDS) hardware profiles available:

  • SR_DSDS-LA-7+7_mode-SDM845
  • SR_DSDS-WD-7+7_mode-SDM845
  • SR_DSDS-WP8-7+7_mode-SDM845

The one with WP8 in its name can be ignored, and here comes the hard choice.

I tried the WD one in the first place: activated it in the context menu on Sub0 then Sub1, and clicked Activate twice. PDC complained about malformed packet after second click, and the profile was shown as Active on Sub0, and Pending on Sub1. Nothing bad happened after a reboot, regardless of the errors above. Two SIM slots were present in About Phone, and second IMEI is correctly shown there as well. Upon inserting two SIM cards I got dual VoLTE online, and everything behaved like a normal dual SIM SDM845 device. There were some little glitches though: once or twice a day signal bars disappeared and popped up again in a few seconds. Mobile data also stuttered at random times, though not frequent - sometimes mobile data was stable for the whole day. I was satisfied with the results, and made another backup of partitions.

Then I started comparing the WD and LA profiles. I quickly realized that LA marked the phone as DSDS while WD as SS in the device_mode NV entry (I honestly had no idea why dual SIM just worked with WD). There were other differences unknown to me, but LA seemed more "correct" and I decided to switch to this profile. After deactivating WD on both Sub0 and Sub1, I activated LA on Sub0 but not Sub1. The phone could still make use of two SIMs, but without VoLTE on either card. LTE was still available for both cards though. The glitches with WD were mostly gone (data still stuttered but recovered much faster), and the phone SEEMED cooler and battery SEEMED to drain slower.

Finally I could not understand the lack of VoLTE and switched back to WD (still Sub0 only). This time only the first SIM card could register on IMS/VoLTE. The second one registered on LTE but not IMS, regardless of default data card selection. Activating WD on Sub1 did not solve the problem. Manual checks/corrections on the differences between WD and LA made no effect either. I had to flash the backup made after first WD trial, and dual VoLTE worked again.

I came to the following conclusion after this step:

  1. a. hardware profiles may be applied to Sub0 only (can anyone confirm this?)
  2. b. a profile may not be completely reverted after applying. That is to say, same profile status does not mean same baseband behavior.
  3. c. LA profile does not support VoLTE for some reason.
  4. d. if you want dual VoLTE, your best bet would be activating WD on Sub0 and Sub1 right after previous steps, though Sub1 won't accept the setting.
  5. e. mobile data may stutter with dual SIM (this could also be the fault of my service provider however)

Any clarification on this step is appreciated. If you want to enable dual SIM, you have to make your own choice here. Just remember to backup before every change.

8. apply some NV changes from LA on WD base:

ue_usage_setting: from DATA_CENTRIC to VOICE_CENTRIC
device_mode: from SS to DSDS
disable_global_mode: from 1 to 0

I failed to find any difference after these changes. this step could be optional. I myself use the phone as daily driver with these changes though.

That's all. Don't worry, I'm confused as you :( Everything just works or fails without any valid reason :(

Other Details

1. RP2 uses the same SIM card slot as Samsung. I filed an card tray from Samsung S7 so that it fits RP2. Its size naturally(;)) fits RP2, just make it as thin as Razer's tray and it will work.
2. if you want to restore a modemst1/2 backup, do that in TWRP. If this needs to be done in Android system, stop vendor.rmt_storage first.
3. if the phone reboots to recovery right after booting to lock screen, this could be SIM count in baseband and system diverging. Run
Code:
adb shell su -c setprop persist.radio.multisim.config ss
during boot to see if this fixes the problem. If it does, restore all backups then start all over.
4. QPST does not recognize the diag port from the phone upon USB connection. Do this so that diag port works:

Code:
# in adb shell, assuming USB mode has already been switched
su
setenforce 0
stop vendor.per_mgr
# wait a few sec until QPST recognizes SDM845 on the diag port
start vendor.per_mgr
# SDM845 disappears and re-appears after a few sec, and QPST is usable
5. arter97's kernel disables diag drivers, and QPST could never recognize the phone. You have to use stock kernel if you intend to use anything other than PDC.
 

updateing

Senior Member
Aug 25, 2012
489
1,140
0
Wuhan
Screenshots and photos:

Screenshot of About Phone:



Screenshot of dual VoLTE:



Photos of the filed card tray inside RP2:




The original Samsung tray:




And after filing:




 
Last edited:
  • Like
Reactions: FellpeSoares

FellpeSoares

Member
Sep 13, 2016
19
4
0
Belém, PA
I finally got it

i updated to rom deodexed and zipalign from Warrior1988
after that I looked at the settings, the second Imei appeared :p
then I put sim card, android recognizes then it worked

PS: i modded SIM Card with MicroSD, now i have dual SIM with MicroSD :laugh:
IMG

unfortunately, now i see this message on starting, but starts normally (don't shutdown) :victory:
IMG

Update: you can remove this with command
reboot "dm-verity enforcing"
 
Last edited:

th3cavalry

Senior Member
Dec 1, 2010
50
10
0
So I'm stuck at step 7. I have the both SIM slots showing in the phone but no IMEI for SIM2. When I open PDC it doesn't show anything.

When we add the slot2, do we add slot1,slot2 or do we add a whole nother line in the file for slot2?
 

th3cavalry

Senior Member
Dec 1, 2010
50
10
0
Did you have any issues with PDC in the beginning?

I was planning to get a new phone with a great display, and that was exactly when RP2 went on sale. I'm otherwise satisfied with the phone, but single SIM is definitely a deal breaker in China. Given that I could not find any other phone matching my criteria, I decided to get the RP2 and tried to enable dual SIM on it. Till now I've had some success, and here is what I have done.

If you have strong demand for dual SIM like I do, you may try these steps. This thread, however, is NOT a proper nor complete guide on this topic. It is just a record of my trials - they are highly experimental, risky, and potentially broken. There is absolutely no guarantee on signal quality, stability, power consumption or even the success rate. Your device can be permanently damaged if any detail goes wrong. Make sure you understand all the risks and you are able to justify every command before typing it to your phone!

I do appreciate suggestions for the correct way, though. Comments are greatly welcomed!

My environment

QPST 2.7.477 - only PDC is used here, so any version with standalone PDC tool might do the job. But new versions required if you want to use other tools.
QXDM Professional 3.14.1144 - this one is optional. It's used to tweak some parameters, but dual SIM does work without the tweaks.
Qualcomm USB drivers 2.1.2.0 from 2015/7/8 - older versions might work as well.
Windows 10, 1803
arter97's kernel and Magisk-patched stock kernel images readily at hand. The latter can be obtained by patching a stock kernel image in Magisk Manager with "Keep dm-verity/avb 2.0" UNTICKED. I had the latter installed on the phone.
Make sure root shell can be obtained during boot with ALL kernel images. This is an important recovery approach if the phone bootloops.

Steps

I've gone through a tricky path to confirm that there is indeed a second IMEI in the phone prior to the steps, which supported follow-up researching. This thread will not cover this part as this is merely trial-and-error. I will provide suggestions on diag connection though.

1. make a backup of all partitions on the phone, leaving out system, vendor and userdata partitions of course. There are 88 partitions in my backup.

2. make a QCN backup of modem NV. This step could be optional as modemst1/2 has already been backed-up in previous step - I'm not sure about this, and have completed this step whatsoever.

3. make a backup of /vendor/etc/vintf/manifest.xml, and add slot2 instances to the following HALs:

  • android.hardware.radio - this one has 2 interfaces, and both of them need the slot2 addition
  • vendor.qti.hardware.radio.am
  • vendor.qti.hardware.radio.qtiradio - this one has 2 versions, and both of them need the slot2 addition

4.
Code:
adb shell su -c setprop persist.radio.multisim.config dsds
5. find any USB mode with rmnet in /vendor/etc/init/hw/init.msm.configfs.rc, and switch to it. I used "diag,serial_cdev,rmnet,dpl,adb", and that's

Code:
adb shell su -c setprop sys.usb.config diag,serial_cdev,rmnet,dpl,adb
6. Windows shows a lot of new USB devices. Force-install Qualcomm WWAN driver for the RmNet device. I chose "Network Adapters -> Qualcomm -> Qualcomm HS-USB WWAN Adapter 90B8", but anything named after "Qualcomm HS-USB WWAN Adapter" should do.

7. open PDC. There are 3 dual SIM (DSDS) hardware profiles available:

  • SR_DSDS-LA-7+7_mode-SDM845
  • SR_DSDS-WD-7+7_mode-SDM845
  • SR_DSDS-WP8-7+7_mode-SDM845

The one with WP8 in its name can be ignored, and here comes the hard choice.

I tried the WD one in the first place: activated it in the context menu on Sub0 then Sub1, and clicked Activate twice. PDC complained about malformed packet after second click, and the profile was shown as Active on Sub0, and Pending on Sub1. Nothing bad happened after a reboot, regardless of the errors above. Two SIM slots were present in About Phone, and second IMEI is correctly shown there as well. Upon inserting two SIM cards I got dual VoLTE online, and everything behaved like a normal dual SIM SDM845 device. There were some little glitches though: once or twice a day signal bars disappeared and popped up again in a few seconds. Mobile data also stuttered at random times, though not frequent - sometimes mobile data was stable for the whole day. I was satisfied with the results, and made another backup of partitions.

Then I started comparing the WD and LA profiles. I quickly realized that LA marked the phone as DSDS while WD as SS in the device_mode NV entry (I honestly had no idea why dual SIM just worked with WD). There were other differences unknown to me, but LA seemed more "correct" and I decided to switch to this profile. After deactivating WD on both Sub0 and Sub1, I activated LA on Sub0 but not Sub1. The phone could still make use of two SIMs, but without VoLTE on either card. LTE was still available for both cards though. The glitches with WD were mostly gone (data still stuttered but recovered much faster), and the phone SEEMED cooler and battery SEEMED to drain slower.

Finally I could not understand the lack of VoLTE and switched back to WD (still Sub0 only). This time only the first SIM card could register on IMS/VoLTE. The second one registered on LTE but not IMS, regardless of default data card selection. Activating WD on Sub1 did not solve the problem. Manual checks/corrections on the differences between WD and LA made no effect either. I had to flash the backup made after first WD trial, and dual VoLTE worked again.

I came to the following conclusion after this step:

  1. a. hardware profiles may be applied to Sub0 only (can anyone confirm this?)
  2. b. a profile may not be completely reverted after applying. That is to say, same profile status does not mean same baseband behavior.
  3. c. LA profile does not support VoLTE for some reason.
  4. d. if you want dual VoLTE, your best bet would be activating WD on Sub0 and Sub1 right after previous steps, though Sub1 won't accept the setting.
  5. e. mobile data may stutter with dual SIM (this could also be the fault of my service provider however)

Any clarification on this step is appreciated. If you want to enable dual SIM, you have to make your own choice here. Just remember to backup before every change.

8. apply some NV changes from LA on WD base:

ue_usage_setting: from DATA_CENTRIC to VOICE_CENTRIC
device_mode: from SS to DSDS
disable_global_mode: from 1 to 0

I failed to find any difference after these changes. this step could be optional. I myself use the phone as daily driver with these changes though.

That's all. Don't worry, I'm confused as you :( Everything just works or fails without any valid reason :(

Other Details

1. RP2 uses the same SIM card slot as Samsung. I filed an card tray from Samsung S7 so that it fits RP2. Its size naturally(;)) fits RP2, just make it as thin as Razer's tray and it will work.
2. if you want to restore a modemst1/2 backup, do that in TWRP. If this needs to be done in Android system, stop vendor.rmt_storage first.
3. if the phone reboots to recovery right after booting to lock screen, this could be SIM count in baseband and system diverging. Run
Code:
adb shell su -c setprop persist.radio.multisim.config ss
during boot to see if this fixes the problem. If it does, restore all backups then start all over.
4. QPST does not recognize the diag port from the phone upon USB connection. Do this so that diag port works:

Code:
# in adb shell, assuming USB mode has already been switched
su
setenforce 0
stop vendor.per_mgr
# wait a few sec until QPST recognizes SDM845 on the diag port
start vendor.per_mgr
# SDM845 disappears and re-appears after a few sec, and QPST is usable
5. arter97's kernel disables diag drivers, and QPST could never recognize the phone. You have to use stock kernel if you intend to use anything other than PDC.
 

updateing

Senior Member
Aug 25, 2012
489
1,140
0
Wuhan
So I'm stuck at step 7. I have the both SIM slots showing in the phone but no IMEI for SIM2. When I open PDC it doesn't show anything.

When we add the slot2, do we add slot1,slot2 or do we add a whole nother line in the file for slot2?
PDC works for me from the beginning. Please check:

1. Did you install the correct driver for the RmNet device?
2. There is a combo box in PDC window with nothing selected by default. Could you choose HS-USB WWAN Adapter in its dropdown list?
 

FellpeSoares

Member
Sep 13, 2016
19
4
0
Belém, PA
So I'm stuck at step 7. I have the both SIM slots showing in the phone but no IMEI for SIM2. When I open PDC it doesn't show anything.

When we add the slot2, do we add slot1,slot2 or do we add a whole nother line in the file for slot2?

for me the second IMEI only worked after I installed this https://forum.xda-developers.com/razer-phone-2/development/rom-mr1-stock-deodexed-zipalign-t3916502
and to PDC work i used this driver https://androidfilehost.com/?fid=11410963190603864074
 

Gamesoul Master

Senior Member
Aug 26, 2010
679
176
0
Wait, so... Even though this is a single-SIM phone, it has a second IMEI in it, and the hardware to read a second SIM? All they had to do to make this officially dual-SIM was make a slightly different SIM tray and change the hardware profile?
 

updateing

Senior Member
Aug 25, 2012
489
1,140
0
Wuhan
Wait, so... Even though this is a single-SIM phone, it has a second IMEI in it, and the hardware to read a second SIM? All they had to do to make this officially dual-SIM was make a slightly different SIM tray and change the hardware profile?
Maybe they need more resources to fine tune dual SIM experiences (if they have not given up the plan for this variant). For example modem could crash when IMS registration states change on both slots simultaneously (this is why my signal bars disappear from time to time), and radio performance could be drastically degraded when two slots are registered on different bands. Making a product market-ready takes much more resources than making in happen in lab, and Razer might not want to invest that much in this area.
 

Gamesoul Master

Senior Member
Aug 26, 2010
679
176
0
Maybe they need more resources to fine tune dual SIM experiences (if they have not given up the plan for this variant). For example modem could crash when IMS registration states change on both slots simultaneously (this is why my signal bars disappear from time to time), and radio performance could be drastically degraded when two slots are registered on different bands. Making a product market-ready takes much more resources than making in happen in lab, and Razer might not want to invest that much in this area.
Makes sense. I suppose I shouldn't trivialize the process. It mostly just surprises me that the hardware (and some of the software) is there at all. They must have had plans to do dual-SIM up until almost the last minute, because otherwise I can't imagine why they wouldn't save the money needed to put that extra hardware in there. And I can't imagine they'll release any such thing at this point. They basically shut down their mobile phone division, and haven't even released a software update in months.
 

t-mobile_mda

Senior Member
May 30, 2007
501
24
38
hey guys..
enabling diag is workig on android 8.1.? it was using on pie but didnt work on oreo...anyone faced wtih this pb..?

Code:
aura:/ $ su
aura:/ # setprop sys.usb.config diag,serial_cdev,rmnet,dpl,adb
aura:/ #


---------- Post added at 02:27 PM ---------- Previous post was at 02:10 PM ----------

hey guys..
enabling diag is workig on android 8.1.? it was using on pie but didnt work on oreo...anyone faced wtih this pb..?

Code:
aura:/ $ su
aura:/ # [B]setprop sys.usb.config diag,serial_cdev,rmnet,dpl,adb[/B]
aura:/ #
i think it is not working on oreo..tried again on pie and worked again...


Code:
C:\Users\X\Desktop\Razer\Phone_2\Root\8.1>adb shell
aura:/ $ su
aura:/ # [B]setprop sys.usb.config diag,serial_cdev,rmnet,dpl,adb[/B]

C:\Users\X\Desktop\Razer\Phone_2\Root\8.1>
 

t-mobile_mda

Senior Member
May 30, 2007
501
24
38
hey again guys..

can anyone pls sahre the modemst parts..? single sim or dual it doesnt metter..

lrwxrwxrwx 1 root root 15 1970-03-18 15:27 modemst1 -> /dev/block/sdf2
lrwxrwxrwx 1 root root 15 1970-03-18 15:27 modemst2 -> /dev/block/sdf3


dd if=/dev/block/sdf2 of=/sdcard/sdf2
dd if=/dev/block/sdf3 of=/sdcard/sdf3

w.b.r.
 

omega552003

Member
Aug 20, 2010
38
16
0
Melbourne, FL
So does this kill WiFi calling?

I tried this and I jacked it up a bit. i got it to get both SIMs working (TMOUS and KT). The WiFi calling for TMOUS stopped working and also if I went to "Mobile Data" it reset the radio and never opened the menu. So i tried to revert and it got stuck in a boot loop and when i did get in the cell was completely not working, No sim, no IMEI. Luckily i flashed an older ROM (shipped 8.1MR0) and progressively upgraded through the ROMs from there and have service again. This tells me that the Stock Razer Images from their developer site don't have 'everything' for a full restore.


hey again guys..

can anyone pls sahre the modemst parts..? single sim or dual it doesnt metter..

lrwxrwxrwx 1 root root 15 1970-03-18 15:27 modemst1 -> /dev/block/sdf2
lrwxrwxrwx 1 root root 15 1970-03-18 15:27 modemst2 -> /dev/block/sdf3


dd if=/dev/block/sdf2 of=/sdcard/sdf2
dd if=/dev/block/sdf3 of=/sdcard/sdf3

w.b.r.
Grab the Stock ROM for your version then extract it: https://developer.razer.com/razer-phone-dev-tools/factory-images/
All of them have "modem.img" used in there flash script in this command:
Code:
%fastboot_cmd% flash modem_a modem.img
%fastboot_cmd% flash modem_b modem.img