Jump to content

V40/R40 Boards


Subair

Recommended Posts

Hello, following the steps to add audio support to h3, v3s, a23 modified sun4i-codec to add support for r40, and if anyone else wants to try:

 

Video

 

curl -s https://raw.githubusercontent.com/juanesf/codec/master/compile-codec.sh | sudo bash /dev/stdin

 

Link to comment
Share on other sites

On 6/17/2020 at 7:51 AM, JuanEsf said:

Hello, following the steps to add audio support to h3, v3s, a23 modified sun4i-codec to add support for r40, and if anyone else wants to try:

 

Video

 


curl -s https://raw.githubusercontent.com/juanesf/codec/master/compile-codec.sh | sudo bash /dev/stdin

 

If you could provide this as patches for Armbian to include into the building process it would be appreciated :beer:

Link to comment
Share on other sites

On 6/17/2020 at 8:51 AM, JuanEsf said:

Hello, following the steps to add audio support to h3, v3s, a23 modified sun4i-codec to add support for r40, and if anyone else wants to try

 

I did try it on my BPI M2Berry. Compile went Ok after installing the kernel-headers,

but after modprobe sun4i-codec I only got the following dmesgs:
 

Quote

[  135.129196] sun4i_codec: loading out-of-tree module taints kernel.
[  135.129577] sun4i_codec: module verification failed: signature and/or required key missing - tainting kernel

 


root@bpi-m2-berry(192.168.6.20):/lib/modules/5.6.16-sunxi/kernel/sound/soc/sunxi# ls -l
total 200
-rw-r--r-- 1 root root 32493 Jun 10 13:17 ac100-codec.ko
-rw-r--r-- 1 root root 50840 Jun 18 21:24 sun4i-codec.ko
-rw-r--r-- 1 root root 23913 Jun 10 13:17 sun4i-i2s.ko
-rw-r--r-- 1 root root 12881 Jun 10 13:17 sun4i-spdif.ko
-rw-r--r-- 1 root root  5389 Jun 10 13:17 sun8i-adda-pr-regmap.ko
-rw-r--r-- 1 root root 25924 Jun 18 21:24 sun8i-codec-analog.ko
-rw-r--r-- 1 root root 40881 Jun 10 13:17 sun8i-codec.ko
root@bpi-m2-berry(192.168.6.20):/lib/modules/5.6.16-sunxi/kernel/sound/soc/sunxi# uname -a
Linux bpi-m2-berry 5.6.16-sunxi #20.05.3 SMP Wed Jun 10 12:17:59 CEST 2020 armv7l GNU/Linux


root@bpi-m2-berry(192.168.6.20):~# lsmod|grep codec
sun8i_codec_analog     24576  0
sun8i_adda_pr_regmap    16384  1 sun8i_codec_analog
sun4i_codec            36864  0
snd_soc_hdmi_codec     20480  0
snd_soc_core          126976  3 sun4i_codec,sun8i_codec_analog,snd_soc_hdmi_codec
snd_pcm                73728  4 sun4i_codec,snd_pcm_dmaengine,snd_soc_hdmi_codec,snd_soc_core
snd                    49152  4 snd_soc_hdmi_codec,snd_timer,snd_soc_core,snd_pcm

root@bpi-m2-berry(192.168.6.20):~# aplay -l
aplay: device_list:272: no soundcards found...
 

 

Is there a difference for the R40/V40 CPU?
Because I think I have a "early" BPI M2Berry which hasnt the CPU which is normally on the board.

But as I did read the are compatible and differ only in work-temperatures?

Link to comment
Share on other sites

what happens is this is just the module, for them to work you need to add the codec node to sun8i-r40.dts and sun8i-r40-bananapi-m2-ultra.dts, just give me a few hours to fix some details and give you details how to compile u-boot with changes

Link to comment
Share on other sites

Compile Codec for R40/V40:

curl -s https://raw.githubusercontent.com/juanesf/codec/master/compile-codec.sh | sudo bash /dev/stdin

Compile u-boot for R40 emmc (M2-Ultra):

curl -s https://raw.githubusercontent.com/juanesf/u-boot/audio-codec/compile_u-boot_r40_emmc.sh | sudo bash /dev/stdin

Compile u-boot for R40 sd (M2-Ultra):

curl -s https://raw.githubusercontent.com/juanesf/u-boot/audio-codec/compile_u-boot_r40_sd.sh | sudo bash /dev/stdin

Compile u-boot for V40 emmc (M2-Berry):

curl -s https://raw.githubusercontent.com/juanesf/u-boot/audio-codec/compile_u-boot_v40_emmc.sh | sudo bash /dev/stdin

Compile u-boot for V40 sd (M2-Berry)

curl -s https://raw.githubusercontent.com/juanesf/u-boot/audio-codec/compile_u-boot_v40_sd.sh | sudo bash /dev/stdin

 

it only remains to add two lines to /etc/rc.local before exit 0:

 

modprobe sun8i-codec-analog

modprobe sun4i-codec

 

sudo nano /etc/rc.local

 

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

modprobe sun8i-codec-analog
modprobe sun4i-codec

exit 0

 

Link to comment
Share on other sites

Quote

gives me a 404 - not found
Or do you need more time - because you wrote

"just give me a few hours to fix some details"?

Here is no audio-codec directory:
https://github.com/juanesf/u-boot

Do you got the part to ad to the .dts/.dtb?
I did such a ad job also for my NanoPi A64 or NanoPi Neo PCM5102A-I2S Soundboard :)

Link to comment
Share on other sites

I tested

curl -s https://raw.githubusercontent.com/juanesf/u-boot/audio-codec/compile_u-boot_v40_sd.sh | sudo bash /dev/stdin

but at the end of the script I did get
 

 BINMAN  u-boot-sunxi-with-spl.bin
  CFGCHK  u-boot.cfg
\033[36m make boot.scr.\033[0m
mkimage: Can't stat /tmp/u-boot/r40_boot.cmd: No such file or directory
\033[36m copying binary u-boot sd.\033[0m
461+1 records in
461+1 records out
472571 bytes (473 kB, 461 KiB) copied, 0.00600794 s, 78.7 MB/s
\033[36m copying new dtb sd.\033[0m
\033[36m Please reboot Now.\033[0m

root@bananapim2berry:~# ls /tmp/u-boot/
api                         config.mk  Kbuild       System.map          u-boot.img
arch                        configs    Kconfig      test                u-boot.lds
board                       disk       lib          tools               u-boot.map
boot.scr                    doc        Licenses     u-boot              u-boot-nodtb.bin
build                       drivers    MAINTAINERS  u-boot.bin          u-boot.srec
cmd                         dts        Makefile     u-boot.cfg          u-boot-sunxi-with-spl.bin
common                      env        net          u-boot.cfg.configs  u-boot.sym
compile_u-boot_r40_emmc.sh  examples   post         u-boot.dtb
compile_u-boot_r40_sd.sh    fs         README       u-boot-dtb.bin
compile_u-boot_v40_emmc.sh  image.map  scripts      u-boot-dtb.img
compile_u-boot_v40_sd.sh    include    spl          u-boot.dtb.out

After reboot

root@bananapim2berry:~# aplay -l
aplay: device_list:272: no soundcards found...
 

Link to comment
Share on other sites

you must run two commands one to compile u-boot with the codec node, the other is to compile and copy the new codec with r40/v40 support. and finally it remains to load the modules, there are two ways one is to load it manually:

sudo modprobe sun8i-codec-analog

sudo modprobe sun4i-codec

and the second way is to add the two previous commands in /etc/rc.local which loads the modules automatically. first try the manual commands, if after loading manually the sound card appears you should modify rc.local so that it loads automatically

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines