Stream

Join this community to post or comment

Josh Noonan

Software Help (LightshowPi)  - 
 
I got lightshow working fine with playlists and single songs (and FM, using master branch). I wanted to try playing a shoutcast stream so I don't have to pick all the music.

To enable it I:
1) Disabled playlist mode
2) mode = stream-in
stream_in_url=http://listen.radionomy.com:80/1000Christmas
stream_in_sample_rate=44100

Now when I do the start music I get a bunch of error such as:

root@raspberrypi:/home/pi/lightshowpi/bin# ./start_music_and_lights
Traceback (most recent call last):
File "/home/pi/lightshowpi/py/hardware_controller.py", line 55, in <module>
cm = configuration_manager.Configuration()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 94, in _init_
self.set_lightshow()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 233, in set_lightshow
command_string = self.config.get(ls, 'stream_command_string')
File "/usr/lib/python2.7/ConfigParser.py", line 340, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'stream_command_string' in section: 'lightshow'
root@raspberrypi:/home/pi/lightshowpi/bin# Traceback (most recent call last):
File "/home/pi/lightshowpi/py/synchronized_lights.py", line 134, in <module>
import hardware_controller as hc
File "/home/pi/lightshowpi/py/hardware_controller.py", line 55, in <module>
cm = configuration_manager.Configuration()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 94, in _init_
self.set_lightshow()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 233, in set_lightshow
command_string = self.config.get(ls, 'stream_command_string')
File "/usr/lib/python2.7/ConfigParser.py", line 340, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'stream_command_string' in section: 'lightshow'
./Traceback (most recent call last):
File "/home/pi/lightshowpi/py/synchronized_lights.py", line 134, in <module>
import hardware_controller as hc
File "/home/pi/lightshowpi/py/hardware_controller.py", line 55, in <module>
cm = configuration_manager.Configuration()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 94, in _init_
self.set_lightshow()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 233, in set_lightshow
command_string = self.config.get(ls, 'stream_command_string')
File "/usr/lib/python2.7/ConfigParser.py", line 340, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'stream_command_string' in section: 'lightshow'
stop_music_and_lights
killing:
CMD /bin/bash /home/pi/lightshowpi/bin/play_sms
Traceback (most recent call last):
File "/home/pi/lightshowpi/py/synchronized_lights.py", line 134, in <module>
import hardware_controller as hc
File "/home/pi/lightshowpi/py/hardware_controller.py", line 55, in <module>
cm = configuration_manager.Configuration()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 94, in _init_
self.set_lightshow()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 233, in set_lightshow
command_string = self.config.get(ls, 'stream_command_string')
File "/usr/lib/python2.7/ConfigParser.py", line 340, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'stream_command_string' in section: 'lightshow'
killing:
CMD sudo python /home/pi/lightshowpi/py/synchronized_lights.py
Traceback (most recent call last):
File "/home/pi/lightshowpi/py/hardware_controller.py", line 55, in <module>
cm = configuration_manager.Configuration()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 94, in _init_
self.set_lightshow()
File "/home/pi/lightshowpi/py/configuration_manager.py", line 233, in set_lightshow
command_string = self.config.get(ls, 'stream_command_string')
File "/usr/lib/python2.7/ConfigParser.py", line 340, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'stream_command_string' in section: 'lightshow'


Ideas? Thanks!
1
Josh Noonan's profile photoKen B (K5ENB)'s profile photo
9 comments
 
Just curious, you don't have pin_modes = pwm , do you ? It should be onoff. What are you trying to set the decay_factor to when it locks up, btw ? attenuate_pct will effectively reduce the input signal, perhaps try a slightly higher value.
Add a comment...

Josh Noonan

Software Help (LightshowPi)  - 
 
Good afternoon, I just started using lightshow pi and have got it working fine with using the standard 8 channel mechanical relays. I just had a couple of questions. I am trying to setup the FM transmitter. In the defaults.cfg it says "pin 7 cannot be used in FM mode. In the FM section it says output the FM single on port 4. Which pin should I be using? When I have it on GPIO 7 and FM=true the process hangs. Also I have been trying to get the webui branch and it I cannot find that branch. Thanks!
1
Josh Noonan's profile photoKen B (K5ENB)'s profile photo
5 comments
 
No, not for power, but keeping your RF emissions low is a better idea in my opinion. Your antenna from your Pi will be critical to good reception, but if you can pick up anything beyond your property, it's probably too much gain on your setup. A loose wire from the pin on the Pi could be all you need, but since there are so many factors, experimentation is essential.
Add a comment...

fragwits

Software Help (LightshowPi)  - 
 
fresh install
nothing changed in configs, tested, no audio, lights do work. looked at my screen and i get:

$ sudo python py/synchronized_lights.py
/home/pi/lightshowpi/py/fft.py:61: RuntimeWarning: divide by zero encountered in log10
:piff(frequency_limits[i][1], chunk_size, sample_rate):1]))

playing sample files.
1
KnC Mc's profile photofragwits's profile photo
3 comments
 
Problem is in my pi somehow, aplay doesn't produce sound either..
ok,fixed. had to use raspi-config to set the output to "force to headphone jack". auto for some reason didn't work..
Add a comment...

darshan virupaksha

Software Help (LightshowPi)  - 
 
How can use this package and have the MIC as the input instead of the local audio file?
1
1
Ken B (K5ENB)'s profile photoTom Enos's profile photo
4 comments
 
if the RPI is recognizing your audio card this command will give you the name to use with lightshowpi
aplay -L | grep sysdefault

example
pi@raspberrypi:~$ aplay -L | grep sysdefault
sysdefault:CARD=ALSA
sysdefault:CARD=Device
pi@raspberrypi:~$

for my hardware then correct entry for audio_in_card is
sysdefault:CARD=Device
Add a comment...

Bradley Martinis

Software Help (LightshowPi)  - 
 
Hello! I'm having a problem and I can't figure it out at all--any help would be greatly appreciated. I'm trying to do audio-in mode. The music is looping back from my phone to my speakers through the Pi like it should, but the lights aren't flashing like they should be. The lights flash when I play one of the sample songs on the Pi, but audio-in just won't do it. Any suggestions? Thanks!
1
Benjamin Ellis's profile photoTom Enos's profile photo
2 comments
 
Also list the hardware you are using.
Add a comment...

Matthias Pröll

Software Help (LightshowPi)  - 
 
Hey guys,

I want to stream my music over wifi to LightShowPi.
How can I get this working?
I use a OnePlus 3, rooted, Android 6.0.1 and a Raspi 2 B

1
Matthias Pröll's profile photoTom Enos's profile photo
4 comments
 
If the audio quality is bad it's not lightshowpi. it's either shareport-sync, airAudio, your stream or any combination of them. Also don't forget the RPI doesn't have the greatest sound hardware to begin with.
Add a comment...

Caleb B

Software Help (LightshowPi)  - 
 
OK is it possible to stream music to software using ssh? I am using raspicast
1
Caleb B's profile photoTom Enos's profile photo
14 comments
 
Well it looks like omxplayer will work without x. I tested it and it works fine. No audio problems with lightshowpi
Add a comment...

Caleb B

Software Help (LightshowPi)  - 
 
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM sysdefault
Traceback (most recent call last):
  File "py/synchronized_lights.py", line 902, in <module>
    play_song()
  File "py/synchronized_lights.py", line 785, in play_song
    output, fft_calc, music_file, light_delay = setup_audio(song_filename)
  File "py/synchronized_lights.py", line 556, in setup_audio
    output = set_audio_device(sample_rate, num_channels)
  File "py/synchronized_lights.py", line 261, in set_audio_device
    output_device = aa.PCM(aa.PCM_PLAYBACK, aa.PCM_NORMAL, cm.lightshow.audio_in_card)
alsaaudio.ALSAAudioError: No such file or directory [default]
[cjb@alarmpi lightshowpi]$


I keep getting this error any Ideas? Running Arch Linux
1
Tom Enos's profile photoCaleb B's profile photo
4 comments
Caleb B
 
I added this "dtparam=audio=on" to boot/config.txt. I then rebooted and tried again and it worked
Add a comment...

Peter Cinibulk

Software Help (LightshowPi)  - 
 
With the pi 3 is it possible to use bluetooth to play music? Without any usb audio hardware
1
Jim Myers's profile photoTom Enos's profile photo
5 comments
 
To clarify, lightshowpi will not see it as an audio source.
Add a comment...

Sandon Joubert

Software Help (LightshowPi)  - 
 
I've had everything working and decided to purchase a USB sound card so I could plug my iPod or computer into the mic slot. I get the lights working fine but it no longer plays any sound. I've tried both the sound card and the on board aux out.

I can record the input with arecord fine and can play it back fine but lightshowpi doesn't seem to output any sound anymore.
1
Sandon Joubert's profile photoKen B (K5ENB)'s profile photo
5 comments
 
Great to hear. I know that audio processing code went thru many changes. Enjoy all the new features in the config !
Add a comment...

Isaac Able

Software Help (LightshowPi)  - 
 
Testing is complete! i have a RPi connected to an 8 channel relay which is connected to 8 individual outlets. When I plug in my lights into the outlets and they default to on and when it is their turn to blink they blink off. how do i switch this to default to off and swith on when it is their turn. I thought I saw something on here earlier but I cant find it currently. Any help is appreciated! thanks!
1
Tom Enos's profile photo
 
In the config set
active_low_mode = True
Add a comment...

Jason Justice

Software Help (LightshowPi)  - 
 
hello, i got lightshowpi working great with a playlist, however when i switch configs and try to use the pianobar stream option i get music but no lights, all 8 channels just stay on. any help appreciated. this is running via the command: sudo /home/pi/lightshowpi/bin/start_music_and_lights

here is my config file part:
[lightshow]
# We support the following modes for running lightshows:

# ---------------------------------------------------------------
# 'playlist' mode specific configurations for the lightshow
# ---------------------------------------------------------------
# Play song files on the RPi from the playlist as defined below, with
# the preshow defined before each song. (default)
#mode = playlist

# The playlist_path defines the path to the .playlist file. The .playlist file
# is a text file that contains a list of what songs should be included in the show
# and is in the format:
# [songname1] <tab> [/full/path/to/song]
# [songname2] <tab> [/full/path/to/song]
# A sample of how this should be configured can be found in $SYNCHRONIZED_LIGHTS_HOME/music/sample/
# To create your own playlist simply create a .playlist file with the songs desired and set the
# playlist_path accordingly.
#
# SMS NOTE: the songname that you define in the playlist can be anything you desire, the songname
# is what users will see when listing the songs via SMS.
playlist_path = $SYNCHRONIZED_LIGHTS_HOME/music/sample/.playlist

# Set the following setting to 'yes' to randomize playback of songs from the
# playlist. Default is to play the songs in the order listed in the playlist.
randomize_playlist = no

# ---------------------------------------------------------------
# 'audio-in' mode specific configurations for the lightshow
# ---------------------------------------------------------------
# Control the lightshow from an audio stream coming from a usb-audio dongle
# See http://lightshowpi.org/usb-audio-in-support/ for
# more details on using audio-in mode.
# mode = audio-in

# The name of the input audio card to use, by default use the default system
# audio input device. You can override this to another card by setting it to the
# name found from the audio_in_cards.py script (in tools directory).
audio_in_card = default

# ---------------------------------------------------------------
# 'stream-in' mode specific configurations for the lightshow
# ---------------------------------------------------------------
# Control the lightshow from an audio stream coming from a streaming source
mode = stream-in

# this example will play a shoutcast/icecast stream
stream_command_string = sudo mpg123 --stdout http://193.34.51.115:80

# Example using Shairport Sync to strem AirPlay https://github.com/mikebrady/shairport-sync
# stream_command_string = shairport-sync -v -o stdout

# You can also use a fifo to get streams like Pandora from players like pianobar

stream_command_string = pianobar
# NOTE: To use pianobar you must set it up to auto login and auto play a station
# refer to this post for an example pianobar config to do this
# http://ubuntuforums.org/showthread.php?t=1533357&p=9746309#post9746309

# A basic pianobar config that will allow you to login and autostart a station
# is included in lightshowpi/config/contrib
# You will need to place in the root users folder
# /root/.config/pianobar/config

# lightshow fifo settings. Used with stream-in option.
#
# To use a fifo you will need to add an alsa plugin to /etc/asound.conf
# A copy of the plugin is included in lightshowpi/config/contrib
use_fifo = False

# ---------------------------------------------------------------
# mode specific configurations shared by audio-in and stream-in
# ---------------------------------------------------------------
# The number of input channels, typically 1 or 2:
# 1 - mono / mic input
# 2 - stereo input
input_channels = 1

# The rate at which to sample input from the usb dongle
input_sample_rate = 48000

1
Jason Justice's profile photoTom Enos's profile photo
4 comments
 
Thanks, I'll look into that
Add a comment...

Luca Silva

Software Help (LightshowPi)  - 
 
Hello, it's me, again... I'm having some troubles with lightshow pi, this time with the stream in mode. Shairport works fine the audio from the jack comes out normally but the light do not react in any way. I would really like to solve this problem since selecting the song everytime is kind of annoying. But still thanks for providing this software and thanks even more for the support :D
1
Luca Silva's profile photo
15 comments
 
rgb strip* argh damn you autocorrect
Add a comment...

Luca Silva

Software Help (LightshowPi)  - 
 
Hello! I just started playing around with Lightshowpi and i'm facing a problem. I have connected the raspberry to a rgb led strip and a rgb led. The problem is that the rgb led works with inverted outputs, so when the led strip is off, the led is on. I know you can invert the output but only for all of the pins at the same time. There is a way to invert the output only for 4 pins? Sorry if i mispelt something. Thanks in advance
1
Luca Silva's profile photo
10 comments
 
Ok so i reinstalled everything, and with the master branch everything works as expected. Thank you a lot for your time!
Add a comment...

bcman Main (bcman12358)

Software Help (LightshowPi)  - 
 
when i try to run install.sh i get...
E: package'ffmpeg' has no installation candidate
NOTE: installation failed trying libav-tools
WARNING: the following packages can not be authenticated
libavdevice55 libavfilter5 libav-tools
E: there are problems and -y was used without ---force-yes
ERROR: a problem occurred while installing ffmpeg.
1
Ben Jacobus's profile photoTom Enos's profile photo
2 comments
 
If that doesn't work try
sudo apt-get update
sudo apt-get upgrade
Add a comment...

Krambakla K.

Software Help (LightshowPi)  - 
 
Hello! I am very new at the Lightshow Pi and it works great with mp3 files. But now I want to connect Shairport and Lightshow Pi. In the photo below, you can see, what I changed in the overrides.cfg . But I actually don't really understand, how to start Lightshow Pi. When I play music via Airplay and then type in the console: sudo python py/synchronized_lights.py , then starts just the demo song. Can somebody please help me? :)
1
Krambakla K.'s profile photoTom Enos's profile photo
4 comments
 
I tested this and it does work.
Can you detail the commands you used to install lightshowpi and sharpoint-sync?
Add a comment...

Benjamin Ellis

Software Help (LightshowPi)  - 
 
Can someone help me .. my crontab will not launch upon reboot..
here is my settings:

Crontab -e:

#set enviornment variable
SYNCHRONIZED_LIGHTS_HOME=/home/pi/lightshowpi


# Start playing playlist at 5:30pm
30 17 * * * exec $SYNCHRONIZED_LIGHTS_HOME/bin/start_music_and_lights >> $SYNCHRONIZED_LIGHTS_HOME/logs/music_and_lights.play 2>&1 &

# Stop playing lights at 9:30pm
30 21 * * * exec $SYNCHRONIZED_LIGHTS_HOME/bin/stop_music_and_lights >> $SYNCHRONIZED_LIGHTS_HOME/logs/music_and_lights.stop 2>&1 &

#at Boot turn on ligts if after 5:30pm
@reboot exec python $SYNCHRONIZED_LIGHTS_HOME/crontab/boot.py


Here is my boot.py:
#!/usr/bin/env python

from datetime import datetime
import subprocess
import os

start = datetime.strptime("17:30:00","%H:%M:%S").time().strftime("%H%M%S")
ends = datetime.strptime("21:30:00","%H:%M:%S").time().strftime("%H%M%S")

