Add bluetooth audio input support.

Create issue
Issue #48 on hold
Todd Giles repo owner created an issue

Support control of the lightshow from a bluetooth audio input feed.

Quick google search found this project that would be a useful start:

http://www.raspberrypi.org/forums/viewtopic.php?t=68779&p=608535

Initial request from community here:

https://plus.google.com/u/0/106568908430357527392/posts/RzDgR9voWXK?cfem=1

Comments (7)

  1. tom enos

    Alsa seems to be the limiting factor here. I just haven't figured out how to get the alsa loopback device (yes alsa not pulse) to output a usable stream.

    I can get alsa to read the stream to a capture device and read it, but it will not playback that stream. Or i can playback the stream, but can not get output to read the data.

    I also can get the pulse audio stream as root But
    I can not get bluetooth to pulse audio stream as root

    Solve one, cancel two, solve two cancel one

    It seems others are having the same issues as I am. They can do step one OR step two, but not one AND two.

  2. tom enos

    I did a lot of work on this and have come to the conclusion that PulseAudio requires to much configuration and is a resource hog. I did find a simple way to do this. Instead of adding software support for bluetooth streaming it should be done with hardware.
    A purchased a USB audio card and a Bluetooth audio receiver. I payed less then $5 for both on ebay (buy it now price, not auctions) and it seems to work great.

    Normal install of lightshowpi. Setup USB sound card as normal Configure lightshowpi to use audio-in Use the included patch cord to hook up the Bluetooth receivers audio out to the sound cards audio in (mic) port Started lightshowpi Paired my phone and started streaming It works as well as audio-in mode works with any other source and setup was as easy as plug and play.

  3. tom enos

    Changing to minor as there is a simple hardware solution for this, making software support unnecessary as it is a heavy drain on the cpu.

  4. tom enos

    There is a simple hardware solution for this, making software support unnecessary. Placing this issue on hold for now.

  5. Grant Henke

    I was able to get this to work via a "software" work around. Instead of having lightshowpi take over the audio I instead just left that to pulseaudio and fed the data to lightshowpi via pacat.

    Here is a sample configuration:

    [lightshow]
    # ---------------------------------------------------------------
    # 'stream-in' mode specific configurations for the lightshow
    # ---------------------------------------------------------------
    # Control the lightshow from an audio stream coming from a streaming source
    mode = stream-in
    
    # Get standard input the the PulseAudio cat tool (pacat): https://linux.die.net/man/1/pacat
    # Note: May need to change  "alsa_output.0.analog-stereo.monitor" to the output from:
    #   pactl info | grep "Default Source:" | cut -d" " -f3
    stream_command_string = /usr/bin/pacat -r -d alsa_output.0.analog-stereo.monitor
    
    # ---------------------------------------------------------------
    # audio_out_card configuration for the lightshow
    # ---------------------------------------------------------------
    # Disable auto output. PulseAudio will handle this. 
    # Note: This means there may be a more significant delay and light_delay may be fairly large
    audio_out_card =
    
    [audio_processing]
    # light_delay is the number of seconds the light display is delayed from the input audio
    # use zero for an audio device output. Typically this is less than 1.0
    light_delay = 1.25
    

    I can share a more complete example if/when I do a more thorough write up

  6. Charles “Hayden” K. Wilson

    @granthenke I am a student currently working to get audio from PulseAudio to feed through to lightshowpi for control of individual LEDs, you say to feed the data in via pacat, how would one do this?

  7. Log in to comment