Jump to content

[Experiment] armbian on NanoPi A64


guidol

Recommended Posts

1 hour ago, mackemint said:

I'm only interested in analog audio personally, tried your alsa-state and setting all the DAC output volumes low but the sound wasn't only distorted but probably the sample rate was incorrect which caused the pitch-down effect. Maybe I got the kernels mixed up.

for the correct analog-audio samplerate we need a clock of 0x80=128 (where HDMI has 0x100=256):

analog audio in the .dts/.dtb:
simple-audio-card,mclk-fs = < 0x80 >;

 

I also got problems with ananlog-audio back in the 23th Nov. 2019:

 

Link to comment
Share on other sites

I followed your advice and used the sun50i-a64-nanopi-a64.dtb_7nd with the nanopi-a64 5.4.33 image. CPU-temperature is now a steady 52 degrees Celsius. Sound is still wrong, a kind of sizzling while is has the correct value in the dtb file (simple-audio-card,mclk-fs = < 0x80 >).

Link to comment
Share on other sites

13 hours ago, Hannes Worst said:

I followed your advice and used the sun50i-a64-nanopi-a64.dtb_7nd with the nanopi-a64 5.4.33 image. CPU-temperature is now a steady 52 degrees Celsius. Sound is still wrong, a kind of sizzling while is has the correct value in the dtb file (simple-audio-card,mclk-fs = < 0x80 >).

with ubuntu focal and kernel 5.6.8 (using a mini passive heatsink) I only got around 32 degree:
 

armbianmonitor -m
Stop monitoring using [ctrl]-[c]
Time        CPU    load %cpu %sys %usr %nice %io %irq   CPU  C.St.

21:50:04:  648MHz  0.07   0%   0%   0%   0%   0%   0% 32,0°C  0/7
21:50:09:  648MHz  0.07   1%   1%   0%   0%   0%   0% 32,5°C  0/7
21:50:15:  648MHz  0.06   0%   0%   0%   0%   0%   0% 33,1°C  0/7
21:50:20:  648MHz  0.06   0%   0%   0%   0%   0%   0% 32,7°C  0/7
21:50:25:  648MHz  0.05   1%   0%   0%   0%   0%   0% 32,3°C  0/7
21:50:30:  648MHz  0.05   1%   0%   0%   0%   0%   0% 32,4°C  0/7
21:50:35:  648MHz  0.04   0%   0%   0%   0%   0%   0% 32,5°C  0/7
21:50:40:  648MHz  0.04   0%   0%   0%   0%   0%   0% 32,2°C  0/7
21:50:45:  648MHz  0.04   0%   0%   0%   0%   0%   0% 32,2°C  0/7
21:50:50:  648MHz  0.03   1%   0%   0%   0%   0%   0% 32,3°C  0/7
21:50:55:  648MHz  0.03   0%   0%   0%   0%   0%   0% 32,4°C  0/7

