bsteinsbo / DE1-SoC-Sound

GNU Lesser General Public License v2.1
17 stars 16 forks source link

Beginner with ALSA SoC Drivers #1

Closed jazcarretao closed 7 years ago

jazcarretao commented 8 years ago

Dear Bsteinsbo,

I am a Master Thesis student who is working in a similar project to the one you posted. I am using Altera DE1 board to collect data from an array of 48 microphones and to do some processing in the ARM processor. The final objective of the project is to output this data from the DE1 Audio Codec after doing signal processing to the input data.

So far, I was able to design an SPI communication and a DMA between the microphones array and the SDRAM memory of the FPGA part (thus the microphones data is properly saved in the FPGA). Hence, I am kind of beginner when using the Audio CODEC and the ALSA SoC Drivers (from this second part I do not find lot of information in the internet). I would like to ask you which design workflow or resources you have used in order to complete your project and to get more familiar with DE1 board for this application. I have the programming skills but I am not very use to working with DE1 board. So any advice will be really helpful. Here is my email in case you can send me some resources or you want to contact me more carefully: jazcarretao@gmail.com

Thanks a lot for your attention, as I told you before, in my situation, any advice is really helpful!

Best, Juan

bsteinsbo commented 8 years ago

Hi,

Sorry about my late answer. I have been away during Easter vacations.

I fully sympathize with your problems about finding relevant documentation for creating ALSA SoC drivers, I had the same struggle creating my own simple driver. I never really found anything much useful in the form of written documents and guide lines. Sorry.

The only good thing is that all source code is available, for ALSAlib, and for the different kernel sound layers. Not being much of an expert on these matters myself, I don't have much advice to offer. Also, I don't really remember the fine details anymore; I haven't really come back to that project since I finished it as far as the github repository results show.

For me, I think the break-through came when I finally decided to add trace prints (dev_dbg) to existing code in the ALSA Soc layer and followed the code flow into my own driver that way. I still remember the feeling of "shit, it wasn't that difficult after all". Start in user-space and run "strace" on a command like "aplay some-file.wav" or "arecord some-file-wav". Look for the sound related system calls. Follow those calls into into the kernel, and see how they are dispatched via the ALSA SoC layer to your own driver, or to some other ALSA SoC driver that works on your hardware. Add "dev_dbg()" calls at places where you're not sure where the code ends up, and learn about Linux dynamic debugging in e.g. https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt Start simple, with just a skeleton of a driver where you can learn which callbacks are called at which time in the playback or capture process. Add code to that skeleton to deal with your own hardware.

Good luck with your thesis. I'm sure you will learn a lot from it.

Best regards,

Bjarne Steinsbo

On Wed, Mar 23, 2016 at 11:52 AM, jazcarretao notifications@github.com wrote:

Dear Bsteinsbo,

I am a Master Thesis student who is working in a similar project to the one you posted. I am using Altera DE1 board to collect data from an array of 48 microphones and to do some processing in the ARM processor. The final objective of the project is to output this data from the DE1 Audio Codec after doing signal processing.

My main problem is that I lack some background to perform this project. So far, I was able to design an SPI communication and a DMA between the microphones array and the SDRAM memory of the FPGA part (thus the microphones data is properly saved in the FPGA). From here, I am kind of beginner when using the Audio CODEC and the ALSA SoC Drivers (from this second part I do not find lot of information in the internet). I would like to ask you which design workflow or resources you have used in order to complete your project and to get more familiar with DE1 board for this application (because I am doing this project practically alone). I have the programming skills but I am not very use to working with DE1 board. So any advice will be really helpful. Here is my email in case you can send me some resources or you want to contact me more carefully: jazcarretao@gmail.com

Thanks a lot for your attention, as I told you before, in my situation, any advice is really helpful!

Best, Juan

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/bsteinsbo/DE1-SoC-Sound/issues/1