yashsingh1/xdaforums huggingface dataset:
[Raspberry Pi Original Development] JohnMolton94:
Thanks, an update:

I did the following:

- Modified defconfig to have CONFIG_SND_SOC_WM8960=y

- Built the kernel

- Mounted sdcard on my computer, and went into the boot/ folder on sdcard. Pasted my built kernel "Image" file there, replacing the older one. Also replaced overlays/ inside boot/ with the overlays/ that were generated inside 'out/common/arch/arm64/boot' (will refer to this as "kernel build folder" here-after). Next, I also replaced the bcm-*.dtb files inside of sdcard/boot with the files that were generated inside the "kernel build folder".

- Finally, I updated sdcard/boot/config.txt to include the following: dtoverlay=wm8960-soundcard

config.txt:

# Kernel
arm_64bit=1
kernel=Image

# Ramdisk
gpio=21=ip,pu
[gpio21=1]
initramfs ramdisk.img followkernel
[gpio21=0]
initramfs ramdisk-recovery.img followkernel
[all]

# Audio
dtparam=audio=on

# Audio DAC
dtoverlay=hifiberry-amp

# Boot device
dtoverlay=android-sdcard
#dtoverlay=android-usb

# Camera
camera_auto_detect=1
start_x=1

# Display
disable_overscan=1

# Display panel
[gpio21=1]
#dtoverlay=cutiepi-panel
#dtoverlay=vc4-kms-dsi-7inch
#dtoverlay=vc4-kms-dsi-lt070me05000
#dtoverlay=vc4-kms-dsi-lt070me05000-v2
[all]
#dtoverlay=rpi-backlight

# Fan
#dtoverlay=gpio-fan
#dtoverlay=i2c-fan
#dtoverlay=rpi-poe
#dtoverlay=rpi-poe-plus

# Graphics acceleration
[gpio21=1]
dtoverlay=vc4-kms-v3d
dtoverlay=cma,cma-512
[all]

# I2C
dtparam=i2c_arm=on

# I2S
dtparam=i2s=on

# IR
#dtoverlay=gpio-ir,gpio_pin=18

# Keys
#dtoverlay=gpio-key,gpio=21,keycode=116,label="POWER"
#dtoverlay=gpio-key,gpio=26,keycode=115,label="VOLUME_UP"
#dtoverlay=gpio-key,gpio=20,keycode=114,label="VOLUME_DOWN"

# Overclock
over_voltage=3
arm_freq=1800

# RTC
#dtoverlay=i2c-rtc,ds3231

# Sensors
#dtoverlay=android-i2c-sensor,mpu6050

# Serial console
enable_uart=1

# Sound Card
dtoverlay=wm8960-soundcard

# SPI
dtparam=spi=on

# Touchscreen
#dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
#dtoverlay=edt-ft5406
#dtoverlay=goodix
#dtoverlay=rpi-ft5406

# USB
dtoverlay=dwc2,dr_mode=peripheral
[cm4]
dtoverlay=dwc2,dr_mode=otg
[all]

include config_user.txt

I put the sdcard back into the raspberry pi 4, and booted successfully. But, I couldn't find the option for wm8960 anywhere.

I also checked cat /proc/asound/cards, but I don't think I saw the card listed.

cat command output:

0 [Headphones ]: bcm2835_headpho - bcm2835 Headphones
bcm2835 Headphones
1 [vc4hdmi0 ]: vc4-hdmi - vc4-hdmi-0
vc4-hdmi-0
2 [vc4hdmi1 ]: vc4-hdmi - vc4-hdmi-1
vc4-hdmi-1

Am I missing another crucial step here?
[Raspberry Pi Original Development] Slluxx:
My (

wired

) Nintendo Switch controller does get recognized but i cant click anything.

Spoiler content hidden.

Spoiler content hidden.

Spoiler content hidden.

Spoiler content hidden.

Spoiler content hidden.