At analog-audio I cant hear the sound sizzling... only the HDMI sound is sizzling/distorted :(

I checked the .dts/.dtb against some other SBCs .dts/.dtb, but couldnt find any errors why the NanoPi A64 - using HDMI - sounds so crackling.

I also checked a value of 0x100/256 for analog-audio - no change

or

0x200/512 for sound_hdmi - but also no better sound.

 

Also when commenting out
frame-master = <0x0f>;
bitclock-master = <0x0f>;

the analog-audio didnt change for me.
 

Link to comment
Share on other sites

My sd-card got corrupted unfortunately. Currently I am using the pine64 Armbian-image from 10 jan 2019 with frozen kernel && firmware, etc on the nanopi-a64. With this image everything works as it should, sound and everything, except for the ethernet. I've got Wifi however ..

Link to comment
Share on other sites

Due to the circumstances I wasn't able to spend more time in this issue. But today I found some time. Bought a fresh sd-card of good quality and downloaded the Buster Desktop from the automated build on the frontpage. Actualy it is not bad at all. The system is very responsive only sound doesn't work. The cards are detected as before. CPU-Temperature is at 37 degrees celsius. The allwinner-chip doesn't feel to hot either.

I will continue using it for a while to try it out. But apart for the sound it feels very usable.

Link to comment
Share on other sites

14 hours ago, Hannes Worst said:

Bought a fresh sd-card of good quality and downloaded the Buster Desktop from the automated build on the frontpage. Actualy it is not bad at all.

The system is very responsive only sound doesn't work.

Sound doesnt work or sounds not so good? 
As I wrote at the 2nd May in this thread for Kernel 5.4 it may be possible hat the soun disnt included (only newer 5.6 kernel images).
You could try the 2 .dtb's from this message:

 

Link to comment
Share on other sites

Sound is included and detected. The .dtb file also shows the correct value for the soundcard as mentioned in this thread. I hear a lot of static noise and on the background I thought  to hear some distant music. But that may be my fantasy playing tricks.

 

**** List of PLAYBACK Hardware Devices ****
card 0: sun50ia64audio [sun50i-a64-audio], device 0: 1c22c00.dai-sun8i sun8i-0 [1c22c00.dai-sun8i sun8i-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: allwinnerhdmi [allwinner,hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 [1c22800.i2s-i2s-hifi i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 

Link to comment
Share on other sites

1 hour ago, Hannes Worst said:

Sound is included and detected. The .dtb file also shows the correct value for the soundcard as mentioned in this thread. I hear a lot of static noise and on the background I thought  to hear some distant music. But that may be my fantasy playing tricks.

When using HDMI, then you could only make your TV louder :) but when using analog-audio try these alsamixer-settings:

 

 

Link to comment
Share on other sites

1 hour ago, Hannes Worst said:

 A lot of controls (headphones for instance) but not those ..

Ohh - maybe it has a other name in kernel 5.4
Analog audio came way after HDMI(-audio) when we came from the Pine64-image.
The first time we got analog audio was in September 2019 with the first analog-audio patch from 
@kevinplatt:

But also at this time it was named AIF1 (Audio Interface 1?):

 

+&sound {
+  simple-audio-card,aux-devs = <&codec_analog>;
+  simple-audio-card,widgets = "Microphone", "Microphone Jack",
+            "Headphone", "Headphone Jack";
+  simple-audio-card,routing =
+      "Left DAC", "AIF1 Slot 0 Left",
+      "Right DAC", "AIF1 Slot 0 Right",
+      "Headphone Jack", "HP",
+      "AIF1 Slot 0 Left ADC", "Left ADC",
+      "AIF1 Slot 0 Right ADC", "Right ADC",
+      "MIC2", "Microphone Jack";
+  status = "okay";

Link to comment
Share on other sites

9 hours ago, Hannes Worst said:

Yes, that is the situation in this nightly automated build ..

Hmm - the latest nightly Desktop I could find was

https://dl.armbian.com/nanopia64/nightly/Armbian_20.05.0-rc.149_Nanopia64_buster_current_5.4.43_desktop.img.xz

and here Audio does work without copying another .dtb!
Do you use Audio at the command line or on the Desktop?

I could see that when Desktop is muted (small x near the Speaker Icon) that this isnt every time the same in alsamixer.

 

I unmuted headphone on alsamixer and switched to unmuted analog Audio at the Desktop and it works....

Analog Audio is here - at alsamixer - Headphone. AIF1 and DAC must be activated.

N64_alsamixer_kernel_5443.thumb.jpg.a763f04f44752265246c2287dd95958b.jpg

 

On the Desktop set the Default (Audio) Server to nanopia64 and also Default Sink to Built-in Audio Stereo 100%.

 

NPIA64_DefaultServer.thumb.jpg.7ea8c579928084ba1c179467c68f504a.jpg

NPIA64_DefaultSink.thumb.jpg.c1f6109a718d4279d4273b66c624211a.jpg

 

After unmuting Audio on the Desktop (and alsamixer) mpv is also playing a .mp3

 

for analog audio I created a /etc/asound.conf:

pcm.!default {
    type hw
    card 0
    device 0
}

ctl.!default {
    type hw
    card 0
}

for HDMI you could edit this to "card 1"

 

BUT maybe this will also work on your image-version, because nothing should be changed in the audio part :)

Link to comment
Share on other sites

Now for a strange metallic sound on the desktop via HDMI (but analog was selected)....

here it was going to normal sound, when - at the desktop - selecting under the Speaker Icon:

Volume Control

 

This seem to init something and youtube played with fine sound in the browser (picture not maximized) 

 

For me it sounds better using directly ALSA from the commandline:

 

analog audio:

mpg123 -v -a hw:0,0 -@ ./MP3_FFH80s


HDMI:
mpg123 -v -a hw:1,0 -@ ./MP3_FFH80s

 

Please check the sound against the desktop, because I think there is something goin on with pulseaudio :( 

MP3_FFH80s

Link to comment
Share on other sites

Indeed I think it's a pulseaudio problem. The terminal-commands given resulted in "command not found" on my system. mpg123 was not installed on my system. The packagemanager suggested mpc123. I installed that, but using it with your commands resulted in a lot of errors. I wil also search further to find a clue. Thank you allready! You have come a long way and it's a very usable Armbian-install.

Link to comment
Share on other sites

1 hour ago, Hannes Worst said:

 I installed that, but using it with your commands resulted in a lot of errors. 

Yes ;) mpg123 I had installed myself on the NanoPi A64.
You have to save the attached file from the last msg (MP3_FFH80s - a "Playlist" to a Radio-MP3-stream)

You will also get errors when the Headphone in alsamixer is muted with "MM" instead of 00-79

Link to comment
Share on other sites

 

40 minutes ago, guidol said:

Yes ;) mpg123 I had installed myself on the NanoPi A64.
You have to save the attached file from the last msg (MP3_FFH80s - a "Playlist" to a Radio-MP3-stream)

You will also get errors when the Headphone in alsamixer is muted with "MM" instead of 00-79

 

mpg123 worked indeed! While mpv gives static noise. You are right!

Link to comment
Share on other sites

{Information]

I created the pull request https://github.com/armbian/build/pull/2007 :
delete additional modules-line in nanopia64.csc

because this non-existent modules does give a error-message in the onscreen-bootlog (not dmesg)

and some other modules already do the work for sound & network.


They seems to be artifact of the former PineA64-image where the NanoPi A64 image was made of in the past.

 

If you want to get rid of the error-message now you can delete the lines in /etc/modules.

 

status systemd-modules-load.service

● systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-modules-load.service.d
           └─10-timeout.conf
   Active: failed (Result: exit-code) since Thu 2020-06-04 13:07:37 +03; 39s ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 531 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
 Main PID: 531 (code=exited, status=1/FAILURE)

journalctl -f -b _PID=journalctl -f -b _PID=531

Jun 04 13:07:49 npi-a64 systemd-modules-load[531]: Failed to find module 'sunxi_codec'
Jun 04 13:07:49 npi-a64 systemd-modules-load[531]: Failed to find module 'sunxi_i2s'
Jun 04 13:07:49 npi-a64 systemd-modules-load[531]: Failed to find module 'sunxi_sndcodec'
Jun 04 13:07:49 npi-a64 systemd-modules-load[531]: Failed to find module '8723bs'

 

Link to comment
Share on other sites

@Hannes Worst @kevinplatt Today I did try Kernel 5.80 with debian buster on the NPi A64.

 

HDMI-audio does work, but analog audio doesnt work complete :(

I can start audio on analog-audio port. It show that it would play but I dont get any sound.

Also when I adjusted the mixer.

 

The anmes for AIF1 has slightly changed. Also sound_hdmi is now hdmi_sound...

 

Both are listed by "aplay -l"

root@npi-a64(192.168.6.116):/home/guido/iradio# aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: sun50ia64audio [sun50i-a64-audio], Gerät 0: 1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0 [1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0]
  Sub-Geräte: 0/1
  Sub-Gerät #0: subdevice #0
Karte 1: sun50ia64hdmi [sun50i-a64-hdmi], Gerät 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 [1c22800.i2s-i2s-hifi i2s-hifi-0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
root@npi-a64(192.168.6.116):/home/guido/iradio# uname -a
Linux npi-a64 5.8.0-sunxi64 #trunk SMP Mon Aug 10 15:12:34 +03 2020 aarch64 GNU/Linux

 

System diagnosis information has been uploaded to http://ix.io/2tUF

 

 

Link to comment
Share on other sites

enabled eldo1 cpvdd to codec-analog, but didnt help either :( 

                codec-analog@1f015c0 {
                        compatible = "allwinner,sun50i-a64-codec-analog";
                        reg = < 0x1f015c0 0x04 >;
                        allwinner,codec = < 0x15 >;
                        status = "okay";
                        cpvdd-supply = < 0xa7 >;
                        phandle = < 0x12 >;
                };

 

 

codec@1c22e00

was on older kernel (5.6x?):

compatible = "allwinner,sun8i-a33-codec";

 

now the dtb/dts has for codec@1c22e00:

compatible = "allwinner,sun50i-a64-codec";

 

if changed back to allwinner,sun8i-a33-codec

the npi a64 doenst boot anymore :(

 

 

Link to comment
Share on other sites

Rollback to your 5.8 and try this tip with pulse-audio (learned myself the hard way)

 

1. Open a session (or cmd line)

1. Open a second session (or cmd line)

2. Run your MP3 to output to jack on the first session (or cmd line)

3. While the file is playing  (silently as you say)  on the first session, fire alsamixer (select audio-codec) on the second session and start unmuting the controls, upping the volume, etc. At some point, eventually you get the sound output to jack.

 

Watch the kernel for some messages.

Link to comment
Share on other sites

Also no analog sound with Kernel 5.9.0rc2

and (for me) strange:

root@npi-a64(192.168.6.116):~# dmesg|grep -i sound
[    1.283838] Advanced Linux Sound Architecture Driver Initialized.
[    2.771885]   No soundcards found.
[    6.301885] input: sun50i-a64-audio Headphone Jack as /devices/platform/sound/sound/card0/input1

 

Link to comment
Share on other sites

1 hour ago, guidol said:

Also no analog sound with Kernel 5.9.0rc2

and (for me) strange:


root@npi-a64(192.168.6.116):~# dmesg|grep -i sound
[    1.283838] Advanced Linux Sound Architecture Driver Initialized.
[    2.771885]   No soundcards found.
[    6.301885] input: sun50i-a64-audio Headphone Jack as /devices/platform/sound/sound/card0/input1

 

 

Did this work for you in 5.7.x. or 5.4.x?  Perhaps there are some kernel configs missing, and/or some DT changes didn't make it over okay.  Knowing what version it last worked on could provide a helpful starting point.

Link to comment
Share on other sites

17 hours ago, 5kft said:

 

Did this work for you in 5.7.x. or 5.4.x?  Perhaps there are some kernel configs missing, and/or some DT changes didn't make it over okay.  Knowing what version it last worked on could provide a helpful starting point.

the last time - I truly know - it worked was on kernel 5.6.2 (also 5.4.x) - but 5.7.x I didnt installed on the NPI A64 ;) 

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