yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
Since I never use the headphone jack, I never tested it. On my beta2 build and nubianprince's build, the phone jack doesn't output audio.

Here is a log from stock code when I plug in a headphone jack

===logcat===

09-05 10:17:11.900 634 1110 V WiredAccessoryManager: Headset UEVENT: {SUBSYSTEM=switch, SEQNUM=4656, ACTION=change, SWITCH_STATE=2, SWITCH_NAME=h2w, DEVPATH=/devices/virtual/switch/h2w}

09-05 10:17:11.900 634 1110 V WiredAccessoryManager: newName=h2w newState=2 headsetState=2 prev headsetState=0

09-05 10:17:11.900 634 1110 I WiredAccessoryManager: MSG_NEW_DEVICE_STATE

09-05 10:17:11.901 634 1110 V i : UEvent : {SUBSYSTEM=switch, SEQNUM=4656, ACTION=change, SWITCH_STATE=2, SWITCH_NAME=h2w, DEVPATH=/devices/virtual/switch/h2w}

09-05 10:17:11.901 634 1110 V i : SWITCH_NAME_MATCH matched

09-05 10:17:11.901 634 634 V WiredAccessoryManager: headsetName: h2w connected

===end===

The above WiredAccessoryManager: Headset UEVENT: never shows up in my build or nubianprince's build. The message comes from the code at WiredAccessoryManager.java.

An example

https://android.googlesource.com/pl...com/android/server/WiredAccessoryManager.java

It seems to rely on uevent so I would look at

device/samsung/msm8916-common/rootdir/etc/ueventd.qcom.rc

Perhaps

/dev/i2c-1 0660 audio audio

needs to have different permissions or we need to add something for a headphone jack?

As for bluetooth audio, I don't have any devices in the house with that functionality so I can't test it at all.

---------- Post added at 01:45 PM ---------- Previous post was at 01:41 PM ----------

From stock 7.1

gt58wifi:/dev $ ls -al i2*

crw------- 1 root root 89, 0 2015-03-05 05:27 i2c-0

crw-rw---- 1 audio audio 89, 1 2015-03-05 05:27 i2c-1

crw------- 1 root root 89, 11 2015-03-05 05:27 i2c-11

crw------- 1 root root 89, 13 2015-03-05 05:27 i2c-13

crw------- 1 root root 89, 2 2015-03-05 05:27 i2c-2

crw------- 1 root root 89, 3 2015-03-05 05:27 i2c-3

crw------- 1 root root 89, 4 2015-03-05 05:27 i2c-4

crw-rw---- 1 media media 89, 5 2015-03-05 05:27 i2c-5

crw------- 1 root root 89, 6 2015-03-05 05:27 i2c-6
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
Thanks already fixed bluetooth in the latest build
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen99:
Just fyi, the op still says 09-03 😅
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
Build 09-03 is what I was using for testing.

BTW, did the bluetooth audio fix have to do with the hal definition in manifest.xml as per

https://github.com/Nubianprince/and...7c6dbf7#diff-29ef6f5c30334151da1bfd924cd8c761

If yes, the changes in the manifest.xml from 16.0 to 17.1 as caused no end of grief. First the vibrator, then the audio 5.0, now the bluetooth.

PS. sm-560nu which shares code recognizes the insertion of the headphone jack, but doesn't play audio out, just silence. I guess whatever changed from 16.0 to 17.1 broke something or a change in the msm8916 repos. Sigh! CORRECTION: sm-560nu does work through headphone jack. I didn't realize the speaker was turned down in volume.

EDIT.

Sept 5 rom shows no sign of WiredAccessoryManager: Headset UEVENT message when headphone jack being plugged in.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
So I adb shell into 350 17.1 and monitor the files at

/sys/devices/virtual/switch/h2w

It does change state when I plug in the headphone jack and disconnect.

# no headphones

gt58wifi:/sys/devices/virtual/switch/h2w $ cat state

0

# plug in headphones

gt58wifi:/sys/devices/virtual/switch/h2w $ cat state

2

# disconnect headphones

gt58wifi:/sys/devices/virtual/switch/h2w $ cat state

0

So it looks like the kernel is detecting the change. Why it's not getting passed up to WiredAccessoryManager via UEVENT is the mystery.

Is the problem in the HAL layer?

Good article describing the functionality. Diagram is from URL below.

https://titanwolf.org/Network/Articles/Article?AID=7ddf020c-221b-458d-89b6-3318e4bfead7#gsc.tab=0
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
I got it working through the headphone jack now. I replaced 17.1 WiredAccessoryManager.java

frameworks/base/services/core/java/com/android/server/WiredAccessoryManager.java

with 16.0 WiredAccessoryManager.java. I can now hear music through the headphone.

I don't know why WiredAccessoryManager.java 17.1 code works for the 560, but not the 350.

I will now try to figure out which line or lines of code needs to be changed just for the 350.

logcat output of it working

09-06 16:21:51.466 677 796 V WiredAccessoryManager: Headset UEVENT: {SUBSYSTEM=switch, SEQNUM=4248, ACTION=change, SWITCH_NAME=h2w, DEVPATH=/devices/virtual/switch/h2w, SWITCH_STATE=2}

09-06 16:21:51.466 677 796 V WiredAccessoryManager: newName=h2w newState=2 headsetState=2 prev headsetState=0

09-06 16:21:51.470 677 796 I WiredAccessoryManager: MSG_NEW_DEVICE_STATE

09-06 16:21:51.473 677 677 V WiredAccessoryManager: headsetName: connected

16.0 code at

https://raw.githubusercontent.com/L...com/android/server/WiredAccessoryManager.java

---------- Post added at 11:12 PM ---------- Previous post was at 10:24 PM ----------

16.0 code was last touched April 15, 2016 for WiredAccessoryManager.java. Since then, only 4 commits have been introduced.

https://github.com/LineageOS/androi...com/android/server/WiredAccessoryManager.java

One of those doesn't work with the 350. It's likley not "Improve error messages for initial switch state."

Will have to look at the other 3 tomorrow. It's probably in the

Use extcon to change hdmi_audio status

commit since that has the most number of changes. I will have to put in a few print statements to see what's getting executed.

OR I can just say screw it, and use the 16.0 WiredAccessoryManager.java code as I spent way too much time troubleshooting all the audio problems for this tablet?

Making one change to WiredAccessoryManager.java results in 10 extra minutes of compile time.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
Thanks, but I already fixed the headphone audio and you are correct I had to revert back to using 16.0 version of WiredAccessoryManager.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen99:
Yay! Everything works! Thank you.

The one thing that seems to be broken is screen stabilization, which I don't expect many people to use.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] vipulkohli:
What is the functionality of that?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen99:
It tries to keep your screen in one place while the phone moves, so you can still read text while walking, or riding the bus.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] vipulkohli:
Where can we download newer build
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen99:
The link in the OP.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
Check the main post
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
What device are you flashing this on?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] MustafaSerdar006:
SM-T350.

I bought the official Samsung store in Turkey.

The device starts up without any issues but when I open TWRP it only shows a black screen.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
This is a somewhat common issue, i had it.

This is one way to fix it.

https://xdaforums.com/showpost.php?p=83488241&postcount=41

But i think retiredtab and nubianprince found a better way, that uses a much smaller file. (people have had issues)
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
Lpedia and I narrowed down the root cause of the BOE, but 2 out of 18 people didn't have success with it. I don't know if it is because they can't follow directions, had the wrong drivers, flashed the wrong partition, have another BOE variant, etc.

It's better to flash the entire rom especially for those who are not advanced or expert users. Even then, there's always risk when you flash a rom. There's daily/weekly posts in various sub-forums of people bricking their tablets for whatever reason.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] MustafaSerdar006:
I tried it and it worked.

Thanks. :)
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] MustafaSerdar006:
The ROM has been installed successfully.

Where can I find the file to root?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
You can get root access with magisk.

Releases · topjohnwu/Magisk

The Magic Mask for Android. Contribute to topjohnwu/Magisk development by creating an account on GitHub.

github.com

Since you have twrp, you can rename Magisk-v22.0.apk to Magisk-v22.0.zip and flash it normally in twrp, and if there is no magisk app installed after, rename it back to Magisk-v22.0.apk and install it like you would any other apk.

Just remember if you want saftynet don't forget to enable magisk hide.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] ahmadbilal505050:
Thanks alot for continuing support this device. Really appreciate you effort. Love you guys❤️

I also wanted to request will you please make an Android 11 based ROM or GS-I support ROM( that gives GS-I compatibility) this device so that we can flash GS-I even if you discontinue support for this device. Please reply😍
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Expro250:
hi, I'm having issues with the wifi connecting but then immediately disconnecting and repeating this cycle.

Is there a fix for this or is it an ongoing issue?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
At first creating roms that supported gsi's was thought to be impossible, and even now it takes a ridiculous amount of work. You can check out retiredtab's lineage OS 17 beta, but I believe there are still issues that are being worked out, and it may be a while before crdroid for this device gets ported.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
🤔I havn't had this issue. Can you send a logcat? Start it, then attempt to connect to a wifi network, then stop the logcat after a couple times of it reconnecting, just so there is not a bunch of stuff after it that is hard to sort through 😅
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Expro250:
I found the issue. I was trying to connect it to my wifi extender but I have the extender set for 5ghz only idk why I turned 2.4ghz back on and it connected perfectly this time
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] ahmadbilal505050:
I

At first, I downloaded this ROM, but was getting random reboots , so I flashed the lineage 17 and used it for 3 weeks almost. The experience was just fine because chrome and YouTube crashed every five minutes and also it has very less customization options, the Bluetooth and the camera also not working. So I flashed this ROM a week before, so far the experience is amazing, not facing any issues, and thank God it has more customizations than lineage
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Techguy777:
Would you recommend this over lineage 17.1? I havent updated in over a year. So what twrp is the best?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Techguy777:
Junk I cant even use this tablet its junk. Its beyond slow and 6.0 is the best for this tablet. Android 6 works fine android 10 junk.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] ahmadbilal505050:
Definitely, because it has minor bugs and lacks customization options. Download the TWRP 3.5 it works best. I tried flashing this ROM throgh other TWRP version but it didn't work.

Install the TWRP 3.5 from the OP.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Techguy777:
What firmware are you on? I can't get this rom to move. I'm on 6 because it's the best
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] ahmadbilal505050:
How do I check firmware version?

If it's build number then it's this QQ3A.200805.001
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] ahmadbilal505050:
Sorry for asking a noob question but wanted to ask you that went you'd prefer to make crdroid instead of evolution X and Havoc os add they have more features and crdroid is also not that popular like these please guide
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Techguy777:
You might have devices with those roms are more popular but really there all just about the exact same thing. What can you do with evolution x or havoc that you can't do with crdroid? The real challenge would be porting one ui 3.1 but this tablet would die there just no way. Lineage 18.1 is pretty good to actually almost as good as one ui 3.1 I have a s10 lite and it was a hard call. Oneui 3.1 has fac3 unlock and the samsung camera which I don't care what people say it's way better than the mod gcams the photos are 48mp vs 12mp
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] ahmadbilal505050:
Thanks😊
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
Hey, found that trying to set selinux to enforcing crashes... Something. Not sure if it's the system UI or the system. I was trying to use ps remote play, and it wasn't working (detected root), and somewhere I read it needed selinux to be enforcing, so I ran setenforce 1, and everything went black. Magisk is supposed to hide that, but for some reason it seems not to be able to. I will grab a logcat next time I am have the chance.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
When you set selinux to enforcing, every rule must be in place otherwise functionality of OS/apps will fail.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
I'm building the Nexus 9 15.1 rom for myself and others to use. It has selinux enforcing enabled. See policies at

android_device_htc_flounder/sepolicy at lineage-15.1 · LineageOS/android_device_htc_flounder

Contribute to LineageOS/android_device_htc_flounder development by creating an account on GitHub.

github.com

Now compare that to what the msm8916 repo has

android_device_samsung_msm8916-common/sepolicy_tmp at lineage-17.1 · Galaxy-MSM8916/android_device_samsung_msm8916-common

Common MSM8916 tree for Samsung devices. Contribute to Galaxy-MSM8916/android_device_samsung_msm8916-common development by creating an account on GitHub.

github.com

and they know about

SELinux is Disabled By Default · Issue #44 · Galaxy-MSM8916/android_device_samsung_msm8916-common

please turn selinux on by default in msm8916

github.com

zakaryan2004 commented on 9 Aug 2020​

We know and it's intended. It will be enforcing later
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
Would there be any way to have no rules and just have the kernel display it as enforcing, just to get certian apps to work? (maybe releasing that and not letting people know would be a bad idea, for actual security reasons 😂)
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
I'm not an expert, but I don't think there is a way to have no rules and selinux enforcing. Of course, you could have possibly have one rule or rules that says allow everything and turn on selinux enforcing.

That would be the equivalent of a firewall rule allowing everything into your home router.

I only use my devices whether I built the rom or not with throwaway email addresses/identites. I don't login to anything, never use banking apps and in 2021 moving away from all things google or big tech related.

If someone steals my device or it's compromised due to the security vulnerabilities, it's not a big deal as there's nothing to connect me to anything important.

BTW, the kernel which the Samsung Tab A/E uses hasn't been updated in 3.5 years as per

Look back to an end-of-life LTS kernel : 3.10

The end of the 3.10 branch is a good opportunity to have a look back at how that worked, and to remind some important rules regarding how to...

wtarreau.blogspot.com

Not to mention all the proprietary blobs that exist in the device with possible security vulnerabilities.

So yes, having selinux enforcing is important, but keep in mind the bigger picture above.

And yes, there are tools which will generate the selinux rules by reading the adb logcat, but do you blindly trust that tool and simply grant everything it recommends?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
Here's the list of all the proprietary files from the msm8916 repo.

android_device_samsung_msm8916-common/proprietary-files.txt at lineage-17.1 · Galaxy-MSM8916/android_device_samsung_msm8916-common

Common MSM8916 tree for Samsung devices. Contribute to Galaxy-MSM8916/android_device_samsung_msm8916-common development by creating an account on GitHub.

github.com

I would be worried about all the proprietary blobs that have external functionality like bluetooth, lte and wifi which could be compromised because they have no possibility of being updated.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
I would attempt to implement this, but currently the device trees on nubianprince's github are unable to build because there are files missing (I assume he is refactoring everything, or atleast that is what the commits look like).
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
If you are talking about writing selinux policies, here are 2 tools that I investigated.

1. adb pull /sys/fs/selinux/policy && adb logcat -b all -d | audit2allow -p policy

2. https://github.com/SebaUbuntu/selinux-denial-fixer
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
the difficult part with selinux enforcing is getting the sepolicy done right if you remove androidboot.selinux=permissive this is most likely result in the ROM not booting
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
I've done a small bit of research. Google recommends working in permissive mode until you at least have all the permissions for the files to boot the OS set up. 1 because indefinatly bootlooping is no fun, and 2 because denials get suppressed in the log with it enforcing. I think this is a very good idea 😂. Retiredtab, I had seen audit2allow on the android docs, and it looks very useful in assisting with what needs to access what, but could not get it to work because of the currently not working device trees 😆. I should just go figure out how roll back commits and exclude it from syncing for now. I have not seen selinux-denial-fixer, I will have to check it out! Thank you!
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
If you are using nubianprince's repo and trying to build Android 10, there shouldn't be a problem since there are no recent commits. If you are trying to build 11, that's a different story since there's constant changes made by him.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
This is a great find saved me A LOT of time, i was doing this fixes manually, with this i was able to make the selinux denial fixes in no time
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] retiredtab:
More info here.

