Recommended workflow for audio codec driver development in BBB.

126 views
Skip to first unread message

Rafael Vega

unread,
May 8, 2016, 6:33:06 PM5/8/16
to BeagleBoard
Hello.

I am hacking on the driver for the tlv320aic3x audio codec. I'm cross-compiling the kernel using the scripts at https://github.com/RobertCNelson/bb-kernel.

What I'm doing is editing the code in KERNEL/sound/soc/codecs/tlv320aic3x.c, running tools/rebuild.sh and then copying KERNEL/sound/soc/codecs/snd-soc-tlv320aic3x.ko to my BBB in /lib/modules/4.4.9-bone-rt-r10/kernel/sound/soc/codecs. This works and the module loads and runs fine. However, running tools/rebuild.sh sometimes takes a really long time. Is there a quicker way to compile and load a module, can anyone suggest a better workflow?

Thanks!

Robert Nelson

unread,
May 8, 2016, 7:56:31 PM5/8/16
to Beagle Board
Use a faster build host.. ;)

Regards,

--
Robert Nelson
https://rcn-ee.com/

Rick Mann

unread,
May 9, 2016, 1:16:05 AM5/9/16
to beagl...@googlegroups.com
I've always felt like it should be possible to just rebuild the module. Is it possible to cd to some subdir and hit "make"? Something to avoid all the work the script repeats?

Thanks.

--
Rick Mann
rm...@latencyzero.com


John Syne

unread,
May 9, 2016, 1:25:44 AM5/9/16
to beagl...@googlegroups.com
Sure you can, just run the "make -jx LOCALVERSION=xxx ARCH=xxx CROSS_COMPILE=xxx modules" command that is displayed in the script.

Regards,
John
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/0B3A9AA4-6D06-4249-934E-55F59603F2FE%40latencyzero.com.
> For more options, visit https://groups.google.com/d/optout.

Rick Mann

unread,
May 9, 2016, 2:00:37 AM5/9/16
to beagl...@googlegroups.com

> On May 8, 2016, at 22:25 , John Syne <john...@gmail.com> wrote:
>
> Sure you can, just run the "make -jx LOCALVERSION=xxx ARCH=xxx CROSS_COMPILE=xxx modules" command that is displayed in the script.

That target implies all the modules. I'd like to avoid all the dependency checking for all the other modules. Nevertheless, I'll try that, see if it saves time.

Thanks!
> To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/82EB3B08-2DDF-4774-BEF6-955819E1D45D%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.


--
Rick Mann
rm...@latencyzero.com


Greg

unread,
May 9, 2016, 9:50:57 AM5/9/16
to BeagleBoard
I think you want an "out of tree" module:


Note that it says this is the way a kernel module is initially developed.

Greg

John Syne

unread,
May 9, 2016, 3:01:51 PM5/9/16
to beagl...@googlegroups.com
I modified the file you are building and the build takes all of about 2 seconds. How much more time do you want to save?

Regards,
John
> To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/920FE527-351F-456E-8894-574F669EA49F%40latencyzero.com.

Rafael Vega

unread,
May 10, 2016, 8:36:07 AM5/10/16
to BeagleBoard
Thanks everyone for the replies :)





john3909 wrote:
I modified the file you are building and the build takes all of about 2 seconds. How much more time do you want to save?

When I edit the file and then run scripts/rebuild.sh, it opens Menuconfig, I close it and then it starts issuing many CC commands that take about 2 minutes to complete.

If I run the following instead, it takes a little longer than a minute

`make -j4 ARCH=arm LOCALVERSION=-bone-rt-r10 CROSS_COMPILE="ccache /home/rvg/Desktop/bb-kernel/dl/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-"  modules` 

My machine is not (so) slow, it's a dual core i7 (4 cores seen by the kernel), about 5 years old, with 8GB ram.

What did you run that took 2 seconds?




Greg wrote:
I think you want an "out of tree" module:

Thanks! I'll try that!

John Syne

unread,
May 10, 2016, 3:22:45 PM5/10/16
to beagl...@googlegroups.com
OK, so on my stopwatch, it takes 9.88 seconds.

john:~/Download/GIT/ti-linux-kernel-dev/KERNEL$ touch sound/soc/codecs/tlv320aic3x.c
john:~/Download/GIT/ti-linux-kernel-dev/KERNEL$ time make -j8 ARCH=arm LOCALVERSION=-ti-r33 CROSS_COMPILE="/home/john/Download/GIT/ti-linux-kernel-dev/dl/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-" modules
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CC [M]  sound/soc/codecs/tlv320aic3x.o
  LD [M]  sound/soc/codecs/snd-soc-tlv320aic3x.o
  Building modules, stage 2.
  MODPOST 1940 modules
  LD [M]  sound/soc/codecs/snd-soc-tlv320aic3x.ko

real 0m9.879s
user 0m29.488s
sys 0m6.005s


Regards,
John




--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages