Development [ROM][13.0][ENCRYPTION] Official LineageOS 20 for A52 4G and A72

Search This thread

ethical_haquer

Senior Member
Jan 30, 2023
514
219
Samsung Galaxy A52 4G
It won't work unless they still have 2G and/or 3G running. Sadly there are no workarounds for that.
Okay, thanks for replying. So I see people on here that are talking about calls, so are there any carriers in the United States that don't require voLTE? If not, I guess I'll have to go back to stock :(. I finally reached the limits of using an open-source, De-googled Android phone. After flashing your build of Lineage OS on my phone (Thanks for building it), rooting it with Magisk, and installing only open-source apps on my phone, it was Samsung's proprietary implementation of voLTE that stopped me in my tracks. Messaging works, but not calling (the "Phone" app, and a different open-source phone app, crash after trying to make a call), when using an AT&T SIM card. Perhaps eventually there will be a solution to using voLTE on a custom ROM for Samsung devices, but until then, I will try my hand at De-googling and rooting the stock ROM.

Best regards,
@ethical_haquer
 
Last edited:

ethical_haquer

Senior Member
Jan 30, 2023
514
219
Samsung Galaxy A52 4G
I just noticed something. Typical image size of photos taken while on the stock ROM is roughly 4-6MB, while photos taken by either Aperture or OpenCamera on LineageOS is much higher (roughly 70-90MB). I have found nothing immediate that could explain this (quite large) discrepancy in file size (neither resolution, nor apparent JPEG compression quality, they seem to be the same by default).

Anyone with an explanation as to what is going on here? And maybe a way to go back to some more reasonable file size per picture?
Take a look at my post on this thread:
Thanks for developing this ROM, Simon! I have been using it for a little while now and it works well. There is only one problem: the camera app doesn't appear to know the size of certain photos it takes. For example, every photo taken with the 64 MP main camera is supposedly exactly 73.22 MB large. All of the following info is from my A52 4G running your first official build of Lineage OS 20. When I copy the photos to my Linux computer I get the same results. Notice how the italicized cameras create photos that are both ginormous and the same exact size. As far as I know, each photo should be slightly different (as the 12MP and 5MP photos, and all videos demonstrate). Anyone else noticing this?

Camera App (Aperature) Settings: Ratio 4:3, Capture Mode - Minimize Latency, Enable OIS

All images are JPGs

12MP Ultra Wide:

Photo1:
Width 4000
Height 3000
File Size: 3.63 MB
Photo2:
Width 4000
Height 3000
File Size: 3.71 MB

64MP Main(Shown as 12.2MP):
Photo1:
Width 4032
Height 3024

File Size: 73.22 MB
Photo2:
Width: 4032
Height: 3024

File Size: 73.22 MB
Video1(5 Seconds):
Width: 1920
Height: 1080
File Size: 12.41 MB
Video2(5 Seconds):
Width: 1920
Height: 1080
File Size: 12.10 MB


5MP Macro:

Photo1:
Width: 2675
Height: 1932
File Size: 1.20 MB
Photo2:
Width: 2576
Height: 1932
File Size: 1.12 MB

32MP Back(Shown as 8.0MP):
Photo1:
Width: 3264
Height: 2448

File Size: 47.94 MB
Photo2:
Width: 3264
Height: 2448

File Size: 47.94 MB
Video1(5 Seconds):
Width: 1920
Height: 1080
File Size: 12.30 MB
Video2(5 Seconds):
Width: 1920
Height: 1080
File Size: 12.55 MB

UPDATE:
I just installed the "Open Camera" app on F-Droid, to see what the filesize was of photos taken from a different app, and...they are even bigger! Every photo I take with the Open Camera app is 96.22 MB large. Interesting how they also end in ".22".
So far, you are the only other person I know who is having this issue. I even posted a thread on this problem, but know one replied. It's like, yeah, it's a nice camera app, but it's not even usable because of the size of the files. Right now I'm stuck using Open Camera because it has a better settings. I hope some Dev can fix this...
 
  • Like
Reactions: Flyos

Flyos

Member
Nov 8, 2014
19
5
So far, you are the only other person I know who is having this issue. I even posted a thread on this problem, but know one replied. It's like, yeah, it's a nice camera app, but it's not even usable because of the size of the files. Right now I'm stuck using Open Camera because it has a better settings. I hope some Dev can fix this...
Thanks for sharing this (and sorry I missed your post). What I don't get is that Samsung's stock photo app is taking seemingly the same resolution/JPEG quality for the files and ends up with files roughly a hundred times smaller than both Aperture/Open Camera. I mean, I expect some level of hardware/software optimisation being lost with LineageOS, but this is... huge.

Anyhow, what is your config for Open Camera? Did you find a way to end with files of reasonable size?
 
  • Like
Reactions: ethical_haquer

ethical_haquer

Senior Member
Jan 30, 2023
514
219
Samsung Galaxy A52 4G
Thanks for sharing this (and sorry I missed your post). What I don't get is that Samsung's stock photo app is taking seemingly the same resolution/JPEG quality for the files and ends up with files roughly a hundred times smaller than both Aperture/Open Camera. I mean, I expect some level of hardware/software optimisation being lost with LineageOS, but this is... huge.

Anyhow, what is your config for Open Camera? Did you find a way to end with files of reasonable size?
I know, it's crazy, are we really the only ones having this issue? Anyway, using Open Camera I can get ~5 MB photos by going to Open Camera, clicking on the "⚙️", then "Photo settings...", and then "Camera resolution". I have mine on "1280 x 720 (16:9, 0.92MP)", and get photos that are ~5 MB. I'm pretty sure, however, that this size photo is still huge in relation to how many megapixels (0.92) big it is. The only way I can get normal (i think) sized photos is to change, in the "Photo settings...", the "Image format" to PNG. Surprisingly, this creates an image that is ~19 MB large...at 16.04 MP (the largest photo size possible with a custom ROM on this phone). Compare this to 96.22 MB with a JPEG that has the same amount of MPs. WEBPs are similiar to PNGs in size, and both create files that vary slightly in size, unlike JPEG ones on this phone, which are always 96.22 MB (I say "on this phone" b/c this is not normally the case with JPEGs). I hope this info helps, and thanks for sharing your problem!
 
Perhaps eventually there will be a solution to using voLTE on a custom ROM for Samsung devices, but until then, I will try my hand at De-googling and rooting the stock ROM.
Honestly from what I know VoLTE on Samsung devices running AOSP has been an issue for a loooong time (>6 years), and nothing has changed in that time. So the chances for VoLTE being supported in the future are.. low.

Take a look at my post on this thread:
I honestly totally forgot about this.. Will check soon.
 

ethical_haquer

Senior Member
Jan 30, 2023
514
219
Samsung Galaxy A52 4G
Honestly from what I know VoLTE on Samsung devices running AOSP has been an issue for a loooong time (>6 years), and nothing has changed in that time. So the chances for VoLTE being supported in the future are.. low.


I honestly totally forgot about this.. Will check soon.
Thanks for being honest. I will try to reflash the stock ROM, and then come back to this one after I get a different phone for phone calls. Also, do you know where to get the firmware for this thing? I looked online and found many websites that host them, including this one, but they only have ROMs with csc codes from other countries. My A52 is unlocked, and I'm in the U.S., so what one should I download?
 

Flyos

Member
Nov 8, 2014
19
5
I know, it's crazy, are we really the only ones having this issue? Anyway, using Open Camera I can get ~5 MB photos by going to Open Camera, clicking on the "⚙️", then "Photo settings...", and then "Camera resolution". I have mine on "1280 x 720 (16:9, 0.92MP)", and get photos that are ~5 MB. I'm pretty sure, however, that this size photo is still huge in relation to how many megapixels (0.92) big it is. The only way I can get normal (i think) sized photos is to change, in the "Photo settings...", the "Image format" to PNG. Surprisingly, this creates an image that is ~19 MB large...at 16.04 MP (the largest photo size possible with a custom ROM on this phone). Compare this to 96.22 MB with a JPEG that has the same amount of MPs. WEBPs are similiar to PNGs in size, and both create files that vary slightly in size, unlike JPEG ones on this phone, which are always 96.22 MB (I say "on this phone" b/c this is not normally the case with JPEGs). I hope this info helps, and thanks for sharing your problem!
Thanks. I played a bit with it. I discovered something very troubling. At the resolution I was at that time, Open Camera produced JPEG of 72MB, but then I asked Open Camera to save the RAW (DNG) file only: it was only 32MB! This is getting super weird. What could cause this?
 

ethical_haquer

Senior Member
Jan 30, 2023
514
219
Samsung Galaxy A52 4G
Thanks. I played a bit with it. I discovered something very troubling. At the resolution I was at that time, Open Camera produced JPEG of 72MB, but then I asked Open Camera to save the RAW (DNG) file only: it was only 32MB! This is getting super weird. What could cause this?
At 16.04 MP a RAW photo I take is ~32 MP as well, and varied (one was 32.10, the other was 32.11). These are bigger then PNG and WEBP, but much smaller than JPEGs. Also, so far, only JPEG files are all the same size.
 
Thanks for being honest. I will try to reflash the stock ROM, and then come back to this one after I get a different phone for phone calls. Also, do you know where to get the firmware for this thing? I looked online and found many websites that host them, including this one, but they only have ROMs with csc codes from other countries. My A52 is unlocked, and I'm in the U.S., so what one should I download?
I usually download stock firmware from samfw.com, but there are also programs like Frija or Samloader that do the job just fine.
 

ethical_haquer

Senior Member
Jan 30, 2023
514
219
Samsung Galaxy A52 4G
I usually download stock firmware from samfw.com, but there are also programs like Frija or Samloader that do the job just fine.
Thanks, I have looked there, but try searching "SM-A525F", It brings up my device. However, It doesn't list any firmware with a United States csc code. Like I said, I'm in the U.S. and my device is unlocked, so what one should I download? I was wondering if I could install one from a different country, but it sounds like that might cause problems with OTA updates and wireless standards. I'm really not sure what to do if nowhere has any U.S. firmware. :unsure:

EDIT: there is a SRR "unknown" firmware, would that work?
 

rien333

Member
Dec 29, 2019
12
9
I know, it's crazy, are we really the only ones having this issue?
No, seeing this too. I guess people just haven't noticed. I ran magick -quality 100 original.jpg new.jpg, and found that new.jpg is much smaller (48Mb vs. 2.2Mb, for the new one). Perhaps that indicates that there's a lot of compressable data somewhere?

EDIT:
Just ran git diff -a on those two files. I found that the original jpg contains tons and tons of the string "^@", espcially towards the end. Maybe that accounts for the size difference?
 
Last edited:

ethical_haquer

Senior Member
Jan 30, 2023
514
219
Samsung Galaxy A52 4G
@Simon1511, @Flyos, and @rien333:

I am glad some progress is being made with the photo size issue, and I hope that the cause of the issue will be found. However, I am sadly not going to be able to help anymore, because I am in the process of going back to stock due to voLTE. I will be back to help with testing in a couple months or so after I get a different phone for calling (Perhaps the Volla Phone 22). Best regards, @ethical_haquer
 
  • Like
Reactions: Flyos and Simon1511

rien333

Member
Dec 29, 2019
12
9
Did not find anything new, but confirmed and quantified my suspicions.

Essentially, there is about 47MB worth of zeros at the end of every jpg (that's 47 million zeros). There might be other large patches of zeros here and there, but I have not looked into those. Pretty sure its always the same amount of zeros.

Indeed, if run trunctate -s -47MB *jpg in my camera folder (which is Unix for "remove the last 47MB of every jpg"), I end up wit jpgs that are much smaller (obviously!) and still open correctly. If you have termux on your phone, you can run that truncate command to losslessly shave some megs from your pics. (maybe make sure that there is indeed 47MB of zeros - hexdump -c helped me here)

@Flyos is this worth reporting upstream?
 
Last edited:

ethical_haquer

Senior Member
Jan 30, 2023
514
219
Samsung Galaxy A52 4G
Did not find anything new, but confirmed and quantified my suspicions.

Essentially, there is about 47MB worth of zeros at the end of every jpg (that's 47 million zeros). There might be other large patches of zeros here and there, but I have not looked into those. Pretty sure its always the same amount of zeros.

Indeed, if run trunctate -s -47MB *jpg in my camera folder (which is Unix for "remove the last 47MB of every jpg"), I end up wit jpgs that are much smaller (obviously!) and still open correctly. If you have termux on your phone, you can run that truncate to losslessly shave some megs from your pics. (maybe make sure that there is indeed 47MB of zeros - hexdump -c helped me here)

@Flyos is this worth reporting upstream?
I would imagine Lineage might want to look into this. :) Wow.
 
  • Like
Reactions: Flyos and Simon1511

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    Good news!

    I've been continuing on fixing bugs and tiny issues reported for a long time. Following issues have been addressed:
    • Speaker and Earpiece output in VoIP calls (for example Whatsapp, Discord, etc) are no longer reversed
    • Audio in phone calls with some bluetooth headphones or Smartwatches doesn't play from speaker/earpiece anymore
    • The fingerprint icon on the lock screen no longer appears on top of the lockscreen text
    • Removed Dolby audio effect as it didn't actually impact audio quality and in exchange added back AudioFX
    • Improved vibration intensities
    • Set FOD color to white (as on stock ROM)
    • The screen now doesn't get darker when using FOD but instead keeps its brightness (fixes FOD on AOD failing)
    • Prevent the screen from jumping to high brightness (and getting stuck there) after unlocking with fingerprint
    • Switched back to Camera2 to fix pictures being ~100mb each
    • Fixed "Extend compatibility" toggle in Hotspot settings

    A few notes on above changelog:
    We (@Ryzen5950XT ) and I have been working on the Bluetooth-phone-call-fix for around 2 months now and even now it still is not 100% rock solid. Sometimes you may encounter crackling audio for a few seconds when switching output devices or in rare cases even no audio in a call. We're still working on improving the general quality of this fix, but believe that it has become good enough to be usable as a daily driver.

    In terms of the Camera issue where it produces ~100mb pictures: I've been able to track this down to an issue with CameraX support on our phones but so far have had no luck figuring out what exactly the culprit is. However, LineageOS guidelines require me to ship a fully working Camera app. Therefore I will (temporarily) have to ship the old, feature-less Camera2 instead of Aperture.

    All these changes will be available starting from the next LineageOS builds for A52 and A72, which will most likely be 12th May (A52) and 13th May (A72).

    And as always, please keep reporting bugs and inform me about possible improvements.
    3
    Just tested the last update.
    No more brightness issue when I unlock with fingerprints, but the probleme seems to still exist when unlocking with the pattern. :-/


    I also tested bluetooth audio issue with a Bose QuietConfort 35 II and at first the problem was the same.
    Then I switched to phone speaker and go back to bluetooth during a phone call and the sound was played in the headphone.
    Dont know yet if this behaviour will occurs each time, but at least I have a workaround! :)

    Congratulation and thanks again for your work.
    3
    Hi, I just clean flashed the latest update. The AOD (Ambient display) screen gets messed up when I enable it to be "always on". The AOD turns on correctly for the first 2 or 3 seconds, and then turns into a grainy texture.
    As far as I know a similar issue existed on NcX, and there you could fix it by flashing the latest stock ROM firmware. Might wanna try that, guide is here.
    3
    As far as I know a similar issue existed on NcX, and there you could fix it by flashing the latest stock ROM firmware. Might wanna try that, guide is here.

    I flashed the latest stock firmware and the issue has been resolved. Thank you.
    2
    I can see the baseband version on the about phone -> android version -> baseband version, which is A525FXXU5DWB6. Could you please let me know which release to download?
    Just scroll through the releases on that github repository until you find one that starts with A525F. They're sorted by date, so the first one you'll find is the latest firmware available.
  • 13
    Good news!

    I've been continuing on fixing bugs and tiny issues reported for a long time. Following issues have been addressed:
    • Speaker and Earpiece output in VoIP calls (for example Whatsapp, Discord, etc) are no longer reversed
    • Audio in phone calls with some bluetooth headphones or Smartwatches doesn't play from speaker/earpiece anymore
    • The fingerprint icon on the lock screen no longer appears on top of the lockscreen text
    • Removed Dolby audio effect as it didn't actually impact audio quality and in exchange added back AudioFX
    • Improved vibration intensities
    • Set FOD color to white (as on stock ROM)
    • The screen now doesn't get darker when using FOD but instead keeps its brightness (fixes FOD on AOD failing)
    • Prevent the screen from jumping to high brightness (and getting stuck there) after unlocking with fingerprint
    • Switched back to Camera2 to fix pictures being ~100mb each
    • Fixed "Extend compatibility" toggle in Hotspot settings

    A few notes on above changelog:
    We (@Ryzen5950XT ) and I have been working on the Bluetooth-phone-call-fix for around 2 months now and even now it still is not 100% rock solid. Sometimes you may encounter crackling audio for a few seconds when switching output devices or in rare cases even no audio in a call. We're still working on improving the general quality of this fix, but believe that it has become good enough to be usable as a daily driver.

    In terms of the Camera issue where it produces ~100mb pictures: I've been able to track this down to an issue with CameraX support on our phones but so far have had no luck figuring out what exactly the culprit is. However, LineageOS guidelines require me to ship a fully working Camera app. Therefore I will (temporarily) have to ship the old, feature-less Camera2 instead of Aperture.

    All these changes will be available starting from the next LineageOS builds for A52 and A72, which will most likely be 12th May (A52) and 13th May (A72).

    And as always, please keep reporting bugs and inform me about possible improvements.
    12
    2okPze5.png


    LineageOS is a free, community built, aftermarket firmware distribution of Android 12.1/12L, which is designed to increase performance and reliability over stock Android for your device.
    LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.
    All the source code for LineageOS is available in the LineageOS Github repo. And if you would like to contribute to LineageOS, please visit out Gerrit Code Review. You can also view the Changelog for a full list of changes & features.
    Code:
    /*
    * Your warranty is now void.
    *
    * I am not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed. Please
    * do some research if you have any concerns about features included in this ROM
    * before flashing it! YOU are choosing to make these modifications, and if
    * you point the finger at me for messing up your device, I will laugh at you.
    */

    Supported devices
    All variations of A52 4G and A72 (A525F, A525F/DS, A525M, A525M/DS, A725F, A725F/DS, A725M and A725F/DS) are supported, but only A525F (6/128 variant) is well tested as I have this device.

    Working
    • Audio
    • Wifi
    • Hotspot
    • Calls
    • WifiDisplay
    • Bluetooth
    • OMX
    • Camera
    • NFC
    • Fingerprint
    • Screen-Off-FOD
    • Mobile data
    • GPS
    • DT2W
    • ...

    Bugs
    • VoLTE/VoWIFI (Samsung's implementation doesn't work on AOSP)
    • Audio output in VoIP calls is swapped (WhatsApp, Discord, etc)
    • On some bluetooth Watches/Earphones In-Call sound is played from the phone's speaker/earpiece

    Installation instructions

    Make sure you are on OneUI 5 firmware before flashing this ROM, otherwise the installation will fail!

    Recommended
    Follow the guide on the LineageOS website: A52 4G | A72

    Alternative way (TWRP/OrangeFox)
    1. Make sure your device's bootloader is unlocked.
    2. If not done before, download vbmeta.img from the LineagOS website (A52 | A72) and pack it into a tar file.
    3. Make sure to have the latest available version of TWRP/OrangeFox installed.
    4. If wanted, backup all your necessary partitions (super, boot, data, EFS) before flashing this in case something goes wrong.
    5. Download the lineage build for your device from the link below and optionally download your preferred GApps package too.
    6. Flash the LineageOS zip using the "Install" button.
    7. Optionally, flash Gapps right after.
    8. Format data in TWRP/OrangeFox as the very last thing, otherwise you may end up in a bootloop if coming from stock ROM.
    9. Wipe metadata and cache partitions. This only has to be done once when you install LineageOS.
    10. Reboot

    Downloads
    A52 4G: download.lineageos.org
    A72 4G: download.lineageos.org

    Gapps (choose arm64 and 13.0):
    FlameGapps Canary | NikGapps Canary | MindTheGapps

    Old builds:
    LineageOS 20

    Support
    Donations
    They aren't necessary, but if you like my work feel free to send me or LineageOS a donation.

    Credits
    To...
    • Me, for spending my time on this project
    • Whoever made the VBMeta disabler
    • @Grarak for his fingerprint fix for A70 and DT2W fix
    • @TheLeo2307 for testing on his A72
    • @miamighost for testing on his A52
    • Maybe more, feel free to tell me if I forgot someone

    Source Code: https://github.com/LineageOS/android_kernel_samsung_sm7125
    5
    FAQ

    Can I root my phone with this ROM?
    Yes, just install the latest version of Magisk.

    How can I pass safetynet?
    Follow this guide.

    Automatic camera flash doesnt work!
    That's an issue with Lineage's camera app. Use GCam or any other camera app instead.
    4
    Good news, LineageOS 20 just hit Official!
    The first build for A52 4G was released just this morning, the first A72 build will approximately release tomorrow (Saturday, 21 January).
    This means that there will be no more LineageOS 19.1 builds.

    If you are currently using official 19.1 you should be able to just upgrade to official 20 through Settings -> System -> Updater. If you are currently using unofficial 20 you will have to flash the first official build manually to get OTA's.

    Downloads:
    A52 4G
    A72 (tomorrow)
    4
    Update!

    These will most likely be the last unofficial builds of LineageOS 20 since LineageOS upgraded a lot of their devices officially to 20 yesterday. A52 and A72 haven't been officially moved to 20 yet, but I'm working on it!

    Downloads:
    A52: MEGA
    A72: MEGA

    Changelogs:
    • The camera app (Aperture) now supports using the aux cameras (Ultrawide/Macro/Telephoto)
    • Enabled multiple vibration strength levels
    • Enabled colour modes in settings instead of using LiveDisplay's display modes
    • Better ZRAM management
    • NightLight and ExtraDim are now toggled off/back on when unlocking with fingerprint
    • Support for OneUI 5 firmware
    • OneUI 5 firmware is required now, otherwise installing the ROM will fail