Ive tried to use a different keyboard layout file too but to no avail. My stupid 2€ mouse gets recognized just fine. I am pulling my hair out on this one.
[Raspberry Pi Original Development] KonstaT:
You can't have two I2S DAC drivers loaded at the same time. You already have 'dtoverlay=hifiberry-amp' under 'Audio DAC' section (probably because you've enabled the DAC option Raspberry Pi Settings menu). Comment it out first. If your DAC still doesn't appear as an ALSA device check 'dmesg' output for any possible related error messages.

List of supported DACs in Raspberry Pi Settings menu is hardcoded so nothing is going to appear there.
[Raspberry Pi Original Development] KonstaT:
It probably requires a separate kernel driver that is not currently enabled in my builds (https://github.com/raspberry-vanill.../arm64/configs/lineageos_rpi4_defconfig#L4486).
[Raspberry Pi Original Development] Slluxx:
Is that something you can enable? Id love to have proper gamepad support, as the pi could be a fantastic cloud streaming device
[Raspberry Pi Original Development] JohnMolton94:
Attached updated boot/config.txt, and related dmesg log file. I don't think I was able to spot any wm8960 related error, or even a mention of it in dmesg.

Looking at https://github.com/waveshare/WM8960-Audio-HAT/blob/master/install.sh, do you think we need to do any other steps to start seeing this card as an ALSA device?

I have heard people mentioning https://github.com/waveshare/WM8960-Audio-HAT/blob/master/wm8960_asound.state and https://github.com/waveshare/WM8960-Audio-HAT/blob/master/asound.conf in a lot of threads, but I am unsure if I need to do anything special there.

Dmesg log (Couldn't attach log file for some reason, posting log here):

Spoiler content hidden.
[Raspberry Pi Original Development] KonstaT:
Already did so it will enabled if/when there's another release. IDK if it will fix this as I don't have the hardware to test. Meanwhile you could compile the kernel yourself (https://github.com/raspberry-vanilla/android_kernel_manifest/tree/android-13.0) with the driver enabled.

config.txt looks fine but you can drop the 'dtoverlay=i2s-mmap' as that does nothing on any recent kernel version.

The device also uses simple sound card driver (https://github.com/raspberry-vanill...dts/overlays/wm8960-soundcard-overlay.dts#L46) and you would need to enable that as well (https://github.com/raspberry-vanill.../arm64/configs/lineageos_rpi4_defconfig#L4407). Sorry, missed that earlier as I assumed it was already enabled.

Android is not your regular Linux distribution so the Waveshare documentation is really not relevant here.
[Raspberry Pi Original Development] KonstaT:
Well done!

I would assume it should work just by enabling the defconfig options without any need to modify the drivers. Drivers on the upstream kernel are probably more up-to-date than what Waveshare is offering.

You can't add them as an option to Raspberry Pi settings but I could eventually. There's few other DACs that are supported but not listed in the menu as well. I haven't gotten around adding them there.
[Raspberry Pi Original Development] JohnMolton94:
Thank you!

I had to modify the drivers and use Waveshare's because the existing drivers were erroring when trying to play sound via tinyplay. I think Waveshare have more recent changes to their wm8960.c file (Something related to the simple-audio-card not being able to dynamically determine the clock reliably). I just took a shot in the dark by trying to include their drivers and glad it worked out :)

Question:

In my previous message, I mention changing the wm8960 device settings via tinymix. Is there a way I can save these settings so that they persist after reboot? Otherwise my wm8960 device volume goes back to zero, and a couple other mixer settings get turned off back again...
[Raspberry Pi Original Development] KonstaT:
I would still assume it works by just enabling the defconfig options since it was merged to upstream Raspberry Pi kernel. SND_SIMPLE_CARD and SND_SIMPLE_CARD are now enabled in the kernel of the latest LineageOS 20 release (20230814). I doubt I'll include any modifications to the codec drivers as those should be submitted to the upstream Pi kernel.

You could add a script to /vendor/etc/init.d/ to be executed on boot. There's already few there you can use as a reference. Make sure your script is executable (755 permissions). I would assume no additional mixer configuration is needed with the default driver.
[Raspberry Pi Original Development] optodoxie:
Hi, is it possible to get the Waveshare 10.1inch DSI LCD Display (SKU: 23450) to work ?

I tried the 6.1-kernel add-on but screen keeps black / powered off.
[Raspberry Pi Original Development] KonstaT:
Yes, the Waveshare 10.1" DSI display has been reported working by couple of users.

Support for Waveshare DSI display was added in 6.1 kernel a while back (https://github.com/lineage-rpi/android_kernel_brcm_rpi/issues/32). It should work after installing Linux 6.1 kernel add-on, adding 'dtoverlay=vc4-kms-dsi-waveshare-panel,10_1_inch' to /boot/config.txt, and removing /boot/resolution.txt.
[Raspberry Pi Original Development] JohnMolton94:
Hi Konsta,

Which of the following screens do you think has a better chance of working with your build (with all of the screens' intended features)?

- https://www.waveshare.com/wiki/8DP-CAPLCD

- https://www.waveshare.com/wiki/8inch_DSI_LCD_(C)

If the DSI version can work, it would be great, because I am planning to create a CM4 board down the road once I get my hands on it, and the DSI one seems to be better suited for that.

I'll be able order one of these screens based on the information I receive.

Does https://github.com/lineage-rpi/android_kernel_brcm_rpi/issues/32 indicate that the DSI screen will work? And does anything special needs to be done for brightness control?
[Raspberry Pi Original Development] KonstaT:
Both should work but since I don't have the hardware I can't be completely sure or make any recommendations.

Waveshare DSI displays should work with Linux 6.1 kernel where they recently added open source driver to support them. AFAICT there's no support for backlight control with the open source driver. My Android lights HAL (to control backlight from the UI brightness slider) also only supports the backlight path used by the driver for the official Raspberry 7" DSI display but it's trivial to add support for other drivers/backlight paths if/when available.

There's nothing Android side for controlling backlight on HDMI displays either, but at least that one should have an OSD menu where you can change the brightness.
[Raspberry Pi Original Development] JohnMolton94:
Thanks, I'll research a bit more and get back on this.

Meanwhile, I have with me the following display from Wisecoco:

https://www.aliexpress.us/item/1005005282034474.html

I saw a comment from you on a thread stating that the screen needs to have EDID reporting to work with your build. So I looked at https://learn.adafruit.com/using-weird-displays-with-raspberry-pi, and made some changes to my config.txt

Edid data of the wisecoco display attached (display works with my macbook air m1, data captured from it).

Based on the data, I updated my config to txt to include:

# Wisecoco

hdmi_force_hotplug=1

hdmi_group=2

hdmi_mode=87

hdmi_force_mode=1

hdmi_drive=1

#hdmi_timings=1920 0 88 44 148 1080 0 4 5 36 0 0 0 60 0 148500000 3

hdmi_timings=1920 0 60 20 80 1080 0 4 2 20 0 0 0 60 0 148000000 3

With both of the timings seen here, I could see the raspberry pi multicolored screen for a second, where the display was detected (before this config that detection wasn't happening).

But then, the screen remains black. Raspberry pi 4 is successfully booted as ssh/adb works.

Is it possible to get such a screen working with this build with anything I can do on my end?
[Raspberry Pi Original Development] KonstaT:
hdmi_* options in config.txt have no effect with KMS driver that is used with hw accelerated graphics on Android builds. This also applies to latest Raspberry Pi OS Bullseye images that have switched to using KMS by default vs. fake/firmware FKMS used by default in Pi OS Buster and before.

EDID shows that it reports 1920x1080 as supported so this should work without any modifications. You can also try removing /boot/resolution.txt as suggested in the relevant FAQ section if it makes any difference. In any case, impossible to say without seeing any logs.

If the display doesn't report EDID/reports faulty EDID, you can try appending /boot/cmdline.txt with e.g. 'drm_kms_helper.edid_firmware=edid/1920x1080.bin' to use of the EDIDs included in the kernel (https://github.com/lineage-rpi/android_device_brcm_rpi4/issues/4#issuecomment-984084521).
[Raspberry Pi Original Development] JohnMolton94:
Display works now! Thanks a ton!

Steps:

- removed /boot/resolution.txt

- appended /boot/cmdline.txt with 'drm_kms_helper.edid_firmware=edid/1920x1080.bin'

This is a USB touchscreen, but the touch doesn't seem to be working out of the box. Any changes that I should make on my end? Thanks!
[Raspberry Pi Original Development] KonstaT:
Did you check logs as for why it's not working without specifying the EDID firmware?

You might need to add IDC file (https://source.android.com/docs/core/interaction/input/input-device-configuration-files) for your USB touchscreens. Use 'lsusb' or 'dmesg' output from plugging in the USB to get the vendor/product ids. There are already similar configs for other USB touchscreen so see files in /vendor/usr/idc/ for reference. E.g. some USB touchscreens claim to report pressure but in reality don't and need to disable the pressure. Some work as mouse by default and need to be configured as touchscreen.
[Raspberry Pi Original Development] JohnMolton94:
-> Did you check logs as for why it's not working without specifying the EDID firmware?

- I was unable to get these logs, I believe the pi was getting hung/blocked and the ssh connection would break. It would only get back once the offending screen was removed and the pi rebooted. So I couldn't exactly obtain the logs at that time..

Plugging in the usb touchscreen adds the following to dmesg. Not sure how to interpret it though:

[ 510.420415] usb 1-1.2: new high-speed USB device number 5 using xhci_hcd
[ 510.481394] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "HDMI-A-1"
[ 510.493692] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "HDMI-A-1"
[ 510.524858] usb 1-1.2: New USB device found, idVendor=1a40, idProduct=0801, bcdDevice= 1.00
[ 510.533360] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 510.540885] usb 1-1.2: Product: USB 2.0 Hub
[ 510.558662] hub 1-1.2:1.0: USB hub found
[ 510.562990] hub 1-1.2:1.0: 4 ports detected
[ 510.876462] usb 1-1.2.1: new full-speed USB device number 6 using xhci_hcd
[ 510.991733] usb 1-1.2.1: New USB device found, idVendor=eeef, idProduct=2828, bcdDevice= 0.00
[ 511.000400] usb 1-1.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 511.007996] usb 1-1.2.1: Product: MTouch
[ 511.011974] usb 1-1.2.1: Manufacturer: TSTP
[ 511.016219] usb 1-1.2.1: SerialNumber: CMTP_1.0
[ 511.033300] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.038935] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.044543] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.050063] usbhid 1-1.2.1:1.0: can't add hid device: -71
[ 511.055610] usbhid: probe of 1-1.2.1:1.0 failed with error -71
[ 511.061748] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.067949] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.073696] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.079320] usb 1-1.2: clear tt 1 (0040) error -71
[ 511.085059] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.093454] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.099059] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.104561] usbhid 1-1.2.1:1.1: can't add hid device: -71
[ 511.110136] usbhid: probe of 1-1.2.1:1.1 failed with error -71
[ 511.116093] usb 1-1.2: clear tt 1 (8040) error -71
[ 511.222705] usb 1-1.2: USB disconnect, device number 5
[ 511.227948] usb 1-1.2.1: USB disconnect, device number 6
[ 511.234900] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "HDMI-A-1"
[ 511.246125] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "HDMI-A-1"
[ 511.657958] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "HDMI-A-1"
[Raspberry Pi Original Development] KonstaT:
At least you get the vendor/product ids (eeef:2828) for the touchscreen from that.

Doesn't look exactly healthy otherwise. Could be a power issue. Make sure to use external power source for the display as USB port on the Pi probably can't output enough to power the display/touchscreen.
[Raspberry Pi Original Development] JohnMolton94:
I made a super silly mistake, apologies!

The touchscreen works as intended, cannot believe I was using the wrong usb port and expecting touch to work. The wisecoco demo video pointed to the incorrect port on the board mistakenly, and I went with it.

Now that the display works as intended, I have two other milestones, and will appreciate any input about the feasibility/best way to implement those:

- Control the screen brightness via the UI slider

- Implement a lock screen(screen-off)/device low-power mode with this build

I scoured the internet and was really disappointed to find out that the pi-4 doesn't have any sleep/low-power mode! This can entirely break my use case of making a battery efficient portable pi.

Is there anyway to implement a lock device mode where the pi sips as low of a current as it can? If so, what current draw can we expect from it in that mode?
[Raspberry Pi Original Development] steelbrain:
I have a question re I2C address conflicts. I have a MPU 6050 (without address change capability) and a DS3231. Both insist on using 0x68 for i2c so I got a i2c mux from Adafruit PCA9546A. Is there a way I can make the mux work with the ROM?

Thank you for your work!
[Raspberry Pi Original Development] fernandocneves:
Hi Konstat, i'm very happy with your build for AOSP 13, i just made some improvements in config files to make BlueTooth + GPS Module (NEO 6M) to work togheter without any incompatibility.

