• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[OFFICIAL] LineageOS 18.1 for the Samsung Galaxy S4 (All QCOM Variants)

Search This thread

Marko97IT

Member
May 3, 2016
14
1
Italy
Samsung Galaxy S6
LG K8
This ROM is totally broken. It's very unstable, makes the phone very hot, it's very slow and jerky and also Google products not work properly. I've tried all GAPPS but that's impossible to use it.
I am correcting what has been said only for the GApps. The problem was in the /data partition which I fixed. For the rest, the ROM is laggy and makes the phone heat up a lot.
 

Achsel

Senior Member
Jan 17, 2007
51
25
@npjohnson
New insights: The JSDOIN USB 2.0 HUB Ethernet adapter definitely does not work on the S4 because of the missing "cdc_ether" driver. I had only tested the UGREEN adapter with "ASIX" chipset once without success. Today I looked again in the "/sys/bus/usb/drivers" folder and found that only the "ASIX" driver is activated. So I started a new test with the UGREEN adapter, and lo and behold, it works on both S4 devices (GT-I9505/GT-I9515). I don't know why the connection failed the first time.

I recommend the UGREEN adapter with 3x USB 2.0 ports (Ships from China, third choice, model no. 20264, ASIX AX88772 chipset), because the S4 only supports USB 2.0, and "not" the USB 3.0 version (model no. 20265, ASIX AX88179 chipset), because there may be dropouts in the transmission. It may be too fast for the S4 phone).

https://de.aliexpress.com/item/3240...earchweb0_0,searchweb201602_,searchweb201603_

In order for the "cdc_ether" driver to work, all three of the following options should be activated (internet infos):

"CONFIG_USB_NET_CDCETHER", "CONFIG_USB__NET_RNDIS_HOST" and "CONFIG_USB_USBNET" (Multi-purpose USB Networking Framework).

Activation of the drivers for other chipsets:

"CONFIG_USB_NET_SMSC75XX", "CONFIG_USB_NET_SMSC95XX" and "CONFIG_USB_NET_NET1080".

Additional options that are activated on the Tab4:

"CONFIG_USB_NET_CDC_NCM", "CONFIG_USB_NET_CDC_SUBSET" and "CONFIG_USB_EHSET_TEST_FIXTURE".

Special tip:

I use a modified OTG adapter with additional female micro USB socket for external power supply. The micro USB male connector of the OTG Adapter has usually a solder bridge between PIN 4 (ID PIN) and PIN 5 (ground) to detect the OTG mode. Then you can only supply the USB device with power. Without the additional micro USB female socket the power directly comes from the phones (tablets) akku. If you solder in a resistor instead with approx. 65kOhm (specially for the Samsung Galaxy S4 phone, for the Samsung Galaxy Tab 4 tablet 80kOhm) between PIN 4 and PIN 5 of the micro USB male connector, then you can supply the USB device and the phone (tablet) with power at the same time.

Because there is no solderable PIN 4 in the micro USB male plug of the ADAPTARE OTG adapter, I bought individual micro USB male plugs with all 5 pins for soldering.

https://www.amazon.de/40228-Adapter...icro-USB-2-0-gerade-Extra-Strom/dp/B00EJP5XR2

https://www.amazon.de/dp/B01G6OYTS2...88ad-322db71d5961&ie=UTF8&qid=1513864976&sr=1

Many Greetings, Axel
 

Attachments

  • UGREEN 3x USB 2.0 HUB Ethernet Adapter.jpg
    UGREEN 3x USB 2.0 HUB Ethernet Adapter.jpg
    39.6 KB · Views: 12
  • ADAPTARE 40228 OTG Adapter.jpg
    ADAPTARE 40228 OTG Adapter.jpg
    71.1 KB · Views: 12
Last edited:
  • Like
Reactions: pocketrule

npjohnson

Recognized Developer
@npjohnson
New insights: The JSDOIN USB 2.0 HUB Ethernet adapter definitely does not work on the S4 because of the missing "cdc_ether" driver. I had only tested the UGREEN adapter with "ASIX" chipset once without success. Today I looked again in the "/sys/bus/usb/drivers" folder and found that only the "ASIX" driver is activated. So I started a new test with the UGREEN adapter, and lo and behold, it works on both S4 devices (GT-I9505/GT-I9515). I don't know why the connection failed the first time.

In order for the "cdc_ether" driver to work, all three of the following options should be activated (internet infos):

"CONFIG_USB_NET_CDCETHER", "CONFIG_USB__NET_RNDIS_HOST" and "CONFIG_USB_USBNET" (Multi-purpose USB Networking Framework).

Activation of the drivers for other chipsets:

"CONFIG_USB_NET_SMSC75XX", "CONFIG_USB_NET_SMSC95XX" and "CONFIG_USB_NET_NET1080".

Additional options that are activated on the Tab4:

"CONFIG_USB_NET_CDC_NCM", "CONFIG_USB_NET_CDC_SUBSET" and "CONFIG_USB_EHSET_TEST_FIXTURE".

Special tip:

I use a special OTG adapter with additional female micro USB socket for external power supply. The micro USB connector of the OTG Adapter has usually a solder bridge between PIN 4 (ID PIN) and PIN 5 (ground) to detect the OTG mode. Then you can only supply the USB device with power. Without the additional micro USB socket the power directly comes from the phones (tablets) akku. If you solder in a resistor instead with approx. 65kOhm (specially for the S4, for the tablet Tab4 80kOhm) between PIN 4 and PIN 5 of the micro USB connector, then you can supply the USB device and the phone (tablet) with power at the same time.

Many Greetings, Axel
do me a favor, enable the options you need, tell me exactly the list you need, then please compile test it, AND (the big one) make sure recoveryimage still fits with those built in please.


If you do all those, I'll merge it into official builds. I'm super low on time atm.
 

Achsel

Senior Member
Jan 17, 2007
51
25
@npjohnson
I have great respect for your work customizing the builds for the S4 and I understand that this is very time consuming. As already mentioned, my knowledge and the hardware available to me are not sufficient to decompile the defconfig file of the kernel implemented in a ZIP file for the installation of LineageOS 18.1, edit it and then recompile it and integrate it back into the ZIP file. For me personally it would be enough if these 3 driver options were activated in the defconfig file, which are set by default for a functioning Ethernet:

"CONFIG_USB_NET_CDCETHER", "CONFIG_USB__NET_RNDIS_HOST" and "CONFIG_USB_USBNET" (Multi-purpose USB Networking Framework).

I could then install such a modified ZIP file on a GT-I9505 and GT-I9515 as a test before you officially offer it. But if you think that this is too time consuming, I can understand that. The whole thing is in no hurry, however!

At least I'm lucky that the only Ethernet driver that is activated ("ASIX") happens to support the UGREEN adapter and your customized LineageOS 18.1 runs wonderfully on the S4, even better than the stock ROM with Android 4.4.2.

Thanks for your great job, Axel
 
Last edited:
  • Like
Reactions: pocketrule

Achsel

Senior Member
Jan 17, 2007
51
25
@npjohnson
For further information only! I hope I don't annoy you too much with this!

I guess you used this "lineageos_jf_deconfig" file as the basis for your builds. Because "CONFIG_USB_USBNET" is apparently already activated ("y"), in my opinion only the standard Ethernet driver "CONFIG_USB_NET_CDCETHER" ("is not set ") needs to be activated to support many other chipsets. Unfortunately, I am unable to do this job.

https://github.com/LineageOS/androi...-18.1/arch/arm/configs/lineageos_jf_defconfig

318 CONFIG_USB_USBNET=y
319 # CONFIG_USB_NET_CDCETHER is not set

The option "CONFIG_USB__NET_RNDIS_HOST" is probably no longer available. In addition, I couldn't find a suitable entry for the only activated "ASIX" Ethernet driver in the defconfig file. This may be enabled elsewhere. But that doesn't matter anymore.
 

npjohnson

Recognized Developer
@npjohnson
For further information only! I hope I don't annoy you too much with this!

I guess you used this "lineageos_jf_deconfig" file as the basis for your builds. Because "CONFIG_USB_USBNET" is apparently already activated ("y"), in my opinion only the standard Ethernet driver "CONFIG_USB_NET_CDCETHER" ("is not set ") needs to be activated to support many other chipsets. Unfortunately, I am unable to do this job.

https://github.com/LineageOS/androi...-18.1/arch/arm/configs/lineageos_jf_defconfig

318 CONFIG_USB_USBNET=y
319 # CONFIG_USB_NET_CDCETHER is not set

The option "CONFIG_USB__NET_RNDIS_HOST" is probably no longer available. In addition, I couldn't find a suitable entry for the only activated "ASIX" Ethernet driver in the defconfig file. This may be enabled elsewhere. But that doesn't matter anymore.
Done, and merged: https://review.lineageos.org/c/LineageOS/android_kernel_samsung_jf/+/314488 - nex build should have what you need.
 

Achsel

Senior Member
Jan 17, 2007
51
25

Attachments

  • JSDOIN 3x USB 2.0 HUB Ethernet Adapter.png
    JSDOIN 3x USB 2.0 HUB Ethernet Adapter.png
    337.7 KB · Views: 7
  • Like
Reactions: zyhk and npjohnson

zyhk

Senior Member
May 9, 2020
133
45
@npjohnson
Thank you for activating the "cdc_ether" standard Ethernet driver in the "lineageos_jf_deconfig" file. After installing the next update on my two S4 devices (GT-I9505/GT-I9515), I will report whether this driver works as expected with my other very inexpensive JSDOIN 3x USB 2.0 HUB Ethernet adapter with Corechip SR9000 chipset.
My tp-link UE300 (1000BASE-T) adapter (cdc_ether) is working on the latest ROM. Probably its data rate is comparable to that of S4's wifi.
 
  • Like
Reactions: Achsel

Gerdje_

Member
Jan 20, 2018
49
11
I have a question, not directed to the dev, but to everyone who is using magisk with this build. But first a big thank to npjohnson!

I'm using the jfvelte and did a dirty install from Official LOS 17.1 to 18.1, because I'm not willing to setup the entire phone again. I have two identical devices, and my testmachine is updated to 18.1 now. I flashed the newest TWRP on it.

I need root but there lies my problem. Do I first need to upgrade Magisk 22 to 23, and after that do the dirty install of Lineage? I tried to install Magisk 23 on it but it somehow is not working properly. I know this is the Samsung S4 thread, but any idea how to upgrade to the new Magisk on this particular device? Can someone point me into the right direction, because all the information is confusing me too much. Thank you!
 

Achsel

Senior Member
Jan 17, 2007
51
25
@zyhk
Thanks for the information! That sounds good! At the moment only the VE version of the S4 is available to me (GT-I9515). So I have to wait for the JFVELTE update to test it. The GT-I9505 (JFLTEXX) will be back in my hands for about a week. Then I will report.
 

sjamie

Senior Member
Aug 6, 2011
8,546
4,314
I have a question, not directed to the dev, but to everyone who is using magisk with this build. But first a big thank to npjohnson!

I'm using the jfvelte and did a dirty install from Official LOS 17.1 to 18.1, because I'm not willing to setup the entire phone again. I have two identical devices, and my testmachine is updated to 18.1 now. I flashed the newest TWRP on it.

I need root but there lies my problem. Do I first need to upgrade Magisk 22 to 23, and after that do the dirty install of Lineage? I tried to install Magisk 23 on it but it somehow is not working properly. I know this is the Samsung S4 thread, but any idea how to upgrade to the new Magisk on this particular device? Can someone point me into the right direction, because all the information is confusing me too much. Thank you!
You can dirty flash LineageOS before or after upgrading Magisk.

To upgrade Magisk, download the latest Magisk apk. Rename the file extension to ZIP. Flash magisk zip in either the Magisk app or via TWRP. I always flash the latest Magisk zip via Magisk and I haven't had any issues.
 
Last edited:
  • Like
Reactions: Gerdje_

Achsel

Senior Member
Jan 17, 2007
51
25
@Gerdje_
I had previously installed the stock ROM with Android 5 on both S4 versions (JFLTEXX and JFVELTE). Therefore, I first installed the latest version of TWRP via ODIN, then made a total wipe (no dirty install) and then installed LinageOS 18.1, BiTGapps Official ARM and Magisk 23 in one go without any problems. Unfortunately, I can't give you a tip for the Magisk update from 22 to 23.
https://www.pling.com/p/1462973/
 
  • Like
Reactions: Gerdje_

Gerdje_

Member
Jan 20, 2018
49
11
Thanks guys! Magisk 23 seems to work, but uninstalling the old magisk, by renaming the apk to uninstall.zip didn't work well, TWRP is telling me that it is an invallid zip or something and in Magisk itself there is no option to do an uninstall, only restore images.
 

stef2020

New member
Aug 12, 2021
4
0
Hi. I have been using LineageOS on my Samsung Galaxy S4 for a years now without problems. A few months ago I opted to make the upgrade to LOS 18.1 & this went without issue & everything was working fine. However last week I opted to update to the latest build using the updater in the settings & this seemed to go without any issue, However upon reboot after the install I began having issues with my wifi.

When I try to enable the wifi It will either work as normal but go offline after a short period or simply search & never find any available networks.

I tried reflashing the update via recovery & also tried flashing back to prior builds yet nothing seems to fix it. Today I went into recovery & did a full data wipe & fresh install of the June 11th build as I know that worked as it was the first 18.1 build I installed yet it's still doing the same thing.


It could obviously be a hardware issue but it just seems weird that it started right after I did an update so I want to cover all possible software solutions before giving up on the phone completely as I can't really afford a new one right now.

So is there anything else I could try to confirm software or hardware?
 
Last edited:

Gerdje_

Member
Jan 20, 2018
49
11
or simply search & never find any available networks.
Hi stef2020,

I had this issue with an unofficial LOS 17.1 build, at least the search and never find wifi problem: it was a known bug, and you had to reboot it to get the wifi to work again. Not sure if this workaround will help as well. It was definitively not an hardware issue in my case.
 

