Realtek wifi drivers android

ODROID

Adding RTL8821AU wifi driver to android image.

shaileshswankhede Posts: 9 Joined: Fri Apr 28, 2017 11:58 pm languages_spoken: english ODROIDs: Odroid XU4 Has thanked: 0 Been thanked: 0 Contact:

Adding RTL8821AU wifi driver to android image.

Post by shaileshswankhede » Tue May 02, 2017 3:03 pm

Hi,
I am running CM12.1 (Android version 5.1.1) on odroid xu4. Recently I purchased D-Link DWA-171 wifi adapter.
Running lsusb gives: ID 2001:3314. Wifi chip is rtl8821au..
When looked into kernel source I can’t see driver for rtl8821. For rtl8812au its available, but that wont work.
To fix I got driver source from https://github.com/ulli-kroll/rtl8821au. Compilation of source generated rtl8821au.ko.

Since my board was using 8812au.ko, I simply took backup of this file and replaced it with new rtl8821au.ko and renamed it.
In short it will use new driver. After bootup, through adb shell I am executing: su insmod 8812au.ko.
And then tried to start wifi, but I get below log message:

I/WifiHW ( 3242): got module path /system/lib/modules/8812au.ko
E/WifiStateMachine( 3242): Failed to load driver

How can I load this new driver?

odroid Site Admin Posts: 41254 Joined: Fri Feb 22, 2013 11:14 pm languages_spoken: English, Korean ODROIDs: ODROID Has thanked: 3239 times Been thanked: 1784 times Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by odroid » Tue May 02, 2017 4:34 pm

voodik Posts: 2460 Joined: Sat Dec 07, 2013 2:36 am languages_spoken: armenian, english, russian Location: Armenia Has thanked: 89 times Been thanked: 659 times Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by voodik » Tue May 02, 2017 4:40 pm

For first you can’t use newly comiled module without flashing new kernel. You need push all new modules to /system/lib/modules dir. Then flash new zImage-dtb. After that you can use your module. Just set wlan.modname=rtl8821au

Читайте также:  Проверить загрузку канала wifi

voodik Posts: 2460 Joined: Sat Dec 07, 2013 2:36 am languages_spoken: armenian, english, russian Location: Armenia Has thanked: 89 times Been thanked: 659 times Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by voodik » Tue May 02, 2017 4:45 pm

shaileshswankhede Posts: 9 Joined: Fri Apr 28, 2017 11:58 pm languages_spoken: english ODROIDs: Odroid XU4 Has thanked: 0 Been thanked: 0 Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by shaileshswankhede » Tue May 02, 2017 6:56 pm

Got it now. So I need to compile new kernel source to create zImage-dtb.

I couldn’t see aosp source for los14, only kernel source was available (I need source for some modification in V4L2Camera).
Is it that, I can use same cm12.1 aosp source with los14 kernel source?

shaileshswankhede Posts: 9 Joined: Fri Apr 28, 2017 11:58 pm languages_spoken: english ODROIDs: Odroid XU4 Has thanked: 0 Been thanked: 0 Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by shaileshswankhede » Tue May 02, 2017 8:14 pm

I simply ran make command from Linux host machine.
How do I supposed tp compile it?

odroid Site Admin Posts: 41254 Joined: Fri Feb 22, 2013 11:14 pm languages_spoken: English, Korean ODROIDs: ODROID Has thanked: 3239 times Been thanked: 1784 times Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by odroid » Tue May 02, 2017 10:22 pm

If your host machine is not an ARM PC, you had to use a cross compiler.
x86 binary code can’t run on XU4.

shaileshswankhede Posts: 9 Joined: Fri Apr 28, 2017 11:58 pm languages_spoken: english ODROIDs: Odroid XU4 Has thanked: 0 Been thanked: 0 Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by shaileshswankhede » Wed May 03, 2017 4:01 pm

Yeah correct. Thanks for you help.
I will try to generate module using cross-compiler.

Meanwhile I was trying with new dongle from (Model EW-7811UTC as mentioned on CD)
Driver file for these shows its rtl8812au chip and I can see relevant driver in kernel source.
putting ‘wlan.modname=8812au’ in build.prop should work for this right?
But it doesn’t work.

voodik Posts: 2460 Joined: Sat Dec 07, 2013 2:36 am languages_spoken: armenian, english, russian Location: Armenia Has thanked: 89 times Been thanked: 659 times Contact:

Читайте также:  Адрес усилителя вай фай

Re: Adding RTL8821AU wifi driver to android image.

Post by voodik » Wed May 03, 2017 4:23 pm

shaileshswankhede wrote: Yeah correct. Thanks for you help.
I will try to generate module using cross-compiler.

Meanwhile I was trying with new dongle from (Model EW-7811UTC as mentioned on CD)
Driver file for these shows its rtl8812au chip and I can see relevant driver in kernel source.
putting ‘wlan.modname=8812au’ in build.prop should work for this right?
But it doesn’t work.

shaileshswankhede Posts: 9 Joined: Fri Apr 28, 2017 11:58 pm languages_spoken: english ODROIDs: Odroid XU4 Has thanked: 0 Been thanked: 0 Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by shaileshswankhede » Wed May 03, 2017 4:29 pm

voodik Posts: 2460 Joined: Sat Dec 07, 2013 2:36 am languages_spoken: armenian, english, russian Location: Armenia Has thanked: 89 times Been thanked: 659 times Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by voodik » Wed May 03, 2017 4:38 pm

