Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Config | NanoPi (NEO2) aplay Audio Hat PCM5102 support #2683

Closed
avworldme opened this issue Apr 1, 2019 · 9 comments
Closed

DietPi-Config | NanoPi (NEO2) aplay Audio Hat PCM5102 support #2683

avworldme opened this issue Apr 1, 2019 · 9 comments

Comments

@avworldme
Copy link

avworldme commented Apr 1, 2019

I have a Neo2 and an audio hat However when I issue aplay -l I get:

card 0: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: allwinnerhdmi [allwinner,hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

there is no option to enable the hat.

Audio Hat PCM5102

Is that support missing? Can it be added manually?

@avworldme avworldme changed the title Neo2 image aplay -l shows wrong processor Neo2 image aplay Audio Hat PCM5102 support Apr 1, 2019
@MichaIng
Copy link
Owner

MichaIng commented Apr 4, 2019

@avworldme
According to the link, I2S needs to be enabled, let me investigate how to achieve that on NEO2.

@avworldme
Copy link
Author

yes, in their npi-config setup i have to first enable i2s then the audio. if you need a Neo2 and an audio hat I am more than happy to donate mine

@MichaIng
Copy link
Owner

MichaIng commented Apr 4, 2019

@avworldme
Please try to disable all the serial consoles. AFAIK it uses the same GPIO pins:
dietpi-config > Advanced Options > Serial console

The default UART0 serial console is on the other GPIO pin row but the way we currently enable serial login consoles on all known serial devices might block the other one too. I am already working on a better configuration menu that allows to toggle serial console individually on all found serial devices: #2678

@avworldme
Copy link
Author

I disabled the serial and ran a firmware update. Still only get the above devices. Are there any additional steps after disable serial?

@MichaIng
Copy link
Owner

MichaIng commented Apr 4, 2019

I just checked the npi-config code. When you use it, doesn't it throw some error? It accesses dtoverlays at /boot but there are non with out image. I now downloaded the FriendlyCore image and it has only one single overlay in /boot/overlays. So I believe now that those are contained in /boot/sun50i-h5-nanopi-neo2.dtb somehow. Are those perhaps created as dtb(o) files when activated, does /boot/overlays exist on your system?

The fresh install (other thread) did not solve something, did it?

@avworldme
Copy link
Author

I don't get any errors when I use npi-config on FriendlyCore Xenial 4.14 image. It activates the hat and it works. On my FreindlyCore image is as you described. /boot/overlays does exist and it has one file in it: sun50i-h5-gpio-dvfs-overlay.dtb

@MichaIng
Copy link
Owner

MichaIng commented Apr 6, 2019

@avworldme

I don't get any errors when I use npi-config on FriendlyCore Xenial 4.14 image.

Ah I meant if you get an error on DietPi when runnin npi-config. And your should since:

  • It contains to get the board info:
if [ -f /etc/friendlyelec-release ]; then
  # get friendlyelec's boardt model
  # example: 
  # BOARD="NanoPC-T2"
  # LINUXFAMILY=nanopi2
  . /etc/friendlyelec-release                       
else
    echo "Not found /etc/friendlyelec-release, Unable to determine the board model."
    return 1
fi
KERN_VERSION=`uname -r`
BOARD_LC=$(echo $BOARD|tr '[:upper:]' '[:lower:]')
  • But this file does not exist on our image.
  • So when running npi-config you should only see Not found /etc/friendlyelec-release, Unable to determine the board model. and the script should exit immediately.

It is not too hard to create this file with the correct info though:

cat << _EOF_ > /etc/friendlyelec-release
BOARD='NanoPi-NEO2'
LINUXFAMILY='Allwinnersun50iw2Family'
_EOF_

When done the above check if the config tool works. Generally you can check the important overlay states via:

fdtget /boot/sun50i-h5-nanopi-neo2.dtb pcm5102a status # Should be enabled
fdtget /boot/sun50i-h5-nanopi-neo2.dtb i2s0 status # Should be just an alias of above, not sure npi-config is not consistent there
fdtget /boot/sun50i-h5-nanopi-neo2.dtb i2c1 status # Needs to be DISABLED for I2S to work!

Long term question is now if we should implement the npi-config features into dietpi-config or leave it as is and instead leave/create the correct /etc/friendlyelec-release. But the options in both scripts do overlap. Best would be indeed to merge similar to what we did with rpi-config. Just a bunch of work 😉.

@MichaIng MichaIng added this to the v6.23 milestone May 1, 2019
@MichaIng MichaIng changed the title Neo2 image aplay Audio Hat PCM5102 support DietPi-Config | NanoPi (NEO2) aplay Audio Hat PCM5102 support May 1, 2019
@MichaIng MichaIng modified the milestones: v6.23, v6.24, v6.25 May 11, 2019
@MichaIng MichaIng modified the milestones: v6.25, v6.26 Jun 24, 2019
@MichaIng MichaIng modified the milestones: v6.26, v6.27 Sep 3, 2019
@MichaIng MichaIng modified the milestones: v6.27, v6.28 Nov 13, 2019
@MichaIng MichaIng modified the milestones: v6.28, v6.29 Jan 3, 2020
@MichaIng
Copy link
Owner

MichaIng commented Mar 3, 2020

New image based on Armbian Buster, might provide the required dtoverlay: https://dietpi.com/downloads/testing/DietPi_NanoPiNEO2-ARMv8-Buster.7z

@MichaIng MichaIng removed this from the v6.29 milestone Mar 19, 2020
@MichaIng MichaIng added this to the v6.30 milestone Mar 19, 2020
@MichaIng MichaIng modified the milestones: v6.30, v6.31 May 10, 2020
@MichaIng
Copy link
Owner

I mark this as closed as of new image. Feel free to reopen if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants