Sound with LOGI-Bone

Hi All -

I'm pretty new to all of this (BeagleBone, LOGI-Bone, FPGA, etc.) but want to learn. 

I have a working setup of a 32x32 LED matrix based on the Ubuntu 13.04 distro and the code, etc... I found here. 

Now I would like to add the ability to utilize sound to this setup. An initial idea I have is to sample incoming sound and make the display react to it, perhaps perform a FFT and make the display behave like one of those liner equalizer displays. 

I spent a couple of hours trying to get a C-Media based USB sound card to work with Alsa, but have had no success. Got stuck with arecord not being able to set install the hw params of the sound card...

Can someone suggest either an Arduino shield or a BBB cape that will work with this setup? I believe it shouldn't interfere with the signals used by the LOGI-Bone and be recognizable by the BBB, but am not yet well versed in this stuff.

Thanks in advance.
John

Comments

  • edited June 2016
    Hi There,

    I can't suggest a specific shield, but can suggest that you find one that interfaces via spi or i2c as these will not conflict while using the FPGA/BBB.  There should be a number of shields that have such as interface.  In the worst case you could roll your own via breadboard and then jumper the SPI/ADC to the FPGA or BBB.  Hope this helps.


    Also, there should be some sound/audio pmods available as well.  
  • Thanks very much for your response. I'll look at the SPI or i2c solutions, as I'd like to learn about those interfaces. 

    But in the meantime, I've been playing around with the digital pins from the Arduino connector. It looks like at least some are connected to various pins in the BBB connectors. I have managed to successfully read a couple of them, but it looks like some are connected to pins that are "allocated" to the group "pinmux_fpga_config_pins" or "mcasp0_pins" and this is preventing me from reading the input from the Arduino connector. Is that what you are referring to when you say "conflict while using the FPGA/BBB"? i.e. some Arduino pins are not actually available for use by the BBB? 

    Is there any better documentation as to how to use these arduino pins? I noticed that there is a video of a motor control shield running on top of a Logi-BONE. Is that code available for reference?

    I have even been messing around with some of the device tree tutorials in an effort to access the pins that are "allocated" but to no avail. It's kind of confusing as to whether the device tree stuff is even relevant for my distro. I am using your Linux arm 3.8.13-bone63 distro. Is the device tree a way to control the functions on these pins for this distro or am I on the wrong track here?

    I also tried disabling HDMI in the uEnv.txt file, hoping that this would free the pins (101, P9_29 & 103, P9_29) from the mcasp, but that didn't help.  

    I did manage to add one GPIO to the LED Matrix FPGA configuration by moving the LED memory up in the memory space by 0x1000 and allocating lower addresses for the GPIO. The LED matrix works fine at the new address, but I haven't tested the GPIO yet. 

    I know that's a lot of questions, and I sure appreciate your assistance in getting up this learning curve. 

    John

    PS Thanks for the info on the pmods, but I can't use them for this application, as those connectors are already used by the connector to the LED matrix. 
  • Hi John,

    @jpiat has a lot more experience with the pin muxing and I have asked he can comment on setting up/using the pins.  It seems that pin muxing changes as the kernel progresses and I am not well up to date.  Depending on what BBB peripherals you are using, you may need to change device tree setting which are loaded from the eeprom.  I believe that HDMI is disabled when using the logi drivers as it conflicts with the GPMC bus.  Jonathan will have more info for you.   

    I agree it's a hassle having the shared pins, but we were limited with the number of pins on the FPGA.  
  • Also, after thinking about it you may be better off using and I2S audio shield/cape/pmod.  You could use jumper wires to wire it to any pins available on the FPGA if you are using all the pmods.  It also look like hamster has a great tuturial and code for interfacing with a pmod/i2s device.  http://hamsterworks.co.nz/mediawiki/index.php/Pmodi2s
  • Thanks! Not complaining about any hassle. Just trying to understand. Looking forward to Jonathan's input. 
  • Hi,

    i did something quite similar when we designed logi-face (). What i did at the time was to use a usb sound card and i soldered a wire to the the biased audio output on the USB dongle which was then wired to a MCP3008 connected to the FPGA over i2C. The FPGA would then read the MCP3008 and make the face mouth react to sound.

    For the pin-muxing, things changed a lot lately, and depending on your kernel version many of the device tree tutorial may not work. In the early day one would design an overlay which was a way to change pins functionality at run-time. Now device tree does not support overlays anymore and any pin-muxing have to be performed at boot time (device tree loaded at boot).

    The pins that belongs to the group fpga config pins are used to bit-bang the FPGA configuration protocol but theoretically they could be used by the user when no FPGA configuration is ongoing. The problem is that when the device tree overlay for the logibone is loaded, these pins are considered used and cannot be released for the user. Before device-tree we could use these pins as IO for the FPGA configuration and then switch them back at their initial state after the config is done.

    If you want to read the audio from the BBB to then send data to teh FPGA to modify the matrix display, you could hook an i2c ADC to the BBB IOs to sample the audio. The easier way would still be to use ALSA, and i can help with this if you want.


  • Hi Jonathan

    Thanks so much for the answer and your advice.

    In the meantime, I have continued to experiment with the device tree overlays, which I seem to be able to load post-boot. I'm using your distro 3.8.13-bone63. I was able to gain access to pin P9_29 through the use of the directive exclusive-use = "P9.28","gpio3_17"; in the dts file. So it looks like I am using one of the "older" kernels.

    I tried to get one of these Plugable USB audio dongles (http://plugable.com/products/usb-audio) to work with ALSA but ran into a dead end as ALSA couldn't seem to recognize the device and Plugable's support was of no help.

    I've also figured out how to access the A/D inputs of the BeagleBone, so I might just try to wire the USB dongle to one of those, or use your idea of connecting an ADC via i2c.

    But I am wondering if I can just use and Arduino shield via i2c, as the Arduino headers you've built into the Logi-BONE are very nice and would make for a very clean implementation, i.e. no wires, etc...
Sign In or Register to comment.