Jump to content

Alsa Sound on A31s based Banana Pi M2 (BPi-M2)


NewtoM

Recommended Posts

Hello there,

 

I belong to the group of users that bought a BPi-M2 to just find out that hardware is nothing without software support. :)

 

First, to my background: I do spend a lot of time at my computer using both Windows and Linux, but I am not a Linux guru. I used to configure and build kernels several years ago, at the time, when we used LILO to boot Linux. My field of interest is real-time sound processing, based on complex filter banks (ideally implemented using multi-threading). For a current project I needed something small, powerful and easily programmable. Since the BPi-M2 has 4 cores and built-in microphone, it seemed ideal for the first tries.

 

Anyway, I tried quite some Linux images available on the Internet, but they all suck in one way or another. Some days ago I crossed a posting of Igor and I downloaded armbian 4.5 (Debian Jessie) for the board. I instantly liked it. I love simple and clean things, and the distro was just that. Since then, I updated the kernel, installed X with LXDE, and installed Code::Blocks 13.12. I still like this distro most. Slow graphics of course sucks with the default framebuffer driver, but the real problem for me is the missing audio support.

 

As far as I understand from the Linux mainlining effort web page, the A31 audio codec driver is not even planned for kernel 4.5. And this is what I do not understand: how can Ubuntu Mate (kernel 3.3.0-BPI-M2) support the sound (both sun6i-codec and sndhdmi with ALSA v1.0.24) and the new kernel not? And why is it so complicated to put the sun6i-codec driver from the 3.3.x kernel to the 4.4.x kernel?

 

Please wise me up!

Thanks!

 

NewtoM

 

ps: BTW, I am happy to help with testing!

Link to comment
Share on other sites

how can Ubuntu Mate (kernel 3.3.0-BPI-M2) support the sound (both sun6i-codec and sndhdmi with ALSA v1.0.24) and the new kernel not?

Because board manufacturer took whatever kernel was available in the SDK and made some Debian/Ubuntu images with this kernel. 

 

And why is it so complicated to put the sun6i-codec driver from the 3.3.x kernel to the 4.4.x kernel?

Kernel internal structures, APIs and whatever else was changed, so new driver needs to be made from scratch, and it's not easy without proper documentation. Plus audio driver is not that simple - it depends on implementing PLL and DMA drivers first.

 

Please wise me up!

If you want to use Armbian and mainline kernel, just buy cheap and simple USB sound card and some kind of microphone. I don't know if this will give you low enough latency for real-time sound processing, but it's better than nothing.

Link to comment
Share on other sites

Hey,

 

thanks for the quick reply.

 

Kernel internal structures, APIs and whatever else was changed, so new driver needs to be made from scratch, and it's not easy without proper documentation. Plus audio driver is not that simple - it depends on implementing PLL and DMA drivers first.

 

 

OK, but as I see it, the changed internal structures and APIs should have had an impact on all drivers that were ported from the 3.x kernel. PLL and DMA drivers are already there, aren't they? So is there anything especially tricky (except for the lacking documentation) about the A31 audio codec driver?

Link to comment
Share on other sites

Some kernel parts change more than others.

According to "Linux mainlining effort" page, DMA support is not complete and PLL is not implemented yet for A31.

 

It's not exactly tricky, but you have to consider some things:

First, there are strict rules and guidelines for getting things into mainline kernel, so you can't just quickly produce some untested spaghetti-style code and hope that it will work like intended and doesn't break anything.

Second, this type of work is mostly done by enthusiasts who do programming as a hobby, so you can't complain here that driver writing is not going fast enough.

 

Before mainline kernel 4.3 I didn't have onboard audio support on cubietruck and I too wondered, what could take so long. Then I saw PLL patch for A10/A20 SoC. No more questions from that point.

Link to comment
Share on other sites

OK, it is getting clearer. :)

 

so you can't complain here that driver writing is not going fast enough

 

I am not! My mistake if it read like that.

 

Then I saw PLL patch for A10/A20 SoC. No more questions from that point.

OK, I see.

 

Thank you!

And happy new year!

Link to comment
Share on other sites

Hi,  another BANANAPI-M2 sucker here.... It is so sad that a H/W manufacturer releases a great piece of hardware and has no ability to provide the software to make it achieve its potential - ARMBIAN is the best distro  I have used so far for this type of board, however I will think very long and hard before buying another Bananapi product. 

 

Sound is broken, video is broken and probably a few other things I can't find yet due to no proper drivers/support. Any ideas on how to make some of the good stuff work on this board?

 

 

Link to comment
Share on other sites

I will think very long and hard before buying another Bananapi product.

Actually, the sinovoip manufacturer used name "BananaPi" due to success of LeMaker's Banana Pi and Banana Pro. For the next time you may read about another product at sunxi's wiki - http://linux-sunxi.org/Identification_guide

 

Any ideas on how to make some of the good stuff work on this board?

I've made Wi-Fi and GPIO working with armbian on my BPi-M2. Reply, what you're interested in.

Link to comment
Share on other sites

Hey again,

 

I downloaded and tried "Armbian_5.00_Bananapim2_Ubuntu_trusty_4.4.1_desktop". On the download page (http://www.armbian.com/banana-pi-m2/) it says that with the Vanilla kernel (4.4.3) audio devices (analog playback and capture) are enabled. How do I upgrade to 4.4.3 kernel (apt-get update; apt-get upgrade does not seem to suffice)? Do I have to do further steps to have a working audio system?

 

Thanks!

NewtoM

Link to comment
Share on other sites

How do I upgrade to 4.4.3 kernel (apt-get update; apt-get upgrade does not seem to suffice)? Do I have to do further steps to have a working audio system?

 

New kernels will be 4.5.2 or 4.5.3 ... by the end of the month. Than you will be able to upgrade.

 

Audio is done for most popular: A10 and A20, unfortunately M2 uses less supported chip - I think there is no audio support yet, not even in latest kernel. It's not expected that it will be available soon.

Link to comment
Share on other sites

OK, thank you, Igor.

In this case, it is just misleading to have that sentence on the BPI-M2 page, I guess.

Yes, I added note to the "Bugs". That's all I can do.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines