Power & Source of Big Ideas

USB sound card not working on nanopi2

Moderators: chensy, FATechsupport

Hello, Since one of missing features of nanopi2 board is audio in/out jack. I bought the following USB sound card which works prefectly on desktop Debian and Raspbian (for raspberry pi) boards.
And since the Raspbian kernel was not so different with the Debian kernel on nanopi2, I thought it should work three too. But how hard I tried it was nonsense and I could not get it work. By the way USB is recognizes the device.

Code: Select all

Bus 003 Device 002: ID 1b3f:2007 Generalpulse Technology Inc.

what should I do please help me?
Thanks in advance.
You can fuse the latest Debian image and then reference the following steps to test your USB sound card.
By default our Debian system's HDMI output doesn't have audio output. To enable the HDMI audio output you need to install the alsa packages
Firstly, make sure your board runs our latest Debian image and is connected to the internet:
After your board is powered up run the following commands:

apt-get update
apt-get install libasound2
apt-get install alsa-base
apt-get install alsa-utilsAfter the installation is done copy a ".wav" audio file to your NanoPi 2, connect your NanoPi 2 to an HDMI monitor and play it by using the following command:

aplay music.wav
Hey, kevin16 - did you have any success meanwhile? If so, what did you do?

Running Debian (fused yesterday), I am now at a similar position. I have added a USB soundcard and alsamixer won't show it. Only the SPDIF card, presumably the one of HDMI, is available.

Here's the relevant output from dmesg:

Code: Select all

[    2.512000] usb 3-1: new full-speed USB device number 2 using nxp-ohci
[    2.668000] usb 3-1: New USB device found, idVendor=0d8c, idProduct=0014
[    2.668000] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.668000] usb 3-1: Product: USB Audio Device
[    2.668000] usb 3-1: Manufacturer: C-Media Electronics Inc.
[    2.820000] usbcore: registered new interface driver uvcvideo
[    2.988000] input: C-Media Electronics Inc. USB Audio Device as /devices/platform/nxp-ohci/usb3/3-1/3-1:1.3/input/input3
[    3.000000] generic-usb 0003:0D8C:0014.0001: input,hidraw0: USB HID v1.00 Device [C-Media Electronics Inc. USB Audio Device] on usb-nxp-ohci

An alsa page I found ( http://alsa.opensrc.org/Usb-audio ) refers to a usb-audio kernel mod, which I didn't find in synaptic, nor under /lib/modules - though, this page has a deprecated feeling to it.
Another alsa page ( http://www.alsa-project.org/main/index. ... -usb-audio ) , feeling modern, also refers to the kernel modules "soundcore", which was renamed on Debian systems to "snd" - neither to be found either.
Furthermore, generic searches under /lib/modules for "*snd*", or "*audio*" returned nothing.

What am I missing?
I figured I'll most likely need to recompile the kernel. I cloned this repo: https://github.com/friendlyarm/linux-3.4.y and could enable USB audio devices in menuconfig.

Compiling the kernel was somewhat OK, I had to pass in parameters like "CC=/usr/bin/gcc LD=..." and so forth in order to have it find all tools.

"make install" reports an error, because DKMS can't find the kernel headers. Installing them (with "them" being the arm specific ones) via synaptic didn't help, and the proposed "--kernelheaders" parameter isn't accepted by make.
Even trying to trick it by making a symbolic link in /usr/src didn't work:

Code: Select all

ln -s linux-headers-3.16.0-4-armmp linux-headers-3.4.39-s5p4418-gb1d299d

it still complained.

Yet, under /boot, I see new vmlinuz files but a reboot doesn't apply them. uname -a still reports the original kernel build time.

Possibly a great platform to work on, yet I fail because of missing audio output for my project :/
I finally got it working:
The hunch about compiling the kernel was correct, I simply did the wrong steps. I stumbled over this page on the wiki, where the correct way of compiling the kernel is described.
To know that I needed to build an uImage was the key (and that the right one has to be replaced; there's a difference between uImage and uImage.hdmi)

I compiled the kernel on the device itself. For this I had to install the following packages:
gcc-arm-none-eabi u-boot-tools libncurses5-dev git

gcc-arm-none-eabi might not be necessary, since the compiler tools are already for ARM; either way, the call to make had to be modified:

Code: Select all

make uImage CC=/usr/bin/arm-linux-gnueabihf-gcc LD=/usr/bin/arm-linux-gnueabihf-ld AR=/usr/bin/arm-linux-gnueabihf-ar NM=/usr/bin/arm-linux-gnueabihf-nm SIZE=/usr/bin/arm-linux-gnueabihf-size OBJCOPY=/usr/bin/arm-linux-gnueabihf-objcopy KALLSYMS_EXTRA_PASS=1

Before that it was also necessary to create a symbolic link from /usr/bin/arm-linux-gnueabihf-size to arm-linux-size as the SIZE= parameter was not used at the last compilation step.

And with all of that, I finally got the USB audio device working!
I am new to this forum and I am not expert in technical things but this forum gives me confidence to study more .Thank you for your information.

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 1 guest