1 2 Previous Next 22 Replies Latest reply on Jul 12, 2015 8:09 AM by Koen.Bruyninckx

    How to play audio on Edison - instructions

    AlexT_Intel

      Responding to several threads on the matter I realized it's worth summarizing the steps necessary to enable audio playback on Edison, so I went ahead and created a blog post: http://alextgalileo.altervista.org/blog/lets-make-noise-play-audio-edison/

       

      This thread is for your feeback or any additional questions you may have.

        • 1. Re: How to play audio on Edison - instructions
          Jozef Tanzer

          Hi.

          I really enjoyed your latest blog but I still have a question. Is it possible to play audio without a USB sound card just by using a usb headset/mic/speaker. I need to make Edison play audio and make it all as small as possible and I think having to add a sound card could be a problem sizewise.

           

          Also sorry if I sound like an idiot now, I am new to this stuff.

           

          Any help would be appriciated.

          Thanks

          • 2. Re: How to play audio on Edison - instructions
            AlexT_Intel

            Hi Spanky1999

             

            No worries, it indeed looks like you're new to this stuff, but that's fine - everyone is new to something at one point or another

             

            In short - to be able to play sounds on any computer, you need a "sound card" (let's simplify, it can mean different things in reality) - something that will convert binaty data to an actual analog signal.

            Edison does have a part of it, however it's not currently fully enabled + there's simply no audio jack for you to connect to as this audio piece needs some additonal components to form a complete solution.

             

            So the easiest way is to get a USB sound card or an equivalent device - like USB DAC or USB headset (both these look to Linux as such "sound cards" and I've tried both to work fine with Edison). Even an external Bluetooth device supporting A2DP profile would be good enough for Edison to that matter. Or external active speakers with USB connection to the PC. These days you can find this "sound card" piece bundled in many different devices, some of which previously required a separate one (e.g. headsets or speakers).

             

            Now back to your exact question - if you have namely a USB headset as you mentioned, then you should be good without any additional HW. If you read my blog post, then you'll see that I've actually used a Plantronics USB headset when writing it, not a standalone USB sound card

            • 3. Re: How to play audio on Edison - instructions
              Jozef Tanzer

              Hi.

              Thanks for your response. I was just a little worried because you wrote about using a headset but I wasn't sure because USB headset come in different types and everything. But thanks for your reasssurance, you were most helpful.

               

              So thanks again and please keep doing your great blogs, they are very helpful since there is not much written about Edison yet and some of the guides for other devices don't work with edison and it gets quite frustrating.

              • 4. Re: How to play audio on Edison - instructions
                AHoopyFrood

                Just wanted to point out that simply installing kernel-module-snd-usb-audio instead of the entire new kernel worked like a charm. The one difference is that you have to run opkg install mpg123 since its not included with usb-audio or alsa.

                 

                Now to figure out how to implement this with my project...

                • 5. Re: How to play audio on Edison - instructions
                  AlexT_Intel

                  Right, thanks for reporting that. It should work, so I've added a reference to this method to the blog post (in the step #2), it's just that I haven't specifically tested that. And now we have a confirmation

                  • 6. Re: How to play audio on Edison - instructions
                    mpenna

                    Very nice post indeed! Been searching high and low for information on how to get audio from the Edison and your posts on this subject are hands down the best ones around. I haven't tried the steps you have pointed out yet, but I was wondering if you could shed some more light on the hardware/wiring aspects of the problem. I want to use the Mini Breakout board and I believe you mentioned somewhere that by using a USB audio adapter connected to the Edison's OTG USB port that the soundcard would need to be powered externally. Is this so and, in case it is, how did you manage to solve this in your particular situation? I have a USB audio adapter that I bought to use with my Raspberry Pi (USB Audio Adapter - Works with Raspberry Pi ID: 1475 - $4.95 : Adafruit Industries, Unique & fun DIY electronics and kit…) and was wondering how would it be possible to have it powered externally. Any ideas?

                    • 7. Re: How to play audio on Edison - instructions
                      mpenna

                      Going through the Mini Breakout's hardware guide, I noticed that the Edison outputs 3.3V through its J20-2 pin. If we convert that to 5V via an external converter, do you think this could be a good alternative for powering the audio adapter? Do you know if the Edison can source enough current through that pin in order to power the adapter?

                      • 8. Re: How to play audio on Edison - instructions
                        AlexT_Intel

                        you mentioned somewhere that by using a USB audio adapter connected to the Edison's OTG USB port that the soundcard would need to be powered externally.

                        Nope, not really. If you use a USB sound card, it will in most cases be satisfied with the power supplied by the USB. I used the Arduino breakout board, not a mini-breakout one, but generally speaking this piece of functionality should be the same across both. -just make sure your power adapter (or battery), you use to power your Edison+mini-breakout combination, has enough juice to power Edison itself and the USB sound card (check the HW Design Guide for electrical specifics and requirements for connecting peripherals to the OTG port).

                        • 9. Re: How to play audio on Edison - instructions
                          mpenna

                          Sorry, I got that confused. Actually it's the hardware guide for the mini-breakout that states something along those lines. It says that "USB host mode always requires use of an external power adapter". Not completely sure (and the guide is not totally clear on this) if the power coming from the external supply will indeed flow-through to the device plugged into the mini-breakout's USB OTG socket. The mini-breakout has 2 USB sockets but only one allows for the Edison to function as a USB host. It's a micro-AB OTG port that, depending on the USB cable being used, will make the Edison work either as a device or a host. The thing is that when working as a host they say whatever's plugged into the socket will need to be powered externally. Not sure if I explained it right, but hopefully it makes some sense.

                          • 10. Re: How to play audio on Edison - instructions
                            AlexT_Intel

                            Yes, it does make sense - and that's exactly the same thing I referred to (maybe in a bit non-obvious fashion, now that I re-read my previous post ). What that "requires use of external power adapter" means is that you need to power your board  from either a battery (but as long as in this case it won't supply power to the USB peripherals, it may be not useful to you) or a wall socket when using OTG - because that's the same port you otherwise would use for powering the Edison itself.

                             

                            It's not about powering your USB peripheral, it's about powering the board itself when using USB in a host mode.

                             

                            Check out section 2.1.1 of the HW guide, it has more detailed description of this functionality.

                            • 11. Re: How to play audio on Edison - instructions
                              mpenna

                              Thanks. I'll have a look at the whole document again, paying special attention to the section you pointed out. I'm not a "hardware guy", so when it comes to putting together components, circuits and all that, it basically boils down to me depending mainly on good tutorials and walkthroughs.

                              • 12. Re: How to play audio on Edison - instructions
                                tintar

                                it's a topic that is still not always easy to understand how Edison behaves with respect to power.

                                 

                                the manuals are pretty clear, but the behavior doesn't always quite match it.

                                 

                                e.g. for the first couple months of using a Mini board, I was doing sort of a "wrong" thing, but it worked. most of the time.

                                - battery backup on J2.

                                - nothing on J21.

                                - primary power via generic ~5V@1A USB 4-port hub + OTG adapter wire, on J16.

                                 

                                but once in a while it would glitch (maybe just b/c it was a cheap hub, or weird spikes/drops in the AC mains, ?), lose the otg mode (y'know, our favorite lsusb -99 error) and sometimes it would recover from that, sometimes not. the system would still continue running perfectly fine from the battery, but e.g.the flash drive plugged into the hub would unmount and not recover. 1 flash drive, doesn't take much power at all to run. as AlexT pointed out, it's about make sure the port stays enabled.

                                 

                                some of those times, a reboot would make otg happy again. some other times, I had to remove the battery from J2 and that might be enough to re-enable usb host. sometimes it would take unplugging the battery AND a hard-boot, ha.

                                (the assumption being that any time the machine things that the only P/S is battery, it says to itself: "~4V? no more usb for you." ...? at least that is my understanding.)

                                 

                                after too many times of that, I added 12V on J21. (oddly, I seem to recall people questioning once or twice on this forum, whether it was safe to have 3 power sources connected all at the same time - but after some months of having power connected to all three of J2, J16, J21, nothing asploded or burnt, seems stable, magic smoke still safely sealed inside. does not run at all hot or even warm, so I'm not too worried about component stress.)

                                • 13. Re: How to play audio on Edison - instructions
                                  mpenna

                                  Well, my goal for this proof-of-concept project based on the Edison and the mini-breakout board that I'm currently working on is to have the Edison be powered by a LiIon battery connected to J2 and to be able to play audio through an external USB audio adapter connected to J16. Sort of a portable audio-player. At the same time, it would be a plus if we could take advantage of the Edison's battery recharging capabilities -- i.e. recharge the battery whenever an external power source is connected to either J21 or J22 (probably J22 by means of a wall wart). What would you folks say? Feasible?

                                  • 14. Re: How to play audio on Edison - instructions
                                    AlexT_Intel

                                    I think that's quite feasible. If your speakers/headphones are Bluetooth-enabled (or if that's an option for you in your project), then you can ditch the USB audio adapter and use BT A2DP profile to stream audio directly. Would be even more portable

                                    1 2 Previous Next