Top Liked Posts

  • 1
    I seem to be having regular issues with Wi-Fi connectivity. Is it just me? Wi-Fi stays connected but I can't load webpages, need to reboot before things work again.
    just checked:
    - I could download new update from today
    - surf the internet

    no errors here (tested with mobile data OFF and only wifi ON)

    "WI-FI-enhanced MAC randomisation" ON (see Developer options) and Router with MAC filter configured ?
  • 2
    @npjohnson
    After doing an new clean installation on my both S4 devices (GT-I9505 and GT-I9515) with the reduced "MindTheGapps" (see my instructions and attachement in post 249) and "Magisk-v23.0.zip" via "TWRP 3.5.2_9-1" 5 days ago, I was able to install today's update via "System/Advanced/Updater", as expected, fully automatically via TWRP on the GT-I9505 too.
    2
    Sorry. I thought you could help out wit this: "Somebody could find the LineageOS maintainer for jfltexx and kindly ask them to change the BoardConfig to allow for more space in the system partition."
    No, because stock lineageos fits in this size, and can be used on the GPE version.

    If I up the number the GPE version won't be able to install lineage.
    2
    It doesn't affect the "Battery light".
    No matter what position the "Lights with screen on" toggle is set to, if the "Battery Light" toggle is set to active, the led will turn on every time the usb cable is connected, even when the screen is lit up.

    Could this change with future updates? I remeber it being a feature in the 14.1 (unofficial) build I was running previously on the same phone.
    1. Huh, looks like it's a platform feature we don't have - maybe someone will port it.
    2. Nah. It's had people attempt to resurrect it for some time, doubtful someone will find the time to actually do it properly.
    1
    Hi 👋 I just got my old s4 from my niece and unfortunately I don't see this version. I believe it is a sgh-720t (jflte).
    Use Lineage Recovery - that's a SUPER old, and unified jflte recovery. You need a jfltespr recovery.
    1
    I seem to be having regular issues with Wi-Fi connectivity. Is it just me? Wi-Fi stays connected but I can't load webpages, need to reboot before things work again.
    just checked:
    - I could download new update from today
    - surf the internet

    no errors here (tested with mobile data OFF and only wifi ON)

    "WI-FI-enhanced MAC randomisation" ON (see Developer options) and Router with MAC filter configured ?
  • 22
    lineage-os-logo.png

    Samsung Galaxy S4

    Code:
    - Your warranty is now void.
    - You have been warned.
    - Use at your own risk.

    Introduction:
    This is the Official Lineage OS 18.1 thread for all Galaxy S4 variants.

    Downloads:
    Please follow the install instructions in your device's Wiki page linked below exactly, and make sure your device's firmware matches the required firmware listed.
    • jactivelte (GT-I9295)
    • jflteatt (SGH-I337) - Please note you will need to be on bootloader I337UCUAMDB or I337UCUAMDL
    • jfltespr (SCH-R970/C/X, SPH-L720)
    • jfltevzw (SCH-I545) - Please note you need to be on bootloader I545VRUSMDK
    • jfltexx (GT-I9505, SGH-I337M, SGH-M919) - NOTE: GT-I9505G is supported in this build, but due to system size space limitations it will not fit any form of GApps package.
    • jfvelte (GT-I9515/L)

    If you don't follow these instructions, or use 3rd party add-ons (like Magisk) please don't expect support here.

    Known Bugs:
    • MHL doesn't work after LineageOS 14.1, and likely never will again, as Google dropped support for it platform-wide in AOSP.
    • Find any? Report them according to this guide.
    Notes:
    • The only supported GApps package at the moment is MindTheGapps, linked on our Wiki page about gapps.
    Kernel Source: https://github.com/LineageOS/android_kernel_samsung_jf
    6
    thanks for response and support
    This issue is now fixed. You will need to sideload the upcoming build by hand to get back on track though.

    Sorry for the inconveniences.
    5
    Good news, my GT-I9505 is updating automatically at this moment ("Update recovery" option disabled).
    Next step, activate the option to update the recovery and see if this works well.
    Thanks @npjohnson for your incredible work
    the recovery image updates the second you check the box.

    after you update OS, it updates the recovery on the next boot during boot animation.

    Have fun! Good to hear.
    5
    USB otg is unfortunately broken at the moment. But you can get access to your external storage by installing MiXplorer (which I recommend in any case) and "enable otg" in settings -> more settings
    Should be fixed in next build.
    4
    many thanks all developers - great work.

    i had dirty flashed from official 17.1 with 65 installed apps yesterday
    (SAMSUNG_I9505)

    rebooted to TWRP (twrp-3.5.1_9-0-jflte)
    0. wiped only system/dalvic/cache:
    1. flashed LOS (lineage-18.1-20210401-nightly-jfltexx-signed.zip)
    2. MindTheGapps-11.0.0-arm-20210328_143701
    3. magisk 22.0

    everything works well.


    but there was to much google-apps.

    i had unzipped MindTheGapps-11.0.0-arm-20210328_143701
    and reduced apps like "open_gapps-arm-pico"

    deleted:
    system/product/app/GoogleTTS
    system/product/app/talkback
    system/product/priv-app/AndroidAutoStubPrebuilt
    system/product/priv-app/Velvet

    and zipped again "MindTheGapps-11.0.0-arm-20210328_reduced"

    also once again

    0. wiped only system/dalvic/cache - rebooted to TWRP:
    1. flashed LOS 18.1
    2. MindTheGapps-11.0.0-arm-20210328_reduced
    3. magisk

    everything works well for now.