BUG Community

Welcome! Log In

Forums Applications Module Software Documentation

Subscribe to Module Software Documentation  23 posts, 9 voices

Log in to reply to this topic
Jul 3, 2009 4:51pm
User_img_not_found_02_med cheesebatt 1 post


I’ve been using the bug for awhile and I recently bought the BUGsound module and downloaded phunky, which was cool by the way.  I see that you guys have lots of information on the hardware side of the modules I would like to see more on the software side.  I would like to see more documentation on how to use the hardware in applications, I know you guys have the javadocs but I have not seen any code that might be used to take a sample from the mic on the module.

I’ve been trying to make a music player app and a voice recorder (for notes) app but I’ve hit a wall as far as how to use the module.

Any extra info would be appreciated

Thanks : )

Jul 6, 2009 11:17am
Medium Bug Labs team jconnolly 285 posts

Hey cheesebatt,

With regard to playback you have a number of options with our APi (assuming you’re using R1.4 or later).  One example of an app that uses the audio module for playback is Phunky, though it’s a bit complicated since it uses RAW audio format and has to fudge the WAV headers to conform with an early revision of the API.


There are a few different options for playback, there is the IModuleAudioPlayer service, which will allow you to (asynchronously) play back wav files (encoded at 44.1k, 16-bit stereo, big endian).  There is a class called SynchronousAudioPlayer which is similar, except that it will play multiple streams concurrently, and for the most flexibility, there is a service reference to SoundBackend which would allow you to implement your own audio player, opening and configuring the alsa device to the frequency, bit, channel # of your choice.  In fact, using SoundBackend you can write an ogg playback engine.  Unfortunately at the moment I don’t have an app up that exercises these features, but I’ll try to get one up soon.

With regard to capture, our API doesn’t support it now.  One suggestion is to use the alsa-utils included with your BUG rootfs (aplay, arecord) to capture to a file.  You can write a java app that does this, with something like:

Runtime.getRuntime().exec(new String[]{“arecord”, “hw:1,1”, ”/tmp/myfile.wav”};

I hope this helps, and I’ll work on getting better docs and howtos up in the meantime.

Mar 16, 2011 1:32pm
User_img_not_found_05_med Edrae 25 posts


I try to configure Alsa to get the arecord working but it dosen’t work at all. “arecord -D hw:1,1 -d 5 testsound.wav” do not work.

Could you please help me ?


Is there any chance we get more osgi service to manage BugSound on BugBase 1.x ? It is very frustating to have a module that we can use at 1% of its posibilities.




Mar 18, 2011 6:43pm
Medium Bug Labs team jconnolly 285 posts

BUG hardware 1.3 is not supported anymore, and given that the Audio module is not supported (yet) for bugbase2.0 you’re not going to find much support for it.

The difficulty I’ve encountered with programmaticaly capturing and encoding audio with java are what you might expect: the java-sound API is proprietary and closed, and its open source alternatives are largely abandoned.  The other challenge is that the jvm running on R1.4.3 for our legacy hardware is constrained by the fact that it must be JDK1.4. Finally, there are licensing concerns around the various audio codecs required to encode audio into an interesting format.  Take all of those combined and Java-sound is a pretty tangled nightmare to work with.


Mar 26, 2011 1:29pm
User_img_not_found_05_med Edrae 25 posts

Well… I will say nothing about the speed you withdraw support for previous Bug but help me at least for this issue:

On BugLabs site, there is no more version of Poky for the bug (As found here :
So I tried with the arm version found here :
but it gives a segmentation fault
on Bug.
Could you give the correct version of Poky to code in C?
Or anything to make it works.

I’ll probably never achieve to make a driver but it sounds good to try.

Thank you.


Mar 27, 2011 5:52pm
Medium Bug Labs team jconnolly 285 posts

The packaged toolchains built when building against poky never seemed to work for me.  Personally, I build them myself by initiating a build, then add the cross directory to my path.  For more information on that, see here:


And use this svn url:


Mar 27, 2011 9:43pm
Medium Bug Labs team kgilmer 215 posts


  Yes the support policy regarding BUG 1.x devices is a bummer.  However we will do our best to support users.  I’ve created the toolchain and development libraries necessary for you to code in C as requested.  Please see this post: http://community.buglabs.net/kgilmer/posts/235-Native-SDK-for-BUG-1-x-Devices.  Information regarding how to use the tools is provided in the Poky handbook, as referenced in the post.




Mar 28, 2011 11:55am
User_img_not_found_05_med Edrae 25 posts

Thanks for repling so fast.

I will try all of that. If I already try to follow the article about building the kernel, other informations are new. I will make you know if I succeded or not but it could take some time because I do it after work and because all those “configuration” stuff are a pain for me. All that I know is programming, not using programms…

So, let jump into my old C knwoledge, improve my english by reading documentation and cross-compiling and so on…



Apr 1, 2011 1:02pm
User_img_not_found_05_med Edrae 25 posts

Good news : my Hello World works.


Apr 4, 2011 7:34am
Medium Bug Labs team kgilmer 215 posts

Hi Edrae,

  Good to hear!  Did you build your own toolchain?


Apr 5, 2011 1:06pm
User_img_not_found_05_med Edrae 25 posts

No, I just take the one you built. It works fine and for the moment, I don’t need more.

May be later if I realy try to code my own driver and need to tweak some stuff in the kernel. I doubt to go so far because everytime I do something else than just coding, it boring me :(

For now, I work on a GPS app at the same time I learn the basis of driver programming.

I’m disapointed that not everything comes with the module… Nevermind, going ahead. I’m kind of Bug because I can easily code hardware, so I’m disappointed when not everything comes with the bundle. And afraid when my hardware is no more supported and so I cannot hope for improvement.

(I feel that is one of my most important piece of broken english ! Sorry and hope you understand without difficulties. And hope you don’t take that as an attack or violent thing, I cannot be as subtile as I wish in english.)

Apr 13, 2011 5:39pm
Medium GNUtoo 10 posts


I don’t think that writing a sound “driver” is hard anymore:

nowadays, it’s a mather of configuration in C,

That is to say, you have to use the sound/soc/ kernel API and connect together the various drivers:

  •  The CPU DAI ( Digital audio interface )
  •  The CODEC ( The chip in the bugsound )

The problem will be the integration with the BMI system, I’ve no idea on how to do that.

BIG WARNING: I didn’t check if the bugsound is compatible with the bug 2.0 at the hardware level(for instance if you plug it,I don’t know if it will break or not)





Apr 20, 2011 11:32am
User_img_not_found_05_med Edrae 25 posts


You said almost everything about what is frightening me : configuration. C is not a problem even if I didn’t use it since 10 years, I was good and it’s like riding a bike : you never forget. The problem is that I have to learn all about low-level, hardware and even vocabulary. It never realy interest me and I wasn’t serious at school…

I will try to make the minimum : record and play sound in at least mp3 and ogg. No matter the way, real driver or backport exploitation with ioctl. Even with this spirit, I think it wil take me a long time. Because of difficulties and because the Bug is just one of my hundred intersest !

What is cool is that even if I don’t achieve this, I will learn a lot of things.

When I will realy began (just reading doc for now) I will probably open a thread in the forum to get help from BugLabs teams and guru.


Apr 20, 2011 1:19pm
User_img_not_found_05_med Edrae 25 posts

Oups, I forgot : I have a Bug 1.x edition, so compatibility with  Bug 2 is not a problem for me. Is one of my problem : why launch a second edition when first one is not fully functional ?

In over hand, that’s right that BugLabs team continue to answer and help Bug 1 owner and I have to thanks them for that.

So : thank you BugLabs team !

Apr 20, 2011 4:55pm
Medium GNUtoo 10 posts

I have good news,

there is a 2.6.35-linaro kenrel on github.

This kenrel has support for the bugsound.

I tested it and here is the results of the tests:

  • sound speed is perfect(bug 1.x had issues with it)
  • the controls are not great(they are the same than the internal bug 2.0 sound card), but that is easy to change.
  • some small very pops when you launch a new song, that’s fixable too(basically it is the order of the power up and down that is wrong).
  • sound quality is really good(specially at lower levels).
  • you have to mess up with  alsamixer -c 1  by default I can ear sound only in the right part of my headphones, if you want I can look and create an asoundrc for you for when you will have the bug 2.0

example of use:

mplayer -ao alsa:device=hw=1 Blender_3D_Trailer-320x240.avi -vo xv -fs

here’s the module loading:

root@bug20:~# modprobe bmi_audio
[  740.010559] BMI Audio driver loading…
[  740.014892] regulator: 1V8: 1800 mV
[  740.018951] regulator: 3V3: 3300 mV
[  740.284942] bmi_audio: activate slot0
[  740.294219] asoc: tlv320aic3x-hifi <-> omap-mcbsp-dai.2 mapping ok
[  740.442840] bmi_audio: slot0 IOX=0×1d
[  740.446929] input: bmi_audio_status_m0 as /devices/virtual/input/input4
[  740.960205] bmi_audio bmi-dev-0: Probe returned: 0×0
[  740.965393] bmi_audio: BMI_AUDIO Driver v1.0


Apr 21, 2011 9:47am
Medium Bug Labs team jconnolly 285 posts

Denis, the right-channel issue is known.  Waiting to hear back from Tim Harvey who did the work to get it working this far with .35…

Apr 22, 2011 7:14am
User_img_not_found_05_med Edrae 25 posts

To be sure of what you’ve said :

You installed the Linaro Kernel in place of the one provide by BugLabs and then loaded the appropriate module ? In this case, you lost Concierge and over stuff provided by BugLabs ? It’s still a good news indeed.

Another point, you tried it on bug 1.x AND bug 2.x or just Bug 2.x ?

I wrote my precedent post after cocktail hour (there’re missing words…), and I must specify things about my Bugs : I have a Bug 1.x and I cannot afford a Bug 2.x, even with the bargain for early adopter. So, I’m only interest in sound for 1.x.


I must confess that all of this exceed my knowledge, so please, be patient and thank you for being concern by this. I run Linux for ten years now but I never went into the “motor”. I’m a casual user and I only code business programms for personal purpose or work. 

Apr 25, 2011 9:27am
User_img_not_found_05_med Edrae 25 posts

Recording works !

I don’t understand why by now and some questions remains but reading code and notes from Tim’s driver on github as you suggest and some over doc, just changing ALSA ”-D” make recording works.

What I did is :

  1. Check sound cards with cat /proc/asound/cards => BugBaseAudio, PIM_AUDIO13 and PIM_AUDIO24
  2. Find in Tim’s notes and exemple : aplay -D plughw:1 /usr/share/sounds/alsa/Front_Center.wav Right, before, I used to use ”-D hw:1,1” wich was find to play but not to record.
  3. Recording doesn’t works with plughw:1 (PIM_AUDIO13 I guess) so I tried plughw:2 (PIM_AUDIO24 ?) and it works !

So comand lines are :

arecord -f cd -D plughw:2 -d 5 test.wav

aplay -D plughw:2 test.wav

Obivous when you know…

I just found that and I don’t search explanation yet. Main questions are :

Why two PIM_AUDIO ?

When I listen with -D plughw:1 : it works, if I listen after with 2, it works, then back to 1 and no sound. Like if use plughw:2 disable plughw:1.



Sep 24, 2012 2:24am
User_img_not_found_01_med hanyouya8 1 post

Coach Factory Outlet Online
, Coach Outlet Store Online
, Coach Bags Sale
, Coach Factory Outlet

Sep 26, 2012 10:34pm
User_img_not_found_06_med jeremy2135 5 posts

The violence and misdirection that allows kids to attach status to things like shoes — that does seem to be exclusive to urban communities. But going after airmax pas cher isn’t going to change that.Each pavilion stands at over three stories tall and houses an interactive Nike kinetic experience. The Speed Tunnel Pavilion is a real-time showcase of the running events being held on Hayward Field through the use of a 100-foot LED-screened wall. The pavilion also highlights air max 90 pas cher’s latest Speedsuit technology. The Shoelab Pavilion displays examples of Nike’s newest footwear by creating human-scale sculptures of the Lunarglide foam and Flyknit thread. The Lunar wall displays the newest Lunarglide shoes on a sculpted foam wall inspired by the shoe’s sole. “Nike. They embraced how digital can create entirely new business models for them while simultaneously enhancing their offline business.”—Kenny Tomlin, CEO, Rockfish.In one form, an analysis of your swing would be shown on a screen located on the back of the club’s head. air max pas cher thinks this would help with custom fitting, making it more accurate and efficient. But if you’re a club-throwing Gilmore type who gets incensed when your game is off, you might want to consider something less breakable.

Sep 28, 2012 4:24am
User_img_not_found_02_med syang121 8 posts

North Face Outlet http://www.northfaceoutletberkeleysale.com/
North Face Outlet berkeley http://www.northfaceoutletberkeleysale.com/
canada goose outlet http://www.canadagoosemall.com/
canada goose jacket http://www.canadagoosemall.com/
supreme clothing http://www.supremeclothingonline.net/
supreme hats http://www.supremeclothingonline.net/

Oct 24, 2012 2:00am
User_img_not_found_01_med qazqazqaz 469 posts

As a perfect combination of classic and modern fashion,Coach Outlet Online Julia Bags can show the customers'unique personality.Tiffany UK grabbed the globe, stands out as the celeb on their favorite stars luxury type, granted an innovative simple move the pavement luxury, complete with luxury.In terms of the quality and superior design that make more and more customers are satisfied to Coach Factory Online.Welcome!hat experts claim Coach Outlet Online shopping is in the changes they are available in.As long as you open our Coach Factory Outlet webpage, you will view various Coach New Arrivals which are the most popular also the most fashionable in this year.On the date when the Louis Vuitton UK on sale, all people will pour into the stores. At this time, it on the booths will be wiped out, and only one or two days the seller will declare that there is no stock anymore.

Oct 24, 2012 4:17am
User_img_not_found_01_med qazqazqaz 469 posts

Remember that the right accessories can enhance your alluring look with your Canada Goose Parkas Outlet.Baggy, ovoid shaped Canada Goose Jackets Outlet that are rounded around the shoulders look fabulous and can be a perfect match for you.This excellent conviction so that you class gets to amateur Canada Goose Outlet In a number of Parka, for example Young Canada Goose affordable Cardigan.Luxury has always been synonymous with fur and leather and this year a faux fur Canada Goose Jackets Outlet will surely be the key piece of your wardrobe.

Log in to reply to this topic
Forums Applications Module Software Documentation

Powered by Community Engine