So what I did:

First => changing Bluetooth to ttyAMA0

Then => changing NEO 6M - GPS to ttyS0

Setting in cmdline.txt to this code:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/ram0 rootwait androidboot.hardware=rpi4 androidboot.selinux=permissive rootfstype=ext4 elevator=deadline fsck.repair=yes quiet splash plymouth.ignore-serial-consoles

Whats make a difference was to set console=tty1

I will upload my config files with all nescessary changes:

I hope everyone with this GPS Module can make like me to work without any issues.

Best regards,

Fernando.
[Raspberry Pi Original Development] KonstaT:
https://twitter.com/i/web/status/1709942614827639195
[Raspberry Pi Original Development] Neo89_23:
How to rotate screen to landscape?

Hi, I have 400x1280 display. I have add edid firmware to /lib/firmware/edid and add drm_kms_helper.edid_firmware=edid/your_edid.bin to cmdline.txt. The display is worked, but I cannot rotate screen to landscape. I have try change Raspberry pi settings -> Display rotate 90 (screen is rotated but apps ui show wrong), add fbcon=rotate:3 to cmdline.txt, add lcd_rotate=1 to config.txt, but not work.

How I can change screen oriental to landscape with this display?
[Raspberry Pi Original Development] KonstaT:
Sorry, I don't have experience with I2C multiplexers. Maybe one these kernel drivers (https://github.com/raspberry-vanill.../configs/lineageos_rpi4_defconfig#L2694-L2695) works with the hardware but you would need to compile the kernel to enable the driver at least (https://github.com/raspberry-vanilla/android_kernel_manifest/tree/android-13.0).

Well done. With recent AOSP14 and LineageOS 20 (Android 13) builds I've switched to btlinux bluetooth stack so bt doesn't occupy ttyAMA0 anymore.

I think the key is to move the serial console to ttyS1 (like you've done in config.txt and cmdline.txt) and set the GPS HAL to use ttyS0 (it's just one line in /vendor/build.prop).

You would rotate the display by using the option in Raspberry Pi settings. There's no other way that I'm aware of.

How does it "show wrong" exactly? As this is a long/narrow display I would assume it looks similar to if you'd rotate your phone sideways (i.e. navigation bar is still on the right side of the display). Screen density setting might have some effect on this as well (Settings -> Display -> Display size).
[Raspberry Pi Original Development] crpig:
Hi Konsta,

In this build, encoder 'c2.v4l2.avc.encoder' cannot work with scrcpy over adb.

I can only use the 'OMX.google.h264.encoder' which is so slowly.

Do you have any idea about how to enable hardware encoder for scrcpy?

BTW, thank you for your amazing work!
[Raspberry Pi Original Development] KonstaT:
Logcat? Could be for numerous different reasons. Last time I tried test scrcpy I couldn't even get it running on Linux.

My builds also have a built-in VNC server you can use for remote access.
[Raspberry Pi Original Development] crpig:
Hi Konsta,

Thank you for your reply.

1. Here is the logcat log.

issue happened here:

01-01 02:26:01.638 0 0 E : bcm2835-codec bcm2835-codec: bcm2835_codec_start_streaming: Failed enabling i/p port, ret -3

11-05 12:32:46.532 3724 3752 D CCodec : Component "c2.v4l2.avc.encoder" returned error: 0xe

2. Does the vnc server using hardware or software encoding?

I tried the vnc server on your LineageOS build before(maybe LineagesOS 17.1?), it seems also slowly.
[Raspberry Pi Original Development] KonstaT:
It crashes on kernel side which is a bit unexpected. Maybe the encoder tries to use wrong pixel format but it's not apparent in the log. Is this from your own Raspberry Vanilla build BTW (5.15.131-v8-g41e890d4dfe0-dirty kernel is not mine)? Automotive? In that case Raspberry Vanilla issue tracker in GitHub would be the correct place to discuss this.

VNC is a pixel based protocol so it doesn't use video encoding.
[Raspberry Pi Original Development] fernandocneves:
I'm using your AOSP Android 14 Final version release. To manage Bluetooth + GPS (Serial from UBlox NEO 6M) to work without issues (Both at same time), I used the same way with Bluetooth in ttyAMA0 and GPS in ttyS0, works like a charm. You can use the same files that I had configured for Android 13 AOSP (KonstaKang's Version). I used your Fix (Wi-Fi authentication issue) that you provide in your website with TWRP and it's simple works. Many thanks Konsta, your AOSP for Raspberry Pi 4B is amazing, no bugs at all till now.

Best regards,

Fernando.
[Raspberry Pi Original Development] mikpel:
Quite amazing to see raspi 4 to boot straight into Android without any hassle after just flashing the image on sd card. Super cool work!!

I have another raspi 4 lying around so I was just wandering is it possible to change the serial number somehow so that I could have both devices attached to same computer by usb? How does the ro.boot.serialno and ro.serialno get their values?
[Raspberry Pi Original Development] KonstaT:
You can find the AOSP14 topic here:

[DEV][ROM] AOSP (Android 14) for Raspberry Pi 4 B

Here’s my build of AOSP (Android 14) for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4. It’s for advanced users only. Pi 4 model with at least 2GB of RAM is required to run this build. Important! Raspberry Pi hardware specific...

xdaforums.com

Wouldn't the devices specifically need to have different serials for that (I'm thinking ADB at least)? Also take note that 0.5A you get from a regular USB port is not sufficient for providing enough power for the Pi (you would need powered USB-C hub, 5V on the GPIO, etc).

The flow is from the actual serial number on the hardware -> kernel device tree by the boot firmware -> device tree to ro.boot.serialno on cmdline (https://github.com/raspberry-vanill...mmit/c58477f23ba3a36e987c63ce260c5a81fe4aba75) -> Android init from ro.boot.serialno to ro.serialno (https://cs.android.com/android/plat...tform/superproject/main:system/core/&start=21).
[Raspberry Pi Original Development] mikpel:
Thanks a lot for the clarification. So because it's actual unique serial of the HW I should be able to connect two or more devices to a single pc at the same time as far as I have active usb hub providing enough power. Somehow I thought the serial number is just hardcoded somewhere :)