This Vid/Pid does not included in realtek drivers till now. So you need add it, recompile kernel, upload new modules then flash kernel to get it work.
drivers/net/wireless/rtl8812AU/os_dep/linux/usb_intf.c

After modification you can also build whole android which includes kernel building procedure, make update.zip and update your system.

shaileshswankhede Posts: 9 Joined: Fri Apr 28, 2017 11:58 pm languages_spoken: english ODROIDs: Odroid XU4 Has thanked: 0 Been thanked: 0 Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by shaileshswankhede » Wed May 03, 2017 4:58 pm

shaileshswankhede Posts: 9 Joined: Fri Apr 28, 2017 11:58 pm languages_spoken: english ODROIDs: Odroid XU4 Has thanked: 0 Been thanked: 0 Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by shaileshswankhede » Wed May 03, 2017 7:02 pm

I made update.zip with new generated system.img, userdata.img, cache.img and zImage-dtb.
Genrated correct checksum file and tried updating. However after complete update, in starting kernel stage I get below log:

SMP: failed to stop secondary CPUs

This issue I had faced earlier and couldn’t solve. I guess only zImage-dtb will be need to be flashed here?
How do I flash or fix this update problem?
Will adb sync kernel module work?

FYI this is the last console output of make whole android:

Created filesystem with 2151/65536 inodes and 107356/262144 blocks
Total files: 1626
Total bytes: 399714619
patch 1 is 1547860 bytes (of 861656)
patch 2 is 189 bytes (of 542)
chunk 0: normal ( 0, 4915210) 206
chunk 1: deflate ( 4915210, 3451298) 1547860 (null) (Is this problem?)
chunk 2: normal ( 8366508, 1620) 189
Install system fs image: /home/osboxes/Project/Semapresence/odroid-xu4/out/target/product/odroidxu3/system.img

Читайте также:  Беспроводная связь wi fi скорости

And I copied only system.img, userdata.img, cache.img and zImage-dtb in update folder as I can see in original update zip.
What about other .img file?

voodik Posts: 2460 Joined: Sat Dec 07, 2013 2:36 am languages_spoken: armenian, english, russian Location: Armenia Has thanked: 89 times Been thanked: 659 times Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by voodik » Wed May 03, 2017 7:32 pm

$ repo init -u git://github.com/voodik/android.git -b cm-12.1_5422 $ repo sync $ ./build.sh odroidxu3 Output images location /tmp/odroidxu3/

If your android build successfully finished just generate update.zip bu
./build.sh odroidxu3 update

then find proper update.zip /tmp/odroidxu3/ folder

shaileshswankhede Posts: 9 Joined: Fri Apr 28, 2017 11:58 pm languages_spoken: english ODROIDs: Odroid XU4 Has thanked: 0 Been thanked: 0 Contact:

Re: Adding RTL8821AU wifi driver to android image.

Post by shaileshswankhede » Wed May 03, 2017 10:26 pm

I followed procedure you mentioned and updated image with generated update.zip
But unfortunately still wifi doesn’t start.
Below is the log I am getting now:

D/WifiController( 3246): isAirplaneModeOn = false, isWifiEnabled = true, isScanningAvailable = false I/WifiService( 3246): Registering wifi I/SystemServiceManager( 3246): Starting com.android.server.wifi.WifiScanningService I/WifiScanningService( 3246): Creating wifiscanner I/WifiScanningService( 3246): Starting wifiscanner D/WifiHW ( 3246): Unable to unload driver module "8812au": No such file or directory D/WifiService( 3246): New client listening to asynchronous messages I/WifiService( 3246): WifiService starting up with Wi-Fi enabled D/WifiService( 3246): setWifiEnabled: true pid=3246, uid=1000 E/WifiService( 3246): Invoking mWifiStateMachine.setWifiEnabled D/WifiController( 3246): WifiController msg < when=0 what=155656 target=com.android.internal.util.StateMachine$SmHandler >deferred for 500ms I/WifiScanningService( 3246): Registering wifiscanner D/WifiScanningService( 3246): New client, channel: null messenger: null D/WifiChangeStateMachine( 3246): Entering IdleState D/WifiScanningService( 3246): DefaultState D/WifiController( 3246): DEFERRED_TOGGLE handled I/WifiHW ( 3246): got module path /system/lib/modules/8812au.ko E/WifiMonitor( 3246): killSupplicant p2pfalse init.svc.wpa_supplicant=unknown init.svc.p2p_supplicant=unknown D/WifiMonitor( 3246): startMonitoring(wlan0) with mConnected = false D/WifiScanningService( 3246): SCAN_AVAILABLE : 1 D/WifiScanningService( 3246): DefaultState got < when=-1ms what=160007 target=com.android.internal.util.StateMachine$SmHandler >D/WifiService( 3246): New client listening to asynchronous messages D/WifiService( 3246): New client listening to asynchronous messages D/WifiService( 3246): New client listening to asynchronous messages D/WifiService( 3246): New client listening to asynchronous messages E/WifiHW ( 3246): Supplicant not running, cannot connect E/WifiHW ( 3246): Supplicant not running, cannot connect E/WifiHW ( 3246): Supplicant not running, cannot connect E/WifiHW ( 3246): Supplicant not running, cannot connect

Why it says «8812au»: No such file or directory I don’t know cause 8812au.ko is present in system/lib/modules.
And wlan.modname=8812au is set in system/build.prop

Источник

Оцените статью
Adblock
detector