Jump to content

[Experiment] armbian on NanoPi A64


guidol

Recommended Posts

@5kft @Hannes Worst
it seems that current 5.8.7 is missing some modules for the analog audio (or they are named in a other way) than 

legacy 5.4.63, because with the legacy image analog-audio does work.

 

I do see much more sound-modules loaded than in current 5.8.7:
 

Module                  Size  Used by
sun50i_codec_analog    28672  1
sun8i_codec            28672  1
snd_soc_simple_card_utils    20480  1 snd_soc_simple_card
sun4i_i2s              24576  4
sun8i_drm_hdmi         24576  0
snd_soc_core          176128  7 sun4i_i2s,snd_soc_spdif_tx,snd_soc_hdmi_codec,sun50i_codec_analog,sun8i_codec,snd_soc_simple_card_utils,snd_soc_simple_card
dw_hdmi                40960  2 sun8i_drm_hdmi,dw_hdmi_i2s_audio
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
cec                    69632  2 dw_hdmi_cec,dw_hdmi
snd_pcm               110592  5 sun4i_i2s,snd_soc_hdmi_codec,sun8i_codec,snd_soc_core,snd_pcm_dmaengine
snd_timer              40960  1 snd_pcm
snd                    86016  8 snd_soc_hdmi_codec,snd_timer,snd_soc_core,snd_pcm
soundcore              16384  1 snd
sun4i_drm              20480  0
sun4i_frontend         16384  1 sun4i_drm
sun4i_tcon             32768  1 sun4i_drm
sun8i_mixer            40960  0
sun8i_tcon_top         16384  3 sun8i_drm_hdmi,sun4i_tcon,sun4i_drm
dwmac_sun8i            28672  0
mdio_mux               16384  1 dwmac_sun8i

 

Link to comment
Share on other sites

16 minutes ago, guidol said:

@5kft @Hannes Worst
it seems that current 5.8.7 is missing some modules for the analog audio (or they are named in a other way) than 

legacy 5.4.63, because with the legacy image analog-audio does work.

 

I do see much more sound-modules loaded than in current 5.8.7:

 

Part of this difference could be that in the newer kernel more audio modules built in.  What I'm seeing is that when I try analog audio it works fine - e.g., I don't see the "no soundcards" error, and I can play audio, etc. (e.g., I tested on a NEO Core2 but don't get any audio errors on any of the other boards either).  So it seems that there is something different for the A64, and I agree with you it's likely the DT configuration.

Link to comment
Share on other sites

2 minutes ago, Hannes Worst said:

It works on the kernel 5.7.15.


dmesg|grep -i sound
[    8.338780] asoc-simple-card sound: sun8i-codec-aif1 <-> 1c22c00.dai mapping ok
[    9.015640] asoc-simple-card hdmi-sound: i2s-hifi <-> 1c22800.i2s mapping ok

 

got this dmesg-output alos in 5.8.7, but no output from analog-audio from the NPi A64

Link to comment
Share on other sites

On 9/6/2020 at 5:16 PM, 5kft said:

 

Part of this difference could be that in the newer kernel more audio modules built in. 

So it seems that there is something different for the A64, and I agree with you it's likely the DT configuration.

@5kft @Hannes Worst @@lex

somebody did hear us :) the analog sound is back in dev kernel/dtb 5.9.1

and now - I think - we have found the missing link:
sound was playing but we didnt hear anything on analog-audio because - as I remember right -  the option

AIF1 Slot 0 Digital DAC

was missing. So it couldnt be enabled :( 

 

Now the option is back and the DAC could now enabled again - so no more silence anymore :) 

 

BUT be advised to set AIF DA0 not higher than 17, because then the sound will very fast be distorted/overdriven :( 

 

So here is my kernel-information als alsamixer-setting for analog-audio (sun50i-a64-audio):

 _   _ ____  _      _    __   _  _
| \ | |  _ \(_)    / \  / /_ | || |
|  \| | |_) | |   / _ \| '_ \| || |_
| |\  |  __/| |  / ___ \ (_) |__   _|
|_| \_|_|   |_| /_/   \_\___/   |_|

Welcome to Debian GNU/Linux 10 (buster) with Linux 5.9.1-sunxi64

No end-user support: built from trunk

package bsp-kernel[20.11.0-trunk] u-boot[20.11.0-trunk] dtb   [20.11.0-trunk]
firmware          [20.11.0-trunk] config[20.11.0-trunk] branch[dev]


root@npi-a64-116(192.168.6.116):~# uname -a
Linux npi-a64-116 5.9.1-sunxi64 #trunk SMP Mon Oct 26 18:14:55 +03 2020 aarch64 GNU/Linux

root@npi-a64-116(192.168.6.116):~# more /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

root@npi-a64-116(192.168.6.116):~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sun50ia64audio [sun50i-a64-audio], device 0: 1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0 [1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: sun50ia64hdmi [sun50i-a64-hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 [1c22800.i2s-i2s-hifi i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


root@npi-a64-116(192.168.6.116):~# alsamixer

Card: sun50i-a64-audio 

Value:      Item:

83          Headphone [dB gain: -8.00]
Mixer       Headphone Source [Mixer]
15          AIF1 DA0 [dB gain: -24.00, -24.00]
Stereo      AIF1 DA0 Stereo [Stereo]
Enable      AIF1 Slot 0 Digital DAC
82          DAC [dB gain: 18.75, 18.75]
Enable      DAC Reversed

 

Link to comment
Share on other sites

14 hours ago, Levent Erenler said:

Hi, do you have a chance to test it? I could not get sound from audio jack. Could you share your dts if the analog audio working? Thank you

For me it does work, but I dont know if @Hannes Worst did had success ;)

Here are the "warnings" while decompiling the .dtb to .dts (see attachment) :
 

root@npi-a64-116(192.168.6.116):/boot/dtb/allwinner# dtc -I dtb -O dts /boot/dtb/allwinner/sun50i-a64-nanopi-a64.dtb -o /boot/dtb/allwinner/sun50i-a64-nanopi-a64_kernel_591.dts

/boot/dtb/allwinner/sun50i-a64-nanopi-a64_kernel_591.dts: Warning (unit_address_vs_reg): /sound/simple-audio-card,dai-link@0: node has a unit name, but no reg property

/boot/dtb/allwinner/sun50i-a64-nanopi-a64_kernel_591.dts: Warning (avoid_unnecessary_addr_size): /sound: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

/boot/dtb/allwinner/sun50i-a64-nanopi-a64_kernel_591.dts: Warning (avoid_unnecessary_addr_size): /soc/dsi@1ca0000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

 

I dont know if this .dts will work with lower kernel numbers :(

root@npi-a64-116(192.168.6.116):/boot# uname -a
Linux npi-a64-116 5.9.1-sunxi64 #trunk SMP Mon Oct 26 18:14:55 +03 2020 aarch64 GNU/Linux
OR
Linux npi-a64-116 5.10.0-rc2-sunxi64 #trunk SMP Sat Nov 7 14:11:13 +03 2020 aarch64 GNU/Linux

 

sun50i-a64-nanopi-a64_kernel_591.dts

sun50i-a64-nanopi-a64_kernel_510rc2.dts

Link to comment
Share on other sites

Thanks @guidol I am testing with pine64+ A64 kernel 5.9.5 i have same warnings in original dtb. I try many things but i could not figure whats wrong! I try to compare my dts file with yours.Do you have source, i mean dts files before compiled(easy to read) or is that https://github.com/megous/linux/tree/orange-pi-5.9  Thank you

i try to gave more information 

 

UPDATE:  I found a solution

 

Edited by Levent Erenler
solution
Link to comment
Share on other sites

@guidolI wasn't able yet to try out the 5.9 kernel. I tested the dts file you posted as a dtb file on the present (lower) 5.8 kernel and found out it doesn't work to activate analog sound. 

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sun50ia64hdmi [sun50i-a64-hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 [1c22800.i2s-i2s-hifi i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

 

Link to comment
Share on other sites

I compiled Hirsute Hippo [edge] for the NanoPi A64 and got out of the compile a Kernel 5.12.x

There was analog-audio but no control for the blue led.

 

After updateing I got the Kernel 5.13.9 - now there was a control for the blue led, but no analog audio :(

 

So I did decompile the .dtb to .dts /edited it/recompiled the .dts to .dtb - now analog audio is working again :)

 

Spoiler

sound {
            status = "okay";

i2s@1c22000 {
            status = "okay";

dai@1c22c00 {
            status = "okay";

codec@1c22e00 {
            status = "okay";
            
codec-analog@1f015c0 {
            status = "okay";

 

 _   _ ____  _      _    __   _  _
| \ | |  _ \(_)    / \  / /_ | || |
|  \| | |_) | |   / _ \| '_ \| || |_
| |\  |  __/| |  / ___ \ (_) |__   _|
|_| \_|_|   |_| /_/   \_\___/   |_|

Welcome to Armbian 21.08.0-trunk Hirsute with bleeding edge Linux 5.13.9-sunxi64

No end-user support: built from trunk

package bsp-kernel[21.08.0-trunk.114] u-boot[21.08.1] dtb   [21.08.0-trunk.114]
firmware          [21.08.0-trunk] config[21.08.0-trunk] branch[edge]

uname -a
Linux npi-a64-116 5.13.9-sunxi64 #trunk.114 SMP Sun Aug 8 22:12:23 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sun50ia64audio [sun50i-a64-audio], device 0: 1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0 [1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: sun9ihdmi [sun9i-hdmi], device 0: SUN9I-HDMI PCM i2s-hifi-0 [SUN9I-HDMI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

 

sun50i-a64-nanopi-a64.dtb_5_13_9_analog_audio_enabled sun50i-a64-nanopi-a64.dtb_5_13_9_org sun50i-a64-nanopi-a64.dts

Link to comment
Share on other sites

Here is a working (USB-ports & analog Sound) patched

sun50i-a64-nanopi-a64 .DTS/.DTB

for Kernel 5.18.15 under armbian bullseye

 

Dont know why these arent automatically configured at armbian/kernel-compile :(

 

 _   _ ____  _      _    __   _  _
| \ | |  _ \(_)    / \  / /_ | || |
|  \| | |_) | |   / _ \| '_ \| || |_
| |\  |  __/| |  / ___ \ (_) |__   _|
|_| \_|_|   |_| /_/   \_\___/   |_|

Welcome to Armbian 22.08.0-trunk Bullseye with Linux 5.18.15-sunxi64

No end-user support: community creations

System load:   2%               Up time:       16 min   Local users:   2
Memory usage:  14% of 984M      IP:            192.168.6.116
CPU temp:      27°C             Usage of /:    24% of 15G
RX today:      23.9 MiB

[ General system configuration (beta): armbian-config ]

Last login: Wed Sep  7 14:05:25 2022 from 192.168.6.17

root@npi-a64-116:~# uname -a
Linux npi-a64-116 5.18.15-sunxi64 #trunk SMP Thu Aug 4 12:51:25 +03 2022 aarch64 GNU/Linux

root@npi-a64-116:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sun50ia64audio [sun50i-a64-audio], device 0: 1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0 [1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sun9ihdmi [sun9i-hdmi], device 0: SUN9I-HDMI PCM i2s-hifi-0 [SUN9I-HDMI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

sun50i-a64-nanopi-a64_5_18_15.zip

DTS_Changes_NPI_A64.doc DTS_Changes_NPi_A64.pdf

Edited by guidol
Link to comment
Share on other sites

39 minutes ago, guidol said:

Dont know why these arent automatically configured


This is the diff between your device tree and the one shipped with (latest 5.19.y) kernel:
 

Spoiler
@@ -172,7 +172,7 @@
 		simple-audio-card,name = "sun50i-a64-audio";
 		simple-audio-card,aux-devs = <0x10>;
 		simple-audio-card,routing = "Left DAC\0DACL\0Right DAC\0DACR\0ADCL\0Left ADC\0ADCR\0Right ADC";
-		status = "disabled";
+		status = "okay";
 		phandle = <0x4f>;
 
 		simple-audio-card,dai-link@0 {
@@ -661,8 +661,8 @@
 			phys = <0x2c 0x00>;
 			phy-names = "usb";
 			extcon = <0x2c 0x00>;
-			dr_mode = "otg";
-			status = "disabled";
+			dr_mode = "host";
+			status = "okay";
 			phandle = <0x68>;
 		};
 
@@ -963,7 +963,7 @@
 			resets = <0x02 0x27>;
 			dma-names = "rx\0tx";
 			dmas = <0x30 0x03 0x30 0x03>;
-			status = "disabled";
+			status = "okay";
 			phandle = <0x7d>;
 		};
 
@@ -1005,7 +1005,7 @@
 			resets = <0x02 0x24>;
 			dmas = <0x30 0x0f 0x30 0x0f>;
 			dma-names = "rx\0tx";
-			status = "disabled";
+			status = "okay";
 			phandle = <0x12>;
 		};
 
@@ -1016,7 +1016,7 @@
 			interrupts = <0x00 0x1c 0x04>;
 			clocks = <0x02 0x38 0x02 0x6b>;
 			clock-names = "bus\0mod";
-			status = "disabled";
+			status = "okay";
 			phandle = <0x13>;
 		};
 
@@ -1232,7 +1232,7 @@
 		};
 
 		pwm@1c21400 {
-			compatible = "allwinner,sun50i-a64-pwm\0allwinner,sun5i-a13-pwm";
+			compatible = "allwinner,sun50i-a64-pwm";
 			reg = <0x1c21400 0x400>;
 			clocks = <0x2d>;
 			pinctrl-names = "default";
@@ -1401,7 +1401,7 @@
 		codec-analog@1f015c0 {
 			compatible = "allwinner,sun50i-a64-codec-analog";
 			reg = <0x1f015c0 0x04>;
-			status = "disabled";
+			status = "okay";
 			phandle = <0x10>;
 		};
 
@@ -1431,7 +1431,7 @@
 		};
 
 		pwm@1f03800 {
-			compatible = "allwinner,sun50i-a64-pwm\0allwinner,sun5i-a13-pwm";
+			compatible = "allwinner,sun50i-a64-pwm";
 			reg = <0x1f03800 0x400>;
 			clocks = <0x2d>;
 			pinctrl-names = "default";
@@ -1767,7 +1767,7 @@
 
 	hdmi-connector {
 		compatible = "hdmi-connector";
-		type = "a";
+		type = [61 00];
 
 		port {

 


Everything is there, just disabled by default. Don't we have overlays for enabling this via armbian-config -> system -> hardware?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines