Quantcast
Channel: Armbian news
Viewing all articles
Browse latest Browse all 486

NanoHat PCM5102A for Nano Pi NEO Air

$
0
0

I received NanoPi NEO and NEO Air boards along with the NanoHat PCM5102a that FriendlyArm is selling: http://www.friendlyarm.com/index.php?route=product/product&product_id=169

It's a good quality audio stereo out addon board compatible with NEO and NEO Air.

 

I got it working with Armbian on NEO Air!

 

I adapted commits from FA's repo to match Armbian's tree and get that DAC working, (original commits here: https://github.com/friendlyarm/h3_lichee/search?utf8=%E2%9C%93&q=pcm5102a+&type=Commits). 

 

Add these to 'userpatches/kernel/sun8i-default`: https://gist.github.com/Simon-L/c8c119c86d7d3fe4316387c3ae818379

Add this config to 'userpatches' to have the driver built-in: https://gist.github.com/Simon-L/56bf6a3ec423e37973ee0da0bc16979f

Then run './compile.sh'

 

The fex file also needs to be modified, you can use this one: https://gist.github.com/Simon-L/f0c88190814f0f482773e81512e56553

 

This should be all that's needed!

Test it with 'aplay /usr/share/sounds/alsa/Noise.wav'

and install madplay if you want to try with mp3 files.

 

Can I safely share the content of the /boot folder and expect it to work for user copy-pasting it to the /boot folder on their sdcard? It has the kernel and the fex which are the only files the process has modified.

Obviously you'd still have to trust me :)

 

I'm trying to turn this into a more straightforward way. Do I need to commit to modify defconfig and .fex file or is it supported in userpatches/ folder as well?

 

There is one issue reported in syslog that doesn't seem to prevent it from working, here's the relevant part of the log:

[    1.598532] pcm5102a_probe
[    1.607823] asoc: snddaudio <-> pri_dai mapping ok
[    1.610531] ------------[ cut here ]------------
[    1.610583] WARNING: at fs/sysfs/dir.c:508 sysfs_add_one+0x8c/0xac()
[    1.610604] sysfs: cannot create duplicate filename '/devices/platform/snddaudio'
[    1.610625] Modules linked in:
[    1.610694] [<c0016a20>] (unwind_backtrace+0x0/0xe8) from [<c0617cc0>] (dump_stack+0x20/0x24)
[    1.610742] [<c0617cc0>] (dump_stack+0x20/0x24) from [<c0029750>] (warn_slowpath_common+0x5c/0x74)
[    1.610788] [<c0029750>] (warn_slowpath_common+0x5c/0x74) from [<c00297a8>] (warn_slowpath_fmt+0x40/0x48)
[    1.610833] [<c00297a8>] (warn_slowpath_fmt+0x40/0x48) from [<c017aab8>] (sysfs_add_one+0x8c/0xac)
[    1.610877] [<c017aab8>] (sysfs_add_one+0x8c/0xac) from [<c017acb8>] (create_dir+0x70/0xc4)
[    1.610917] [<c017acb8>] (create_dir+0x70/0xc4) from [<c017b0bc>] (sysfs_create_dir+0xc4/0xe4)
[    1.610965] [<c017b0bc>] (sysfs_create_dir+0xc4/0xe4) from [<c0306bf0>] (kobject_add_internal+0xdc/0x1d0)
[    1.611013] [<c0306bf0>] (kobject_add_internal+0xdc/0x1d0) from [<c0306ef8>] (kobject_add+0x78/0x90)
[    1.611064] [<c0306ef8>] (kobject_add+0x78/0x90) from [<c03b0078>] (device_add+0xf8/0x578)
[    1.611114] [<c03b0078>] (device_add+0xf8/0x578) from [<c03b4208>] (platform_device_add+0x110/0x16c)
[    1.611161] [<c03b4208>] (platform_device_add+0x110/0x16c) from [<c03b47a4>] (platform_device_register+0x30/0x34)
[    1.611214] [<c03b47a4>] (platform_device_register+0x30/0x34) from [<c08f6f94>] (sunxi_snddaudio0_init+0x54/0xa4)
[    1.611263] [<c08f6f94>] (sunxi_snddaudio0_init+0x54/0xa4) from [<c000867c>] (do_one_initcall+0xa8/0x164)
[    1.611313] [<c000867c>] (do_one_initcall+0xa8/0x164) from [<c08d1a74>] (kernel_init+0x168/0x254)
[    1.611364] [<c08d1a74>] (kernel_init+0x168/0x254) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8)
[    1.611455] ---[ end trace bd16a9742f20e8dd ]---
[    1.611481] ------------[ cut here ]------------
[    1.611509] WARNING: at lib/kobject.c:198 kobject_add_internal+0x180/0x1d0()
[    1.611533] kobject_add_internal failed for snddaudio with -EEXIST, don't try to register things with the same name in the same directory.
[    1.611560] Modules linked in:
[    1.611601] [<c0016a20>] (unwind_backtrace+0x0/0xe8) from [<c0617cc0>] (dump_stack+0x20/0x24)
[    1.611644] [<c0617cc0>] (dump_stack+0x20/0x24) from [<c0029750>] (warn_slowpath_common+0x5c/0x74)
[    1.611686] [<c0029750>] (warn_slowpath_common+0x5c/0x74) from [<c00297a8>] (warn_slowpath_fmt+0x40/0x48)
[    1.611732] [<c00297a8>] (warn_slowpath_fmt+0x40/0x48) from [<c0306c94>] (kobject_add_internal+0x180/0x1d0)
[    1.611778] [<c0306c94>] (kobject_add_internal+0x180/0x1d0) from [<c0306ef8>] (kobject_add+0x78/0x90)
[    1.611825] [<c0306ef8>] (kobject_add+0x78/0x90) from [<c03b0078>] (device_add+0xf8/0x578)
[    1.611870] [<c03b0078>] (device_add+0xf8/0x578) from [<c03b4208>] (platform_device_add+0x110/0x16c)
[    1.611915] [<c03b4208>] (platform_device_add+0x110/0x16c) from [<c03b47a4>] (platform_device_register+0x30/0x34)
[    1.611962] [<c03b47a4>] (platform_device_register+0x30/0x34) from [<c08f6f94>] (sunxi_snddaudio0_init+0x54/0xa4)
[    1.612007] [<c08f6f94>] (sunxi_snddaudio0_init+0x54/0xa4) from [<c000867c>] (do_one_initcall+0xa8/0x164)
[    1.612052] [<c000867c>] (do_one_initcall+0xa8/0x164) from [<c08d1a74>] (kernel_init+0x168/0x254)
[    1.612098] [<c08d1a74>] (kernel_init+0x168/0x254) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8)
[    1.612125] ---[ end trace bd16a9742f20e8de ]---

Any hint? The codec still works fine. There is no control in alsamixer.

 

Thanks to @tkaiser and @Igor for their help on IRC.


Viewing all articles
Browse latest Browse all 486

Trending Articles