HDMI audio support on Raspberry Pi 4B, Realtek rtl8192eu if_rtwn_usb driver broken

From: Fred Finster via freebsd-arm <freebsd-arm_at_freebsd.org>
Date: Tue, 19 Oct 2021 19:41:51 UTC
2 areas I need help;  1.)  Raspberry Pi 4B HDMI audio

                                    2.)  Software correction of broken 
wifi device driver for Realtek chip RTL8192eu

I get that "Free"BSD does not wish to use binary blobs that Broadcom may 
offer for use in the BCM2711 rev B or rev C chip.  So could someone 
inform or point me to relevant documentation, or work that someone else 
has put effort into.  I will look more over at raspberrypi.org   I do 
thank you for the operation of USB audio (my USB headphones sound great) 
on the raspiberry pi 4B with 8 gigs dram from the FreeBSD 14.0 CURRENT 
October 14, 2021 version.

wget 
https://download.freebsd.org/ftp/snapshots/arm64/aarch64/ISO-IMAGES/14.0/FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20211014-04c91ac48ad-250051.img.xz 
<https://download.freebsd.org/ftp/snapshots/arm64/aarch64/ISO-IMAGES/14.0/FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20211014-04c91ac48ad-250051.img.xz>

I would like to get HDMI audio to work on the Monitor Screen / TV I am 
using.  I understand it has to go through a  Broadcom HDMI chip as a 
data stream and therefore has no documentation released by Broadcom.

FreeBSD raspberry PI 4, 8G sound through HDMI. Is this possible? July 
16, 2021 RaspberryPi forum question 
<https://forums.raspberrypi.com/viewtopic.php?t=315903>

Lots of Raspberry Pi 3 Linux and KODI information with photos 
<https://cromwell-intl.com/open-source/kodi/>

NetBSD evbarm Raspberry Pi information 
<https://wiki.netbsd.org/ports/evbarm/raspberry_pi/>

Gawen Blog, FreeBSD on RaspberryPi 
<https://hauweele.net/~gawen/blog/?p=2590>

on Reddit; Raspberry Pi 4 - No (HDMI) Audio 
<https://www.reddit.com/r/freebsd/comments/jo4yar/raspberry_pi_4_no_hdmi_audio/>

Reddit: Whats your experience running FreeBSD on raspberry Pi 
<https://www.reddit.com/r/freebsd/comments/mpnyck/whats_your_experience_with_freebsd_running_on/>




I wish to mention here that the  Realtek rtl8192eu if_rtwn_usb driver 
broken,  probably in the Chip_power_down function.  I have tested with 
Raspberry Pi 4B and freebsdsrc/sys/dev/rtwn/rtl8192ewith x86_64 computer 
running FreeBSD 13.0.   They can scan and list wifi access points, yet 
they can not connect to that access point.

This data on x86 laptop confirms broken source code in file 
if_rtwn_usb.ko running on x86_64 FreeBSD 13.0.  Therfore not a specific 
to aarch64 raspberr pi 4B compilation.  It's the source code .c ; .h 
files. for chipset power down connection.

   idVendor = 0x2357
   idProduct = 0x0109

 From file r92e_init.c  from source code directory 
freebsdsrc/sys/dev/rtwn/rtl8192e

file:  freebsds/rc/sys/dev/rtwn/rtl8192e/r92e_init.c

function:  r92e_power_off(struct rtwn_softc *sc){

Where do you suggest finding the register layout and software data sheet 
for the Realtek rtl8192eu chip?  Probably NDA and not released by Realtek.


thank you for help with these 2 needs for me.  I welcome your 
suggestions and comments and url links. I probably forgot some other 
data information I should have asked for.

Fred L. Finster  wb7ody

my blog: ghostbsd-arm64.blogspot.com <https://ghostbsd-arm64.blogspot.com>

Telegram Group:  ARM Open-Source

https://t.me/joinchat/ST6N61pnu3Di8zgk 
<https://t.me/joinchat/ST6N61pnu3Di8zgk>

Welcome aboard FreeBSD 13.0 & 14.0 is working on raspberry pi 4b and 
400.. internal wifi does not work, some external usb dongles do work.  
Come help us test FreeBSD now.  GhostBSD Arm64 later
Ghostbsd-arm64.blogpost.com <https://Ghostbsd-arm64.blogpost.com>


pss.  I saw an article on lxer.com about the Broadcom Video Core VI 
driver being update.  Wonder if we can use his efforts for linux to 
update the FreeBSD video driver.

Broadcom VideoCore 6 (VI) ron Raspberrypi.org forums 
<https://forums.raspberrypi.com/viewtopic.php?t=244519>


RaspberryPi forum on Raspi4 hardware , Board index Programming Graphics 
programming,,All about accelerated video on the Raspberry Pi (check my 
notes)? <https://forums.raspberrypi.com/viewtopic.php?f=67&p=1901014>

Very good information and recent entries of October 18, 2021


Toms Hardware article on 4K video drivers update in Linux kernel support 
<https://www.tomshardware.com/news/raspberry-pi-4-4k-linux-kernel-support>

The developer trying to bring support to the Linux kernel, *Maxime 
Ripard,* has revised the DRM of the VC4 for the seventh time and he 
submitted the changes to the public Linux repository. It is unlikely 
that the support will land on the upcoming Linux kernel version 5.15, as 
the DRM cut-off period for this release has ended. However, we could see 
it in the upcoming kernel revisions.

An important thing to note is that 4K 60 Hz support for VC4 is only for 
the HDMI port found on the Raspberry Pi 4 module with BCM2711 SoC, and 
newer variants of the Raspberry Pi platform.