now = datetime.now().strftime("%H%M%S")

if now > start and now < end:
subprocess.Popen(["sudo",
os.getenv("SYNCHRONIZED_LIGHTS_HOME") + "/bin/start_music_and_lights",
"&"])

Here is my Start_music and lights file:

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Check that the home environment variable is set
if [ -z ${SYNCHRONIZED_LIGHTS_HOME} ]; then
cat $DIR/env_error_msg
exit 1
fi

$SYNCHRONIZED_LIGHTS_HOME/bin/stop_music_and_lights
$SYNCHRONIZED_LIGHTS_HOME/bin/play_sms &
$SYNCHRONIZED_LIGHTS_HOME/bin/check_sms &
$SYNCHRONIZED_LIGHTS_HOME/bin/pifm
$SYNCHRONIZED_LIGHTS_HOME/py/synchronized_lights.py --file=/home/pi/lightshowpi/music/.playlist

Does this look correct? Why wont it launch on reboot? +Tom Enos +Todd Giles  Any help please?
1
Benjamin Ellis's profile photo
4 comments
 
Ok that works! thanks now i just got to make the PIFM work i have it listening on 100.1 but i have to work on the antenna and output...
Add a comment...

Benjamin Ellis

Software Help (LightshowPi)  - 
 
Hey i have a @reboot in my crontab to start light show pi incase the power is out before and restores after my start time as it wouldnt kick off the cron tab if mised.

. This is in my boot.py. Does this look correct? Can someone please confirm? I always get my < > mixed up...


#!/usr/bin/env python

from datetime import datetime
import subprocess
import os

after = datetime.strptime("17:30:00","%H:%M:%S").time().strftime("%H%M%S")
before = datetime.strptime("21:30:00","%H:%M:%S").time().strftime("%H%M%S")

now = datetime.now().strftime("%H%M%S")

if after < now and now > before:
subprocess.Popen(["sudo",
os.getenv("SYNCHRONIZED_LIGHTS_HOME") + "/bin/start_music_and_lights",
"&"])
1
Tom Enos's profile photoBenjamin Ellis's profile photo
2 comments
 
+Tom Enos​ thanks again. This makes more since. I got the < > but the validation was confusing me 
Add a comment...

Nicholas Daszkiewicz (N1BBL35)

Software Help (LightshowPi)  - 
 
Hello all!
i was playing with the Tom_Slick version with WebUI when i completely messed up the configs. So i decided to completely reinstall and now im getting this when launching the service:

Job for lightshowpi-web.service failed. See 'systemctl status lightshowpi-web.service' and 'journalctl -xn' for details.

and this from the journal:
-- Unit lightshowpi-web.service has begun starting up.
Jul 18 01:53:45 raspberrypi systemd[628]: Failed at step EXEC spawning /py/lightshowpi_daemon.py: No such file or directory
-- Subject: Process /py/lightshowpi_daemon.py could not be executed

I have since completely wiped the sd card and re-imaged with jesse-lite and re-installed but getting the same error... i have to finish rebuilding by thursday night, if anyone can help, that would be great!
1
Tom Enos's profile photoNicholas Daszkiewicz (N1BBL35)'s profile photo
19 comments
 
no thank you for the incredible level of support
i was able to get the show running (with a reboot every few songs) in time for the party
i also found out that there was a contest (probably why my mother was so adamant about getting the show going... but yea, we won second place, and only because you worked the issues with me and i was able to get it going an hour before the party
needless to say i will be taking a week or so off for lightshow setup but will be back at it soon to work out all the bugs for another party end of august, and then Halloween!

Thanks again and again - couldn't have done it without your support
Add a comment...

Blake McDribble Peterson

Software Help (LightshowPi)  - 
 
I cannot get this to work with crontab to save my life. Can anyone explain/link to an explanation on how I can get this to work?
1
Tom Enos's profile photoBlake McDribble Peterson's profile photo
2 comments
 
Thanks +Tom Enos​, that worked. I don't know why it didn't dawn on me to tell it where my lightshowpi folder was.
Add a comment...