Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Mon Jan 07, 2013 8:39 am

here you go:
http://vzoltan.com/stasiko/omxplayer-image.img.tar.gz

there is an 8gb dd image of my card, login is pi/raspberry, boblightd is installed config is in /etc/boblight.conf, the modified omxplayer is in /usr/local/src/omxplayer (WARNING: /usr/bin/omxplyer is a standard one)... so start it like ./usr/local/src/omxplayer/omxplayer. You can compile by calling make in /usr/local/src/omxplayer.

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 10:35 am

Stasik0 wrote:here you go:
http://vzoltan.com/stasiko/omxplayer-image.img.tar.gz

there is an 8gb dd image of my card, login is pi/raspberry, boblightd is installed config is in /etc/boblight.conf, the modified omxplayer is in /usr/local/src/omxplayer (WARNING: /usr/bin/omxplyer is a standard one)... so start it like ./usr/local/src/omxplayer/omxplayer. You can compile by calling make in /usr/local/src/omxplayer.

thx for uploadin!
(just started to downloading)

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 1:35 pm

Stasik0 wrote:here you go:
http://vzoltan.com/stasiko/omxplayer-image.img.tar.gz

there is an 8gb dd image of my card, login is pi/raspberry, boblightd is installed config is in /etc/boblight.conf, the modified omxplayer is in /usr/local/src/omxplayer (WARNING: /usr/bin/omxplyer is a standard one)... so start it like ./usr/local/src/omxplayer/omxplayer. You can compile by calling make in /usr/local/src/omxplayer.
well, it doesnt work for me:(

it connects to boblight but the led just wont change color...

pi@raspberrypi ~ $ sudo boblightd

Code: Select all


(InitLog)                       start of log /root/.boblight/boblightd.log
(PrintFlags)                    starting boblightd
(CConfig::LoadConfigFromFile)   opening /etc/boblight.conf
(CConfig::CheckConfig)          checking config lines
(CConfig::CheckConfig)          config lines valid
(CConfig::BuildConfig)          building config
(CConfig::BuildConfig)          built config successfully
(main)                          starting devices
(CClientsHandler::Process)      opening listening socket on *:19333
(CDevice::Process)              ambilight: starting with output "sudo python /home/pi/popen.py"
(CDevice::Process)              ambilight: setting up
(CDevice::Process)              ambilight: setup succeeded
(CClientsHandler::Process)      127.0.0.1:57699 connected
(CClientsHandler::ParseMessage) 127.0.0.1:57699 said hello
(CClientsHandler::ParseSet)     127.0.0.1:57699 priority set to 128

Code: Select all

pi@raspberrypi ~ $ sudo boblight-constant FF0000
Connecting to boblightd
Connection to boblightd opened
as you can see in the log, i need popen.py to convert the colors and send to the leds.
pi@raspberrypi ~ $ cat popen.py
[/code]

Code: Select all

import sys

spidev = file('/dev/spidev0.0', "wb")
gamma = bytearray(256)
for i in range(256):
        gamma[i] = int(pow(float(i) / 255.0, 2.5) * 255.0 )

def popen():
        while True:
                eingabe = sys.stdin.readline()
                if len(eingabe)>0:
                        eingabelist = eingabe.split()
                        ausgabe = bytearray(len(eingabelist))
                        for i in range(len(ausgabe)):
                                ausgabe[i] = gamma[int(round(float(eingabelist[i])*255))]
                        spidev.write(ausgabe)
                        spidev.flush()

popen()
Last edited by VZoltan on Mon Jan 07, 2013 1:55 pm, edited 2 times in total.

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Mon Jan 07, 2013 1:46 pm

it seems a problem with the boblightd to me, try the dumper device first

Code: Select all

[device]
name            device1
output          dd bs=1 > /dev/null 2>&1
channels        6
type            popen
interval        20000
debug          on
then you will see if leds are really set... also make sure the boblightd is woking if you send stuff there from vlc or somewhere else...

i suspect the "/dev/spidev0.0", namely the spi devices are not there in my build.. http://neophob.com/2012/08/raspberry-pi ... pi-device/ ?

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 2:09 pm

Stasik0 wrote:it seems a problem with the boblightd to me, try the dumper device first

Code: Select all

[device]
name            device1
output          dd bs=1 > /dev/null 2>&1
channels        6
type            popen
interval        20000
debug          on
then you will see if leds are really set... also make sure the boblightd is woking if you send stuff there from vlc or somewhere else...

i suspect the "/dev/spidev0.0", namely the spi devices are not there in my build.. http://neophob.com/2012/08/raspberry-pi ... pi-device/ ?

well after running boblightd there is a spidev0.0

pi@raspberrypi ~ $ ls /dev/spidev0.0
/dev/spidev0.0

but without running boblight, there isnt.

question:
http://neophob.com/2012/08/raspberry-pi ... pi-device/
this is for kernel 3.1 (3.2.2) your image has 3.6.11
i dont know if i apply the patch from that page what happens since the kernel is newer.

maybe i just need to do this after an update/upgrade:

5) Remove SPI from the Blacklist

$ cat /etc/modprobe.d/raspi-blacklist.conf
# black­list spi and i2c by default (many users don’t need them)
#black­list spi-bcm2708
black­list i2c-bcm2708

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Mon Jan 07, 2013 2:35 pm

i dunno, maybe this? http://www.raspberrypi.org/phpBB3/viewt ... 66&t=11617 maybe https://github.com/Hexxeh/rpi-update ? maybe update/upgrade? maybe /dev/spi is created with root by python and can not be overwritten by the system?

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 2:55 pm

Stasik0 wrote:i dunno, maybe this? http://www.raspberrypi.org/phpBB3/viewt ... 66&t=11617 maybe https://github.com/Hexxeh/rpi-update ? maybe update/upgrade? maybe /dev/spi is created with root by python and can not be overwritten by the system?


thx to rpi-update and un-blacklisting spi, now boblighd works, now im trying your stuf:)

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Mon Jan 07, 2013 2:56 pm

btw boblight might support ws2801 http://code.google.com/p/boblight/wiki/ ... spberry_Pi natively, you might need to do an svn update in the boblight-read-only folder and recompile it if you wanna play

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 3:01 pm

Stasik0 wrote:
IT WORKS :)
but
there's a little delay (it is about 1 sec but it is annoying :( )
leds color (lights) are late to the video :(


and the colors arent in the right order.
and the video plays very slow, like a stop motion movie :(
Last edited by VZoltan on Mon Jan 07, 2013 3:16 pm, edited 2 times in total.

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Mon Jan 07, 2013 3:14 pm

the cpu load is too high... try to reduce the number of leds in the config, you can reorder them in the config aswell.... try to use -p to bypass audio encoding....

still for my case i have boblightd already running on my wireless router :), you may also try to play with the parameters --boblight-margin and --boblight-sizedown

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 3:20 pm

Stasik0 wrote:the cpu load is too high... try to reduce the number of leds in the config, you can reorder them in the config aswell.... try to use -p to bypass audio encoding....

still for my case i have boblightd already running on my wireless router :), you may also try to play with the parameters --boblight-margin and --boblight-sizedown

running video like this:

./omxplayer -p --boblight-host localhost -b ~/big_buck_bunny_720p_surround.avi
and my boblight.conf is: http://pastebin.com/wUsDsLsC


(can you help me how to install boblight to my dd-wrt enabled router? is it a good idea since my leds are connected to the pi itself?)

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Mon Jan 07, 2013 3:53 pm

just set boblight for 25 lights and see if it is better there is a boblight.conf_25 in the /home/pi dir

well I ended up installing latest trunk openwrt which has (since yesterday) a fixed boblightd package... note that you will need an arduino or smth for controlling lights (like me)... I ended up using these arduino sketches http://www.ambilight4pc.com/adalight.html

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 5:10 pm

Stasik0 wrote:just set boblight for 25 lights and see if it is better there is a boblight.conf_25 in the /home/pi dir

well I ended up installing latest trunk openwrt which has (since yesterday) a fixed boblightd package... note that you will need an arduino or smth for controlling lights (like me)... I ended up using these arduino sketches http://www.ambilight4pc.com/adalight.html

Well, playing videos with this omxplayer (without the leds and boblightd)
Is very bad, chopy slow.

It is very strange that it is slow, coz with raspbmc (xbmc) i can play video on the pi and watch it on the tv via composit, and in the very same time i can run the same video on my macmini (from the pi's hdd via samba) in xbmc and send the boblight-addon data from osx to the pi-s boblightd to run my leds, and the video keeps playing at normal speed.

Omxplayer doesnt use the gpu?

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Mon Jan 07, 2013 6:00 pm

it does, did you check the gpu memory split in the config.txt? try recompile by running make clean and make.... try to observe top output for cpu and memory ratings.... maybe it is because of your 512 version? maybe you need to adjust some compile flags like architecture?

here i can play 1080p without problems as you can see on the youtube video...

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 6:10 pm

Stasik0 wrote:it does, did you check the gpu memory split in the config.txt? try recompile by running make clean and make.... try to observe top output for cpu and memory ratings.... maybe it is because of your 512 version? maybe you need to adjust some compile flags like architecture?

here i can play 1080p without problems as you can see on the youtube video...

Maybe it is slow here coz i drive the leds from the pi, not with other hardware like your setup: pi+arduino.

For now i guess i wait until someone came up with some solution and i watch movies like before (osx->boblightd on the pi->leds)

Thx for the help and the effort!


Ps: i keep your img on the server for others who want to give it a try. (If its ok with you if not you can delete it)

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Mon Jan 07, 2013 7:11 pm

try to remove the following section from OMXVideo.cpp (2 times)

Code: Select all

    OMX_PARAM_U32TYPE singlestep_param;
    OMX_INIT_STRUCTURE(singlestep_param);
    singlestep_param.nPortIndex = m_omx_split.GetOutputPort();
    singlestep_param.nU32 = 1;
    omx_err = m_omx_split.SetParameter(OMX_IndexConfigSingleStep, &singlestep_param);
    if(omx_err != OMX_ErrorNone)
    {
      CLog::Log(LOGERROR, "%s::%s - error OMX_IndexConfigSingleStep omx_err(0x%08x)\n", CLASSNAME, __func__, omx_err);
    }
and recompile

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Mon Jan 07, 2013 7:54 pm

i think i did it
modified that file (commented out those lines two times with // ) and run make:

Code: Select all

pi@raspberrypi /usr/local/src/omxplayer $ make
/usr//bin/g++  -std=c++0x -pipe -mfloat-abi=hard -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -O3 -mstructure-size-boundary=32 -mno-sched-prolog -march=armv6zk -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG  -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST -Wno-psabi -I/opt/vc/include/  -I/usr/local/src/omxplayer/firmware/opt/vc/include/interface/vcos/pthreads -I/usr/local/src/omxplayer/firmware/opt/vc/include -I/usr/local/src/omxplayer/firmware/opt/vc/include/interface/vmcs_host -I/usr/local/src/omxplayer/ffmpeg -I/usr/include -I/usr/include/freetype2 -I./ -Ilinux -Iffmpeg -c OMXVideo.cpp -o OMXVideo.o -Wno-deprecated-declarations
OMXVideo.cpp: In member function ‘void COMXVideo::WaitCompletion()’:
OMXVideo.cpp:1329:19: warning: unused variable ‘starttime’ [-Wunused-variable]
OMXVideo.cpp:1329:30: warning: unused variable ‘endtime’ [-Wunused-variable]
/usr//bin/g++  -L/usr/local/src/omxplayer/firmware/opt/vc/lib -L/usr/local/src/omxplayer/ffpmeg -L/lib -L/usr/lib  -lfreetype -lboblight -L./ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -Lffmpeg_compiled/usr/local/lib/ -o omxplayer.bin linux/XMemUtils.o utils/log.o DynamicDll.o utils/PCMRemap.o utils/RegExp.o OMXSubtitleTagSami.o OMXOverlayCodecText.o BitstreamConverter.o linux/RBP.o OMXThread.o OMXReader.o OMXStreamInfo.o OMXAudioCodecOMX.o OMXCore.o OMXVideo.o OMXAudio.o OMXClock.o File.o OMXPlayerVideo.o OMXPlayerAudio.o OMXPlayerSubtitles.o SubtitleRenderer.o Unicode.o omxplayer.o -lvchiq_arm -lvcos -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lpcre
strip omxplayer.bin
result, still chopy video playback and the lights are out of sync with 1 sec late.


cpu usage during video playback is:

Code: Select all

top - 20:56:43 up 16 min,  3 users,  load average: 0.85, 0.70, 0.55
Tasks:  80 total,   4 running,  76 sleeping,   0 stopped,   0 zombie
%Cpu(s): 93.9 us,  5.1 sy,  0.0 ni,  0.3 id,  0.0 wa,  0.0 hi,  0.6 si,  0.0 st
KiB Mem:    253912 total,   163236 used,    90676 free,    14080 buffers
KiB Swap:   102396 total,        0 used,   102396 free,    95664 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                      
 2318 pi        20   0  102m  22m 2788 R  58.0  8.9   0:15.86 omxplayer.bin                                                                
 2263 root      20   0 12860 1628 1392 R  31.4  0.6   0:22.78 boblightd                                                                    
 2267 root      20   0  9808 4236 2488 R   7.1  1.7   0:14.21 python                                                                       
 2316 pi        20   0  4656 1400 1024 R   1.3  0.6   0:00.40 top                                                                          
   28 root       1 -19     0    0    0 S   1.0  0.0   0:00.87 VCHIQ-0                                                                      
   37 root      20   0     0    0    0 S   0.6  0.0   0:02.62 mmcqd/0                                                                      
 2301 pi        20   0  9800 1648 1008 S   0.3  0.6   0:00.12 sshd                                                                         
    1 root      20   0  2140  724  616 S   0.0  0.3   0:01.69 init                                                                         
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd        
.
.
.

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Tue Jan 08, 2013 7:43 am

i may have spotted the problem in the code, let me tweak it for a couple of days

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Tue Jan 08, 2013 9:02 am

Stasik0 wrote:i may have spotted the problem in the code, let me tweak it for a couple of days

Ok thx!

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Fri Jan 11, 2013 7:29 pm

ok, i have got a multithreaded version that runs much better (at least here). Testers are welcome: http://vzoltan.com/stasiko/omxplayer.bin

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Fri Jan 11, 2013 7:53 pm

Stasik0 wrote:ok, i have got a multithreaded version that runs much better (at least here). Testers are welcome: http://vzoltan.com/stasiko/omxplayer.bin


THX

video is just FINE !
i have to reorder my leds coz with your boblight it doesnt follow the video's color but i have no idea what is wrong, since with my other setup (as you saw the youtube video of mine) they are organized just fine.
can you help me with that?

i have 50 leds like this (assuming you are standing infront of the tv)

12 on the left
26 on the top
12 on the right
none on the bottom

first led is in lower left corner and goes up than right then down.
it is very importent to reorder them via software, coz they are fixed on a frame behind the tv!

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Fri Jan 11, 2013 9:56 pm

The reordering is made in boblightd.conf... Is your image mirrored? I may mix up x and y values..

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Fri Jan 11, 2013 10:01 pm

Stasik0 wrote:The reordering is made in boblightd.conf... Is your image mirrored? I may mix up x and y values..

I really dnt know :( all i know that this is my boblight.comf file which is working for me with the other setup, ive generated it with some windows program

http://pastebin.com/wUsDsLsC

Stasik0
Posts: 63
Joined: Tue Dec 18, 2012 6:31 pm

Re: Boblight possible?

Fri Jan 11, 2013 10:46 pm

i will test it tommorow with a standard boblight-x11 client and report :)

VZoltan
Posts: 179
Joined: Sat Jun 02, 2012 10:00 pm

Re: Boblight possible?

Sat Jan 12, 2013 12:39 am

Stasik0 wrote:i will test it tommorow with a standard boblight-x11 client and report :)
Here it is my setup just to understand my situation with my leds and its order:

https://www.icloud.com/photostream/hu-h ... 8gBYG2OfIA

Especially the last two pics

(But i didnt get this result with your config)

One quarter of the screen is covered by 6 leds on the sides (bottom corners)
6 on the sides and 13 on the top for the two top quarters
You can count the leds on the last pics and compare to the paused video on the screen.
Thank you.

Return to “General discussion”