Validating SELinux | Android Open Source Project

source.android.com

Just remember the caveat about blindly granting everything the tool suggests as per (from above URL)

=== snip ===

Nevertheless, care must be taken to examine each potential addition for overreaching permissions. For example, feeding audit2allow the rmt_storage denial shown earlier results in the following suggested SELinux policy statement:

#============= shell ==============
allow shell kernel:security setenforce;
#============= rmt ==============
allow rmt kmem_device:chr_file { read write };

This would grant rmt the ability to write kernel memory, a glaring security hole. Often the audit2allow statements are only a starting point.

=== end snip ===
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
i've been reading these the past few weeks, the goal is to try selinux enforcing to work, ive spent most of the week woking on getting HW encryption to work and I think I got that working
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] vsguru:
@nubianprince Are there going to be any further security patches?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
I just haven't had much time to work on any new builds, will work on one this wekend
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
New build uploaded with April security patches
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] vsguru:
Thank you for the quick reply and new build!
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Nomad3512:
While I have used custom ROMs before I am really very inexperienced at this.

I have a T350 that I rooted and installed TWRP_3.5.0_9_SM-T350_Unofficial that I got from this forum.

I then tried to flash crDroidAndroid-10.0-20210411-gt58wifi-v6.16.zip. When I rebooted after TWRP finished the crDroid logo came up and never went away. I let it run overnight just to see what might happen.

I was able to get back into TWRP (first had to go to download mode) and then tried to flash crDroidAndroid-9.0-20200125-gt58wifi-v5.11.zip. I have the same issue albeit the logo was now in color.

Since I can get to download mode with a bit of playing I can reflash the stock 7.1.1 and go through rooting again, but I'd rather not if possible.

Does anyone have some suggestions that I could try before I go back to stock?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Nomad3512:
Sorry but I switched the order I tried flashing. I tried Android 9 first and then 10. I guess this is not a good way to introduce myself to the form, by being sloppy.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Nomad3512:
As an experiment outside of what I intended to do, I tried the Evervol ROM ev_gt58wifi-11-userbuild-2021.04.01-0114.zip and the result was the same. I get stuck ot the logo. Note that I downloaded this ROM while I was in TWRP.

My conclusion is that it is my device causing the problem. Possibly something I did while rooting stock 7.1.1.

So I am going to reflash 7.1.1 and start again.

However, I would appreciate any suggestions as to what could cause this behavior.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
Did you follow the instructions in the main post?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] Nomad3512:
Yes, I did follow the instructions, which were clear.

However, I have been able to install EverVol 11 and then crDroid 10 over it. What I did was AFTER I flashed the ROM using TWRP I cleared the cache again. I also installed Gapps on crDroid when I succeeded installing it.

So, my status is CrDroid is installed with Gapps. My problem now is the system is unstable. WiFi is VERY slow and then eventually it crashes while installing apps.

I am going to to work on it some more and see what I can figure out.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
The camera seems to be completely broken on the latest build... It also logs a bunch of Bluetooth errors (a missing .so) but it still seems to work correctly. Safetynet also just gives an "API error" but I don't know if that's just on my end. Running top also says hatt mm-camera-daemon is taking 97% of the CPU.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
Is this a clean Flash?
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] lividhen:
It was a dirty flash. I have not had the time to try a clean one yet.
[Samsung Galaxy Tab A series ROMs, Kernels, Recover] nubianprince:
I will take a look at the current build today