Getting the audio injector working with Buildroot embedded!

Moderator: flatmax

Post Reply
jessecobra
Posts: 14
Joined: Tue Oct 31, 2017 3:53 pm

Getting the audio injector working with Buildroot embedded!

Post by jessecobra » Thu Jan 25, 2018 5:35 am

I love the Raspberry Pi Zero W, but I dislike how long it takes to boot using the Raspbian image. 10-30 seconds!

So I went down the path of getting Buildroot working on my Raspberry Pi Zero W and then the Audio Injector sound card.
Buildroot boots on the Zero W in 3 seconds!

Audio works in seconds!

If anyone else wants to try this here is the tutorial I am following: http://www.jumpnowtek.com/rpi/Raspberry ... droot.html
I noticed flatmax had some issues here that I did not run into: https://www.raspberrypi.org/forums/view ... &p=1263867

Here are some of the changes to Buildroot [master] in his [jumpnow] branch that all worked for me.
- Newer versions of the Linux kernel and RPi firmware
- Some custom applications primarily as an experiment in how to add custom packages to Buildroot. The source for all of them are public github repos.
- serialecho - a C, Makefile based app
- tspress - a Qt5 Widgets GUI app using qmake
- pytouch.py - a PyQt5 app
- Custom Buildroot defconfigs to support my images for the RPi boards.
- Sample rootfs overlays to customize conf files. <- This is the important one!

Some patches to the kernel build so that the RPi DTS overlays (DTBOs) are built from the kernel source and not just downloaded from the RPi firmware github repo. This make its a little easier (at least for my workflow) to include custom dts overlays when you need them by just including them as kernel patches.

So lets get started:

Code: Select all

git clone -b jumpnow https://github.com/jumpnow/buildroot
cd buildroot
make jumpnow_rpi0_defconfig
make
It will take a few hours to build the whole system then you image an SD card with the resulting image:

Code: Select all

sudo dd if=output/images/rpi0-sdcard.img of=/dev/sdb bs=1M
After testing this image I added alsa-lib and a few of the alsa test apps:

Code: Select all

make menuconfig 
Add alsa-lib and whatever alsa apps you need in this config.

Also I added PREEMPT support to the kernel:

Code: Select all

made linux-menuconfig
Of course go edit your /boot/config.txt

Code: Select all

sudo nano /boot/config.txt
add: dtoverlay=audioinjector-wm8731-audio
Reboot and you are done!

Oh yea! don't forget to load the alsa settings from the audio injector deb.tar.gz file in the setup thread:

Code: Select all

alsactl --file asound.state.RCA.thru.test restore
amixer sset 'Master' 121
amixer sset 'Capture' 23
alsactl store
I need to do this at every boot, I just added it to an /etc/init.d/S60_audiosetup.sh script!

riedlse
Posts: 2
Joined: Sun Mar 11, 2018 11:55 pm

Re: Getting the audio injector working with Buildroot embedded!

Post by riedlse » Mon Mar 12, 2018 12:10 am

Thank You !!!, just the post I was looking for...

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Getting the audio injector working with Buildroot embedded!

Post by flatmax » Tue Jan 08, 2019 1:05 pm

I just compiled and this works nicely !
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

wh7qq
Posts: 25
Joined: Tue Jun 27, 2017 4:07 pm

Re: Getting the audio injector working with Buildroot embedded!

Post by wh7qq » Sun Jan 13, 2019 7:11 am

Does this work on other RPi models, like the 2B? I should have left well enough alone and had a working stereo card on Jessie but when I upgraded to Stretch, it no longer works at all.

wh7qq
Posts: 25
Joined: Tue Jun 27, 2017 4:07 pm

Re: Getting the audio injector working with Buildroot embedded!

Post by wh7qq » Sun Jan 13, 2019 8:40 am

I stumbled early at

Code: Select all

make jumpnow_rpi0_defconfig

Code: Select all

conf.c:6:10: fatal error: locale.h: No such file or directory
 #include <locale.h>
I am not into C code and don't know where to get this or where it should live when obtained. Any help?

wh7qq
Posts: 25
Joined: Tue Jun 27, 2017 4:07 pm

Re: Getting the audio injector working with Buildroot embedded!

Post by wh7qq » Sun Jan 27, 2019 6:46 am

I managed to build a functional image...boots to a command prompt and does some commands...but now I am all dressed up with no place to go...how to find/install applications? I recommend using copy/paste on the commands...memory or finger failures lead to build errors.

For anyone contemplating this, the buildroot process will use about 2.5 Gig if you are on a metered connection (as I am). The saving in boot time may not be worth the build time plus the acquisition of applications.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests