Samsung Galaxy Tab 4 7.0 (samsung-degaswifi)

This is a port of postmarketOS for the Samsung Galaxy Tab 4 7.0 (degaswifi). While it has been tested on the SM-T230NU, it should theoretically work on the SM-T230 (degas) and the SM-T231 (degas3g)
This port WILL NOT WORK on any other variant of the the Samsung Galaxy Tab 4, like matisselte, matisseve, degaslte etc as these devices either have a Qualcomm Snapdragon or an Exynos processor
== Contributors ==
* Luka Panio (cvbnm90i)
* Vishal B (vishalbala-nps)
== Maintainer(s) ==
* Luka Panio (cvbnm90i)
* Vishal B (vishalbala-nps)
== Users owning this device ==
== Available Boot Modes ==
* Recovery: + + 
* Download mode: + + 
== Flashing Recovery ==
Download a build of TWRP from here. Use the 2.8.0.1 version as later versions crash when performing a factory reset
=== Flashing TWRP using heimdall ===
* Boot the device to download mode
* Run the command: heimdall flash --no-reboot --RECOVERY <PATH_TO_TWRP>.img
* Upon a successful flash, hold the key combinations to boot to Recovery Mode. If all went well, the device should boot into TWRP Recovery
== Installation ==
As of now, pmbootstrap flasher can be used to flash the kernel. Attempting to flash rootfs results in a bootloop. So, the best way to install postmarketOS is using TWRP Recovery. Installing to eMMC has been tested but, SD Card installation should work (untested)
* Ensure you have flashed TWRP on your device. It is highly recommended to take a backup of all your important data as it will all be lost!
* Run the following:pmbootstrap init
** Select the device (samsung-degaswifi) and ensure you choose one of the supported desktop environments (listed below)
* After initializing pmbootstrap, create the zip by running: pmbootstrap install --android-recovery-zip --recovery-install-partition=data
** This installs postmarketOS onto the userdata partition as the system partition is too small.
* After building the zip, export it by running: pmbootstrap export
* Boot the device into recovery mode. Then go to Wipe -> Advanced Wipe and wipe the Cache, Internal Storage and Data Partition. Then go back to the home screen and select Advanced -> ADB Sideload
* Connect the device to your computer and sideload postmarketOS by running: adb sideload /tmp/postmarketOS-export/postmarketOS-export
Once the installation succeeds, Reboot the device and if all went well, the device should boot into postmarketOS
== Supported Desktop Environments ==
LXQT is highly recommended due to performance.
All X11 based desktop environments should work (XFCE, LXQT and Mate have been tested). Wayland based desktop environments (like Gnome, KDE Plasma, Weston) will not work due to lack of KMS and DRM support in the kernel.
Sxmo works, but has a few issues out of the box. See "Using Sxmo on samsung-degaswifi" here for more information. 
Shelli and fbkeyboard do not work and will result in the device hanging at the postmarketOS logo.
== Wifi and Bluetooth ==
This device has a Marvell Avstar 88WL8887 Wifi+Bluetooth combo. Necessary Firmware has been extracted from Stock Android and is available in the firmware-samsung-degaswifi package
Wifi works with decent speed and range. However, connecting to it requires superuser privileges (attempting to add the user to the neccesary group does not seem to work for some reason). Run the following command to connect to Wifi:
sudo nmcli dev wifi connect <SSID> password <PASSWORD>
Bluetooth audio has been tested and works flawlessly. You may need to install additional packages for Bluetooth audio
== Audio ==
Internal Speakers and Microphone work thanks to kernel patches and Alsa UCM config copied over from samsung-goyawifi with some minor modification
Audio output and input from the headphone jack do not work
As of 27/01/2024 on pmos edge, there is a problem due to which pulseaudio keeps crashing and restarting. This is due to an upgrade of musl. You can fix this either by:
1. Removing pulseaudio entirely and replacing it with pipewire (neccesary patches exist in the kernel for pw support)
2. Downgrade musl. Instructions are here
== Camera ==
Both the front and back camera seems to be picked up by downstream kernel
samsung-degaswifi:~$ ls /dev | grep video
video0
video1
However attempting to interact it results in an error:
samsung-degaswifi:~$ v4l2-ctl -d /dev/video1 --set-fmt-video=width=640,height=480,pixelformat=UYVY --stream-mmap --stream-count=1 --stream-to=test.raw
 VIDIOC_REQBUFS returned -1 (Invalid argument)
I assume this is a problem with v4l2 as I am able to use the camera works with stock Android using the postmarketOS downstream kernel
== Mainline Support ==
No mainline support exists for this processor
== Credits ==
Huge thanks to cheadrian for their work on samsung-goyawifi. Many patches (like those for audio and memfd) and configuration (like Alsa UCM, Lightdm and Wifi firmware related) have been copied over from samsung-goyawifi with some minor modification. In case if anyone wishes to work on this device, do check goyawifi's device page and XDA forum post
Also, created by Luke Panio gave me a huge boost in starting this project. While it was never merged, many of the files (especially kernel config) have been copied over from here with some minor modifications to make it work in the latest version of pmbootstrap. Thank you!
== See Also ==
* Kernel (required some minor modifications to add the Wifi and Bluetooth driver): https://github.com/vishalbala-nps/android_kernel_samsung_degas
* User:Lucia-selvlysende for installation notes.