Ambilight with Odroid C1 and Kodi

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Ambilight with Odroid C1 and Kodi

Post by Ricardona »

Hi all,

Here is the result:





List of materials
AC Adapter 5V 4A output power supply $8
50x 12mm DC5V WS2801 $26

My steps

I am using

Code: Select all

Linux odroid 3.10.75-84 #1 SMP PREEMPT Sat Apr 25 18:33:08 BRT 2015 armv7l armv7l armv7l GNU/Linux
Download boblight source code:

Code: Select all

wget -m -np http://boblight.googlecode.com/svn/trunk/

./configure --without-portaudio --without-libusb

make; sudo make install
Remember do https://code.google.com/p/boblight/issues/detail?id=6

Code: Select all

initctl reload-configuration
I created boblightd.conf for 50 ws2801 leds

Code: Select all

# config file created with BobLight Config Maker v.1.0
# (C) Hans Luijten - http://www.tweaking4all.com
# Orientation naming as seen from the REAR of the TV
# Date: 30/04/2015 20:24:17

[global]
#interface 127.0.0.1
port      19333

[device]
name            AmbiLight
type            ws2801
output          /dev/spidev0.0
channels        150
prefix          41 64 61 00 18 4D
#interval        20000
interval        1048576 
#rate            115200
rate            1048576
debug           off
#delayafteropen  100000

[color]
name            red
rgb             FF0000
adjust          1.0
blacklevel      1.0
gamma           1.0

[color]
name            green
rgb             00FF00

[color]
name            blue
rgb             0000FF

# Bottom Start

[light]
name start1
color red AmbiLight 1
color green AmbiLight 2
color blue AmbiLight 3
hscan 40 46.7
vscan 95 100

[light]
name start2
color red AmbiLight 4
color green AmbiLight 5
color blue AmbiLight 6
hscan 33.3 40
vscan 95 100

[light]
name start3
color red AmbiLight 7
color green AmbiLight 8
color blue AmbiLight 9
hscan 26.7 33.3
vscan 95 100

[light]
name start4
color red AmbiLight 10
color green AmbiLight 11
color blue AmbiLight 12
hscan 20 26.7
vscan 95 100

[light]
name start5
color red AmbiLight 13
color green AmbiLight 14
color blue AmbiLight 15
hscan 13.3 20
vscan 95 100

[light]
name start6
color red AmbiLight 16
color green AmbiLight 17
color blue AmbiLight 18
hscan 6.7 13.3
vscan 95 100

[light]
name start7
color red AmbiLight 19
color green AmbiLight 20
color blue AmbiLight 21
hscan 0 6.7
vscan 95 100

# Right Side

[light]
name right1
color red AmbiLight 22
color green AmbiLight 23
color blue AmbiLight 24
hscan 0 5
vscan 90 100

[light]
name right2
color red AmbiLight 25
color green AmbiLight 26
color blue AmbiLight 27
hscan 0 5
vscan 80 90

[light]
name right3
color red AmbiLight 28
color green AmbiLight 29
color blue AmbiLight 30
hscan 0 5
vscan 70 80

[light]
name right4
color red AmbiLight 31
color green AmbiLight 32
color blue AmbiLight 33
hscan 0 5
vscan 60 70

[light]
name right5
color red AmbiLight 34
color green AmbiLight 35
color blue AmbiLight 36
hscan 0 5
vscan 50 60

[light]
name right6
color red AmbiLight 37
color green AmbiLight 38
color blue AmbiLight 39
hscan 0 5
vscan 40 50

[light]
name right7
color red AmbiLight 40
color green AmbiLight 41
color blue AmbiLight 42
hscan 0 5
vscan 30 40

[light]
name right8
color red AmbiLight 43
color green AmbiLight 44
color blue AmbiLight 45
hscan 0 5
vscan 20 30

[light]
name right9
color red AmbiLight 46
color green AmbiLight 47
color blue AmbiLight 48
hscan 0 5
vscan 10 20

[light]
name right10
color red AmbiLight 49
color green AmbiLight 50
color blue AmbiLight 51
hscan 0 5
vscan 0 10

# Top

[light]
name top1
color red AmbiLight 52
color green AmbiLight 53
color blue AmbiLight 54
hscan 0 6.7
vscan 0 5

[light]
name top2
color red AmbiLight 55
color green AmbiLight 56
color blue AmbiLight 57
hscan 6.7 13.3
vscan 0 5

[light]
name top3
color red AmbiLight 58
color green AmbiLight 59
color blue AmbiLight 60
hscan 13.3 20
vscan 0 5

[light]
name top4
color red AmbiLight 61
color green AmbiLight 62
color blue AmbiLight 63
hscan 20 26.7
vscan 0 5

[light]
name top5
color red AmbiLight 64
color green AmbiLight 65
color blue AmbiLight 66
hscan 26.7 33.3
vscan 0 5

[light]
name top6
color red AmbiLight 67
color green AmbiLight 68
color blue AmbiLight 69
hscan 33.3 40
vscan 0 5

[light]
name top7
color red AmbiLight 70
color green AmbiLight 71
color blue AmbiLight 72
hscan 40 46.7
vscan 0 5

[light]
name top8
color red AmbiLight 73
color green AmbiLight 74
color blue AmbiLight 75
hscan 46.7 53.3
vscan 0 5

[light]
name top9
color red AmbiLight 76
color green AmbiLight 77
color blue AmbiLight 78
hscan 53.3 60
vscan 0 5

[light]
name top10
color red AmbiLight 79
color green AmbiLight 80
color blue AmbiLight 81
hscan 60 66.7
vscan 0 5

[light]
name top11
color red AmbiLight 82
color green AmbiLight 83
color blue AmbiLight 84
hscan 66.7 73.3
vscan 0 5

[light]
name top12
color red AmbiLight 85
color green AmbiLight 86
color blue AmbiLight 87
hscan 73.3 80
vscan 0 5

[light]
name top13
color red AmbiLight 88
color green AmbiLight 89
color blue AmbiLight 90
hscan 80 86.7
vscan 0 5

[light]
name top14
color red AmbiLight 91
color green AmbiLight 92
color blue AmbiLight 93
hscan 86.7 93.3
vscan 0 5

[light]
name top15
color red AmbiLight 94
color green AmbiLight 95
color blue AmbiLight 96
hscan 93.3 100
vscan 0 5

# Left Side

[light]
name left1
color red AmbiLight 97
color green AmbiLight 98
color blue AmbiLight 99
hscan 95 100
vscan 0 10

[light]
name left2
color red AmbiLight 100
color green AmbiLight 101
color blue AmbiLight 102
hscan 95 100
vscan 10 20

[light]
name left3
color red AmbiLight 103
color green AmbiLight 104
color blue AmbiLight 105
hscan 95 100
vscan 20 30

[light]
name left4
color red AmbiLight 106
color green AmbiLight 107
color blue AmbiLight 108
hscan 95 100
vscan 30 40

[light]
name left5
color red AmbiLight 109
color green AmbiLight 110
color blue AmbiLight 111
hscan 95 100
vscan 40 50

[light]
name left6
color red AmbiLight 112
color green AmbiLight 113
color blue AmbiLight 114
hscan 95 100
vscan 50 60

[light]
name left7
color red AmbiLight 115
color green AmbiLight 116
color blue AmbiLight 117
hscan 95 100
vscan 60 70

[light]
name left8
color red AmbiLight 118
color green AmbiLight 119
color blue AmbiLight 120
hscan 95 100
vscan 70 80

[light]
name left9
color red AmbiLight 121
color green AmbiLight 122
color blue AmbiLight 123
hscan 95 100
vscan 80 90

[light]
name left10
color red AmbiLight 124
color green AmbiLight 125
color blue AmbiLight 126
hscan 95 100
vscan 90 100

# Bottom End

[light]
name end1
color red AmbiLight 127
color green AmbiLight 128
color blue AmbiLight 129
hscan 93.3 100
vscan 95 100

[light]
name end2
color red AmbiLight 130
color green AmbiLight 131
color blue AmbiLight 132
hscan 86.7 93.3
vscan 95 100

[light]
name end3
color red AmbiLight 133
color green AmbiLight 134
color blue AmbiLight 135
hscan 80 86.7
vscan 95 100

[light]
name end4
color red AmbiLight 136
color green AmbiLight 137
color blue AmbiLight 138
hscan 73.3 80
vscan 95 100

[light]
name end5
color red AmbiLight 139
color green AmbiLight 140
color blue AmbiLight 141
hscan 66.7 73.3
vscan 95 100

[light]
name end6
color red AmbiLight 142
color green AmbiLight 143
color blue AmbiLight 144
hscan 60 66.7
vscan 95 100

[light]
name end7
color red AmbiLight 145
color green AmbiLight 146
color blue AmbiLight 147
hscan 53.3 60
vscan 95 100

[light]
name end8
color red AmbiLight 148
color green AmbiLight 149
color blue AmbiLight 150
hscan 46.7 53.3
vscan 95 100
Remember add spicc and spidev to /etc/modules http://forum.odroid.com/viewtopic.php?f=115&t=7626

Connect pins (see april Odroid Magazine):

Code: Select all

Ground GND: pin 6 on Odroid-C1
SPI clock SCLK: pin 23 on Odroid-C1
SPI data MOSI: pin 19 on Odroid-C1
Now we can check leds running

Code: Select all

boblight-constants FFFFFF
or

Code: Select all

boblight-X11
The videos was made using boblight-X11 with Chrome in Youtube.

Issues
Using Kodi:


:ugeek:
Last edited by Ricardona on Mon Jun 22, 2015 11:56 am, edited 8 times in total.

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: Ambilight with Odroid C1

Post by odroid »

Nice project...

Can you adjust the SPI clock frequency to check the real root cause?

robrodrigues
Posts: 147
Joined: Thu Feb 05, 2015 4:32 pm
languages_spoken: english
ODROIDs: C1 with a 32GB Sandisk Extreme Plus class10 and USB 400GB disk for torrents downloads
Location: Portugal
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by robrodrigues »

Please help other putting :
System used by beggining, ubuntu debian and what source
List of materials with origin of place bought and price
Sources to add to compile
Step by step instructions

Nice work, just image instead of leds using a strip of them, i believe that the light could be more friendly.
Official List of Images Android-Linux
http://forum.odroid.com/viewtopic.php?f=111&t=9656
Odroid Magazine on OneDrive to download
http://1drv.ms/1TdwxOA

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »

@odroid i did severals test changing interval and rate. When the interval and rate are more than 500k the flickering is less noticeable.

@robrodrigues
I added list of materials and several steps. I recommend to you see Adalight Project Pack or April Odroid Magazine.

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ro4cHii »

I can confirm the flickering problem with the WS2801. I also tried changing rate and interval. Constantly random colors at random positions either start flickering like hell or lighting up for about 1-2 seconds... Is this fixable ?

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: Ambilight with Odroid C1

Post by odroid »

I think the change of rate/interval is not helpful.
Can you show us the source code for settings or initialization of the SPI clock frequency?

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »


Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ro4cHii »

Could the problem maybe have to do something with the threadpriority? For the WS2801, there's something mentioned under 'threadpriority': https://code.google.com/p/boblight/wiki/boblightconf

I tried changing the threadpriority to 99, but no difference. I'm not 100% sure, but still pretty sure that I run boblightd as root. Does root have the permission to use SCHED_FIFO priority?

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: Ambilight with Odroid C1

Post by odroid »

The default SPI clock is 20Mhz which is too much high frequency to contol the WS2801 probably.
I think 3~4Mhz seems to be fine.

Refe the IOCTL in the kernel/ Documentation/spi/spidev_test.c

Code: Select all

           int fd;
uint32_t speed = 500000; // 500Khz

fd = open(“/dev/spidev0”, O_RDWR);
           if (fd < 0)
                pabort("can't open device");

ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);

if (ret == -1)
                pabort("can't set max speed hz");
If this doesn't help, let's look into the scheduler option.

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: Ambilight with Odroid C1

Post by odroid »

Ooops! :oops:
Its preset clock seems to be 2~3Mhz. It seems to be related to the scheduler.

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ro4cHii »

I'm no expert at this, but if I can participate in any way please let me know.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: Ambilight with Odroid C1

Post by memeka »

any fix?

User avatar
odroid
Site Admin
Posts: 38033
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1999 times
Been thanked: 1206 times
Contact:

Re: Ambilight with Odroid C1

Post by odroid »

We've ordered 5-Meter of LED string based on WS2801 last Thursday.
It may take a couple of weeks to get it. When we have it, we will try to find a root cause to solve the problem.

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 working with Kodi

Post by Ricardona »

I was investigating about the kernel for the C1 with enabled CONFIG_AM_VIDEOCAPTURE and the good news is that option is supported but, the bad news, the driver was no installed.

After many tests and undocumented code i had success compiling and changing kernel for include capture video support. :o

I'm not a expert then be careful with my changes:

Code: Select all

diff --git a/arch/arm/boot/dts/meson8b_odroidc.dts b/arch/arm/boot/dts/meson8b_odroidc.dts
index efe382b..433b4d2 100755
--- a/arch/arm/boot/dts/meson8b_odroidc.dts
+++ b/arch/arm/boot/dts/meson8b_odroidc.dts
@@ -134,6 +134,14 @@
                 status = "okay";
         };
 
+    amvideocap{
+        compatible = "amlogic,amvideocap";
+        dev_name = "amvideocap.0";
+        status = "okay";
+        reserve-memory = <0x00800000>;//1920*1088*4
+        reserve-iomap = "true";
+    };
+
     rtc{
                 compatible = "amlogic,aml_rtc";
                 status = "okay";
This is not enough is necessary too compile special boblight client for aml devices https://github.com/Pivosgroup/boblight.git/. I did some changes then i will publish it. Right now is a little dirty code.

Now my kodi is more beatiful than before ... i love it ... :mrgreen:

kaba-kakao
Posts: 22
Joined: Mon Apr 20, 2015 2:16 am
languages_spoken: english, german
ODROIDs: C1
Location: Germany
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 working with Kodi

Post by kaba-kakao »

Hi Ricardona,

this sounds great. But I'm too noob to unterstand what you did.
I saw, that zalaare added the option "CONFIG_AM_VIDEOCAPTURE" in the kernel.
But it seems, that this is not enough, to get the /dev/amvideocap0 device.
Could you please let us know, what else is to do, to get it working?

Thank you in advance

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: Ambilight with Odroid C1

Post by memeka »

modify the file arch/arm/boot/dts/meson8b_odroidc.dts as above

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 working with Kodi

Post by Ricardona »

kaba-kakao wrote:this sounds great. But I'm too noob to unterstand what you did.
I saw, that zalaare added the option "CONFIG_AM_VIDEOCAPTURE" in the kernel.
But it seems, that this is not enough, to get the /dev/amvideocap0 device.
Could you please let us know, what else is to do, to get it working?
Im a noob too. I only followed the official guide for compiling Odroid C1 kernel.
  • Download the linux not android kernel (i lost a lot time for this simple mistake).

    Modify the device tree file arch/arm/boot/dts/meson8b_odroidc.dts as above

    Compile kernel.

    You will have a meson8b_odroidc.dtb file, copy it to /media/boot

    Reboot

    Check to get the /dev/amvideocap0 device

    Enjoy ambilight ...
Attachments
meson8b_odroidc.zip
Compiled device tree for Linux odroid 3.10.75-84.
(5.08 KiB) Downloaded 181 times

kaba-kakao
Posts: 22
Joined: Mon Apr 20, 2015 2:16 am
languages_spoken: english, german
ODROIDs: C1
Location: Germany
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by kaba-kakao »

Good morning,

thanks for your description.
I'm using the OpenElec build of zalaare. And I like it.
I cloned the sources and build them.
But I can't find that file, or a similar file.
Is there a chance to integrate it in this build.

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »

I don't have OpenElec installed. But if you can find a dtb file in the boot partition then search the source with the same name but with dts extension. Compile and copy resulting dtb file in the boot partition and test.

Good luck and good hunting

User avatar
tobetter
Posts: 8387
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 490 times
Been thanked: 1323 times
Contact:

Re: Ambilight with Odroid C1

Post by tobetter »

kaba-kakao wrote:Good morning,

thanks for your description.
I'm using the OpenElec build of zalaare. And I like it.
I cloned the sources and build them.
But I can't find that file, or a similar file.
Is there a chance to integrate it in this build.
Rcardona already uploaded his .dtb, hence you can use this without compile.
http://forum.odroid.com/download/file.php?id=2420

The original file what you are looking for is this, and you don't need to download and build whole kernel source if you only to get .dtb
https://github.com/hardkernel/linux/blo ... droidc.dts

You can install device-tree-compiler package from Ubuntu and compile .dtb.

Code: Select all

$ sudo apt-get install device-tree-compiler
$ wget https://github.com/hardkernel/linux/blob/odroidc-3.10.y/arch/arm/boot/dts/meson8b_odroidc.dts
$ dtc -O dtb meson8b_odroidc.dts > meson8b_odroidc.dtb

kaba-kakao
Posts: 22
Joined: Mon Apr 20, 2015 2:16 am
languages_spoken: english, german
ODROIDs: C1
Location: Germany
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by kaba-kakao »

Thanks for your help.
It is working !!! :o
I love ambilight 8-)

Have a great Sunday

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »

kaba-kakao wrote:Thanks for your help.
It is working !!! :o
I love ambilight 8-)
@Kaba-kakao can you share details of your setup in OpenElec.

1. Do you have flickering leds?
2. What boblightd did you used?
3. Any special setup for running boblight at system start?
4. Video would be great.

Thanks

kaba-kakao
Posts: 22
Joined: Mon Apr 20, 2015 2:16 am
languages_spoken: english, german
ODROIDs: C1
Location: Germany
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by kaba-kakao »

Hello Ricardona,

1. I'm working with 130 LEDs. Near to the middle of the stripe up to 5 LEDs are flickering from time to time
2. I'm using the original openelec build from zalaare with your *dtb file.
3. There is nothing to do, to get it working.
4. I changed back to the original *.dtb file, because the installation does not work stable. The system hangs after 30minutes completely.
(And this is my main configuration in the livingroom. So a not stable installation has not a really got WAF ;))

So I'm waiting for zalaare, to configure it to his release, hopefully it will be more stable.
In this time i will install my stripe around my TV. For now I didn't cut it.

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »

kaba-kakao wrote:...

4. I changed back to the original *.dtb file, because the installation does not work stable. The system hangs after 30minutes completely.
...
I confirm the system hangs in Lubuntu 3.10.75-84 (blue led is without heartbeat).

Digging in the kernel logs i found a lot messages from amvideocap driver, the kernel logs can be 10-15 MB. I did some changes to driver removing a lot printk, now the kernel logs reached 300 kB, but without success the system hangs again (blue led is without heartbeat).

I removed printk for this:
printk() is the king of all debuggers, but it has a problem. If you are debugging a high volume area such as the timer interrupt, the scheduler, or the network, printk() can lead to bogging down the system or can even create a live lock.
@someone have any idea for debugging kernel driver?

Thanks in advance.

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »

Ricardona wrote:
kaba-kakao wrote:...
I confirm the system hangs in Lubuntu 3.10.75-84 (blue led is without heartbeat).
I have the same result with the new kernel 3.10.79-86 :(

I get the following log in dmesg before hangs:

Code: Select all

[ 725.735278@0] discontinue, system=0x353a87c vpts=0x34de470
[ 725.768589@0] discontinue, system=0x353b429 vpts=0x34df280
[ 725.801939@0] discontinue, system=0x353c03e vpts=0x34e0090
[ 725.835218@0] discontinue, system=0x353cd51 vpts=0x34e0ea0
[ 725.918573@0] discontinue, system=0x353e93c vpts=0x34e1cb0
[ 725.951914@0] discontinue, system=0x353f57d vpts=0x34e2ac0
[ 725.985213@0] discontinue, system=0x354017b vpts=0x34e38d0
[ 726.018589@0] discontinue, system=0x3540d7e vpts=0x34e46e0
[ 726.051818@0] discontinue, system=0x3541921 vpts=0x34e54f0
[ 726.101994@0] discontinue, system=0x3542a72 vpts=0x34e6300
I can't found the same problem, something similar was http://wetekforums.com/vb5/forum/wetek- ... 15#post915

I'm running out of ideas :geek: ... Any ?

Thanks in advance.

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ro4cHii »

I even had to go back to kernel 3.10.70-74 and disable pusleaudio and HDMI passthrough, because on any later kernel all my videos in Kodi were stuttering like hell.

So if anyone finds out how to successfully compile the kernel for Kodi-Boblight/Hyperion-usage theirselves, a tutorial would be very nice (as I apparently cannot use a new kernel) :)

Thanks in advance and best regards!

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »

Ro4cHii wrote:I even had to go back to kernel 3.10.70-74 and disable pusleaudio and HDMI passthrough, because on any later kernel all my videos in Kodi were stuttering like hell.
Try new kernel 3.10.80-94. It have a lot of improvement in Video.
Ro4cHii wrote:So if anyone finds out how to successfully compile the kernel for Kodi-Boblight/Hyperion-usage theirselves, a tutorial would be very nice (as I apparently cannot use a new kernel) :)
Old kernels support Kodi-Boblight/Hyperion-usage but is necessary enable in DTB file. You don't need build whole kernel source. Try with old kernel using meson8b_odroidc.zip attached to this discussion. With the new kernel this option is default enabled.

Good luck.

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ro4cHii »

Ricardona wrote: Try new kernel 3.10.80-94. It have a lot of improvement in Video.
Actually I'm kinda afraid of that, as I tried several configurations and now finally I found one that works.
Ricardona wrote: Old kernels support Kodi-Boblight/Hyperion-usage but is necessary enable in DTB file. You don't need build whole kernel source. Try with old kernel using meson8b_odroidc.zip attached to this discussion. With the new kernel this option is default enabled.
Isn't this the cause for your Kodi/C1 to freeze entirely after about 30 minutes?

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »

Ro4cHii wrote:Isn't this the cause for your Kodi/C1 to freeze entirely after about 30 minutes?
Yep, new and old kernel have that problem. Waiting for a solution because I'm done ... Maybe someone more skilled debugging kernel can give us more ideas.

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ro4cHii »

It's been a month now. Hopefully Odroid themselves can help us out soon!?

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi is WORKING !!!

Post by Ricardona »

Now, Kodi is working!

Last night i was in my bedtime ritual looking my Odroid C1 hangs with kodi and boblightd daemon, but this time system monitor showed me something new, the waiting channel was destroy_ge2d_work_queue. Digging like someone looking for a treasure i found my precious in codesnake/linux-amlogic

Code: Select all

[aml/ge2d]- fix race condition in ge2d_wq.
1. thread 1 is here https://github.com/codesnake/linux-amlogic/blob/master/drivers/amlogic/display/ge2d/ge2d_wq.c#L147
2. thread 2 is here https://github.com/codesnake/linux-amlogic/blob/master/drivers/amlogic/display/ge2d/ge2d_wq.c#L855
3. thread 2 is running and enters the if condition because state is GE2D_STATE_RUNNING
4. thread 2 gets interrupted by thread 1 thread 1 jumps over the if and sets GE2D_STATE_IDLE and is done
5. back to thread 2 which now sets state GE2D_STATE_REMOVING_WQ and calls wait_for_completion
6. thread2 will never return because thread 1 is done already and won't signal the event

destroy_ge2d_work_queue is called from https://github.com/codesnake/linux-amlogic/blob/master/drivers/amlogic/amports/amvideocap.c#L320 in my use case and will block there forever - and basically blocks down to the read in the userspace which tries to read the current captured frame
The changes:

* Remove kernel log spam.
* [aml/ge2d]- fix race condition in ge2d_wq.
* [amvidocap] - fixed typo in src rect of amvideocap.

Code: Select all

diff --git a/drivers/amlogic/amports/amvideocap.c b/drivers/amlogic/amports/amvideocap.c
index 9d12f3b..db5a3bc 100644
--- a/drivers/amlogic/amports/amvideocap.c
+++ b/drivers/amlogic/amports/amvideocap.c
@@ -159,17 +159,13 @@ static int amvideocap_capture_put_frame(struct amvideocap_private *priv, vframe_
 }
 static int amvideocap_get_input_format(vframe_t* vf)
 {
-    int format= GE2D_FORMAT_M24_NV21;
-    //printk("vf->type:0x%x\n", vf->type);
+    int format= GE2D_FORMAT_M24_NV21;    
 
-    if ((vf->type & VIDTYPE_VIU_422) == VIDTYPE_VIU_422) {
-        printk("********************Into VIDTYPE_VIU_422*********************\n");
+    if ((vf->type & VIDTYPE_VIU_422) == VIDTYPE_VIU_422) {        
         format =  GE2D_FORMAT_S16_YUV422;
-    } else if ((vf->type & VIDTYPE_VIU_444) == VIDTYPE_VIU_444) {
-        printk("********************Into VIDTYPE_VIU_444*********************\n");
+    } else if ((vf->type & VIDTYPE_VIU_444) == VIDTYPE_VIU_444) {        
         format = GE2D_FORMAT_S24_YUV444;
-    } else if((vf->type & VIDTYPE_VIU_NV21) == VIDTYPE_VIU_NV21){
-        printk("********************Into VIDTYPE_VIU_NV21*********************\n");
+    } else if((vf->type & VIDTYPE_VIU_NV21) == VIDTYPE_VIU_NV21){        
         format= GE2D_FORMAT_M24_NV21;
     }
     return format;
@@ -195,13 +191,12 @@ static ssize_t  amvideocap_YUV_to_RGB(struct amvideocap_private *priv, u32 cur_i
         printk("%s: failed to alloc y addr\n", __FUNCTION__);
         return -1;
     }
-    printk("RGB_phy_addr:%x\n", (unsigned int)priv->phyaddr);
+    
     RGB_addr = (unsigned long)priv->vaddr;
     if (!RGB_addr) {
         printk("%s: failed to remap y addr\n", __FUNCTION__);
         return -1;
-    }
-    printk("RGB_addr:%x\n",  (unsigned int)RGB_addr);
+    }    
 
     if(vf == NULL) {
         printk("%s: vf is NULL\n", __FUNCTION__);
@@ -250,7 +245,7 @@ static ssize_t  amvideocap_YUV_to_RGB(struct amvideocap_private *priv, u32 cur_i
     canvas_read(y_index, &cs0);
     canvas_read(u_index, &cs1);
     canvas_read(v_index, &cs2);
-    printk("y_index=[0x%x]  u_index=[0x%x] cur_index:%x\n", y_index, u_index, cur_index);
+
     ge2d_config.src_planes[0].addr = cs0.addr;
     ge2d_config.src_planes[0].w = cs0.width;
     ge2d_config.src_planes[0].h = cs0.height;
@@ -259,8 +254,7 @@ static ssize_t  amvideocap_YUV_to_RGB(struct amvideocap_private *priv, u32 cur_i
     ge2d_config.src_planes[1].h = cs1.height;
     ge2d_config.src_planes[2].addr = cs2.addr;
     ge2d_config.src_planes[2].w = cs2.width;
-    ge2d_config.src_planes[2].h = cs2.height;
-    printk("w=%d-height=%d cur_index:%x\n", cs0.width, cs0.height, cur_index);
+    ge2d_config.src_planes[2].h = cs2.height;    
 
     ge2d_config.src_key.key_enable = 0;
     ge2d_config.src_key.key_mask = 0;
@@ -275,14 +269,13 @@ static ssize_t  amvideocap_YUV_to_RGB(struct amvideocap_private *priv, u32 cur_i
     ge2d_config.src_para.x_rev = 0;
     ge2d_config.src_para.y_rev = 0;
     ge2d_config.src_para.color = 0;
-    ge2d_config.src_para.top = input_x;
-    ge2d_config.src_para.left = input_y;
+    ge2d_config.src_para.top = input_y;
+    ge2d_config.src_para.left = input_x;
     ge2d_config.src_para.width = input_width;
     ge2d_config.src_para.height = input_height;
 
 
-    canvas_read(canvas_idx, &cd);
-    printk("cd.addr:%x\n", (unsigned int)cd.addr);
+    canvas_read(canvas_idx, &cd);    
     ge2d_config.dst_planes[0].addr = cd.addr;
     ge2d_config.dst_planes[0].w = cd.width;
     ge2d_config.dst_planes[0].h = cd.height;
@@ -349,7 +342,7 @@ static int amvideocap_capture_one_frame(struct amvideocap_private *priv,vframe_t
     int curindex;
     vframe_t *vf = vfput;
     int ret = 0;
-    printk("%s:start vf=%p,index=%x\n", __func__,vf,index);
+    
     if (!vf) {
         ret = amvideocap_capture_get_frame(priv, &vf, &curindex);
     }else{
@@ -357,9 +350,7 @@ static int amvideocap_capture_one_frame(struct amvideocap_private *priv,vframe_t
     }
     if (ret < 0 || !vf) {
         return -EAGAIN;
-    }
-    printk("%s: get vf type=%x\n", __func__,vf->type);
-
+    }    
 
 #define CHECK_AND_SETVAL(val,want,def) (val)=(want)>0?(want):(def)
     CHECK_AND_SETVAL(ge2dfmt,priv->want.fmt,vf->type);
@@ -374,7 +365,6 @@ static int amvideocap_capture_one_frame(struct amvideocap_private *priv,vframe_t
     amvideocap_capture_put_frame(priv, vf);
 
     if (!ret) {
-        printk("%s: capture ok priv->want.fmt=%d\n", __func__,priv->want.fmt);
         priv->state = AMVIDEOCAP_STATE_FINISHED_CAPTURE;
         priv->src.width=vf->width;
         priv->src.height=vf->height;
@@ -387,7 +377,6 @@ static int amvideocap_capture_one_frame(struct amvideocap_private *priv,vframe_t
     }else{
         priv->state = AMVIDEOCAP_STATE_ERROR;
     }
-    printk("amvideocap_capture_one_frame priv->state=%d\n", priv->state);
     return ret;
 }
 static int amvideocap_capture_one_frame_callback(unsigned long data, vframe_t *vfput, int index)
@@ -426,8 +415,7 @@ static int amvideocap_capture_one_frame_wait(struct amvideocap_private *priv, in
                 }
             }
         } else {
-            ret = amvideocap_capture_one_frame(priv, NULL, 0);
-            printk("amvideocap_capture_one_frame_wait ret=%d\n", ret);
+            ret = amvideocap_capture_one_frame(priv, NULL, 0);            
         }
     } while (ret == -EAGAIN && time_before(jiffies, timeout));
     ext_register_end_frame_callback(NULL);/*del req*/
@@ -597,7 +585,7 @@ static int amvideocap_mmap(struct file *file, struct vm_area_struct *vma)
     if (vm_size == 0) {
         return -EAGAIN;
     }
-    //printk("mmap:%x\n",vm_size);
+
     off += priv->phyaddr;
 
     vma->vm_flags |= VM_RESERVED | VM_IO;
@@ -626,12 +614,11 @@ static ssize_t amvideocap_read(struct file *file, char __user *buf, size_t count
             waitdelay=file->f_flags & O_NONBLOCK ? HZ/100  : HZ * 10;
     }
     if(!pos){/*trigger a new capture,*/
-        printk("start amvideocap_read waitdelay=%d\n",waitdelay);
         ret = amvideocap_capture_one_frame_wait(priv,waitdelay);
-        printk("amvideocap_read=%d,priv->state=%d,priv->vaddr=%p\n", ret,priv->state,priv->vaddr);
+
         if ((ret == 0) && (priv->state==AMVIDEOCAP_STATE_FINISHED_CAPTURE) && (priv->vaddr != NULL)) {
             int size = min((int)count, (priv->out.byte_per_pix * priv->out.width_aligned* priv->out.height));
-            printk("priv->out_width=%d priv->out_height=%d priv->outfmt_byteppix=%d, size=%d\n", priv->out.width,priv->out.height,priv->out.byte_per_pix,size);
+
             copied=copy_to_user(buf, priv->vaddr, size);
             if(copied){
                 printk("amvideocap_read %d copy_to_user failed \n",size);
@@ -646,7 +633,7 @@ static ssize_t amvideocap_read(struct file *file, char __user *buf, size_t count
             int maxsize = priv->out.byte_per_pix * priv->out.width_aligned* priv->out.height;
             if(pos<maxsize){
                 int rsize=min((int)count,(maxsize-(int)pos));
-                ///printk("amvideocap_read11 try copy %d,pos=%d\n",rsize,pos);
+
                 copied=copy_to_user(buf, priv->vaddr+pos, rsize);
                 if(copied){
                     printk("amvideocap_read11 %d copy_to_user failed \n",rsize);
diff --git a/drivers/amlogic/display/ge2d/ge2d_wq.c b/drivers/amlogic/display/ge2d/ge2d_wq.c
index 1d7a498..28c1b56 100644
--- a/drivers/amlogic/display/ge2d/ge2d_wq.c
+++ b/drivers/amlogic/display/ge2d/ge2d_wq.c
@@ -144,9 +144,11 @@ static int ge2d_process_work_queue(ge2d_context_t *  wq)
 	}while(pos!=head);
 	ge2d_manager.last_wq=wq;
 exit:
+	spin_lock(&ge2d_manager.state_lock);
 	if(ge2d_manager.ge2d_state==GE2D_STATE_REMOVING_WQ)
-	complete(&ge2d_manager.event.process_complete);
+	    complete(&ge2d_manager.event.process_complete);
 	ge2d_manager.ge2d_state=GE2D_STATE_IDLE;
+	spin_unlock(&ge2d_manager.state_lock);
 	return ret;	
 }
 
@@ -854,8 +856,17 @@ int  destroy_ge2d_work_queue(ge2d_context_t* ge2d_work_queue)
 		spin_unlock(&ge2d_manager.event.sem_lock);
 		if((ge2d_manager.current_wq==ge2d_work_queue)&&(ge2d_manager.ge2d_state== GE2D_STATE_RUNNING))
 		{
-			ge2d_manager.ge2d_state=GE2D_STATE_REMOVING_WQ;
-			wait_for_completion(&ge2d_manager.event.process_complete);
+		        // check again with lock
+		        int wasRunning = 0;
+		        spin_lock(&ge2d_manager.state_lock);
+		        if (ge2d_manager.ge2d_state== GE2D_STATE_RUNNING)
+		        {
+			  ge2d_manager.ge2d_state=GE2D_STATE_REMOVING_WQ;
+			  wasRunning = 1;
+			}
+			spin_unlock(&ge2d_manager.state_lock);
+			if (wasRunning)
+			    wait_for_completion(&ge2d_manager.event.process_complete);
 			ge2d_manager.last_wq=NULL;  //condition so complex ,simplify it .
 		}//else we can delete it safely.
 		
@@ -901,6 +912,7 @@ int ge2d_wq_init(void)
 	//prepare bottom half		
 	
 	spin_lock_init(&ge2d_manager.event.sem_lock);
+	spin_lock_init(&ge2d_manager.state_lock);
 	sema_init (&ge2d_manager.event.cmd_in_sem,1); 
 	init_waitqueue_head (&ge2d_manager.event.cmd_complete);
 	init_completion(&ge2d_manager.event.process_complete);
@@ -944,4 +956,3 @@ int   ge2d_deinit( void )
 }
 EXPORT_SYMBOL(ge2d_deinit);
 
-
diff --git a/include/linux/amlogic/ge2d/ge2d_wq.h b/include/linux/amlogic/ge2d/ge2d_wq.h
index 52e8380..b8e037e 100644
--- a/include/linux/amlogic/ge2d/ge2d_wq.h
+++ b/include/linux/amlogic/ge2d/ge2d_wq.h
@@ -81,6 +81,7 @@ typedef  struct {
    ge2d_event_t			event ;
    int		 			irq_num;
    int 		 			ge2d_state;
+   spinlock_t	 			state_lock;  //for sync access to ge2d_state
    int					process_queue_state;
 }ge2d_manager_t ;
 
@@ -261,4 +262,4 @@ extern int ge2d_wq_add_work(ge2d_context_t *wq);
 
 
 
-#endif // BITBLT_H
+#endif // BITBLT_H
\ No newline at end of file
Now this planet is a little more beautiful place. :lol:

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ro4cHii »

Wow, congratulations on that!

Would you mind giving a noob-proof explanation if you find the time?

I literally have absolutely no idea what you're talking about :oops:

Thanks in advance.

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1

Post by Ricardona »

Ro4cHii wrote:Wow, congratulations on that!
Thanks ;)
Would you mind giving a noob-proof explanation if you find the time?
hmmm i don't know how compile a old kernel, only the current one. Im a noob too. I followed the official guide for compiling Odroid C1 kernel. You need some skills in git, make and text editors thats all. There not is a noob-proof sorry :(.
I literally have absolutely no idea what you're talking about :oops:
Sometimes I feel the same :D

Here is new video using Kodi:

https://www.youtube.com/watch?v=dM7dyKsDE4U
[youtube]https://www.youtube.com/watch?v=dM7dyKsDE4U[/youtube]

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ro4cHii »

Okay thanks so far, I will try it as soon as I finished my last exam tomorrow :D

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ro4cHii »

Well, I haven't really had the time to try it so far. I had several problems with Ubuntu/Kodi itself, which I solved now - at least I think so. Anyways, I want to try it tomorrow.
Could you maybe (just roughly, not in detail) explain, what exactly I need to do with the codesnake/linux-amlogic code?
Thanks a lot in advance!

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ricardona »

Ro4cHii wrote:Well, I haven't really had the time to try it so far. I had several problems with Ubuntu/Kodi itself, which I solved now - at least I think so. Anyways, I want to try it tomorrow.
Could you maybe (just roughly, not in detail) explain, what exactly I need to do with the codesnake/linux-amlogic code?
Thanks a lot in advance!
The last released kernel 3.10.80-111 has the modifications for support Kodi-Boblight usage. I know you afraid because you tried several configurations and now finally you found one that works but sometimes is necessary take some risks (this is not a extreme sport :ugeek: ). Maybe you can copy sd or emmc memory and try new configuration.

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ro4cHii »

Wow, that's great!
I tried it yesterday in the evening (managed to install the kernel), but somehow I fucked up while installing Boblight & then my C1 wouldn't start anymore...
Yes I know I have to take some risks, the problem is just that already like 5 times my C1 wouldn't boot anymore. It's very time-consuming, because flashing the image for some reason takes almost 2 hours... Bad SD card adapter maybe, I don't know.
Anyways, I will try it again today.

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ricardona »

Ro4cHii wrote:Wow, that's great!
Yep that is a very good news. Only missing some minor changes to minimize the log kernel spam.
Ro4cHii wrote:I tried it yesterday in the evening (managed to install the kernel), but somehow I fucked up while installing Boblight & then my C1 wouldn't start anymore...
Yes I know I have to take some risks, the problem is just that already like 5 times my C1 wouldn't boot anymore. It's very time-consuming, because flashing the image for some reason takes almost 2 hours... Bad SD card adapter maybe, I don't know.
Sorry about that. I know that feeling, with every new release i need patch and recompile kernel, I do not cross compiling then the process spend more than 1 hour and i need recompile my wifi driver too. That is very tiring process :(.I hope all our efforts will be rewarded some day with a stable kernel. ;)

KennYMcCormick
Posts: 5
Joined: Tue Jul 21, 2015 6:53 pm
languages_spoken: english,french
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by KennYMcCormick »

Hello Ricardona

I update using linux images to 3.10.80-111 with success.
I tried to compile boblight from Pivosgroup to have the boblight-aml client but when i tried, i only have boblightd, boblight-constant and boblight-X11.
I check the makefile.in and it does not contains any reference to boblight-aml.

How did you do to compile it ?

Thanks
Yannick

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ro4cHii »

So, boblight is finally working in Kodi - though only in the menu. Whenever I play a video, the lights go off. Anyone know why? :/

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ricardona »

Ro4cHii wrote:So, boblight is finally working in Kodi - though only in the menu. Whenever I play a video, the lights go off. Anyone know why? :/
What client are you using ?

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ricardona »

KennYMcCormick wrote:I tried to compile boblight from Pivosgroup to have the boblight-aml client but when i tried, i only have boblightd, boblight-constant and boblight-X11.
I check the makefile.in and it does not contains any reference to boblight-aml.

How did you do to compile it ?
I did some changes to the source code, let me some time for create and publish a new repository with my modifications. Maybe this night.

KennYMcCormick
Posts: 5
Joined: Tue Jul 21, 2015 6:53 pm
languages_spoken: english,french
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by KennYMcCormick »

That would be awesome !
Thanks a lot :)

KennYMcCormick
Posts: 5
Joined: Tue Jul 21, 2015 6:53 pm
languages_spoken: english,french
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by KennYMcCormick »

I update to 3.10.80-117 and tried to take the boblight executable from last OpenElec.
Boblightd is running, boblight-aml is connected to daemon, but same issue. Video using hardware decompression does not interact with boblight. Only videos using software decompression.

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ricardona »

KennYMcCormick wrote:I update to 3.10.80-117 and tried to take the boblight executable from last OpenElec.
Boblightd is running, boblight-aml is connected to daemon, but same issue. Video using hardware decompression does not interact with boblight. Only videos using software decompression.
Video using hardware decompression need access to special driver. Check if the boblight-aml client is using /dev/amvideocap0.

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ricardona »

Try client from https://github.com/ricardona/boblight/

Code: Select all

./configure
make 
sudo make install

KennYMcCormick
Posts: 5
Joined: Tue Jul 21, 2015 6:53 pm
languages_spoken: english,french
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by KennYMcCormick »

Thansk a lot ! just tried it now !
You need to configure with --without-portaudio to avoid errors

Ready to make :)

I'm on remote so i can't see if it's working

Startup script for those who are interested, it will start boblight daemon and boblight-aml

Code: Select all

# INIT INFO
# Provides:          boblightd
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: boblightd daemon
# Description:       Boblight daemon
### END INIT INFO

PATH=/usr/local/bin:/bin:/usr/bin
NAME=boblightd
DAEMON=/usr/local/bin/$NAME
PIDFILE=/var/run/$NAME.pid
DESC="boblight daemon"
USER=root


NAME2=boblight-aml
DAEMON2=/usr/local/bin/$NAME2
PIDFILE2=/var/run/$NAME2.pid

[ -x "$DAEMON" ] || exit 0

. /lib/lsb/init-functions

case "$1" in
  start)
    # master switch
      log_daemon_msg "Starting $DESC" "$NAME"
      /sbin/start-stop-daemon --start --exec $DAEMON --background --chuid $USER --make-pidfile --pidfile $PIDFILE
      /sbin/start-stop-daemon --start --exec $DAEMON2 --background --chuid $USER --make-pidfile --pidfile $PIDFILE2
      log_end_msg $?
    ;;
  stop)
 # master switch
      log_daemon_msg "Stopping $DESC" "$NAME"
      /sbin/start-stop-daemon --stop --pidfile $PIDFILE --chuid $USER --exec $DAEMON
      /bin/rm -f $PIDFILE
      /sbin/start-stop-daemon --stop --pidfile $PIDFILE2 --chuid $USER --exec $DAEMON2
      /bin/rm -f $PIDFILE2
      log_end_msg $?
    ;;
  reload|restart)
    $0 stop && $0 start
    ;;
  status)
 status_of_proc -p $PIDFILE $DAEMON $NAME && status_of_proc -p $PIDFILE2 $DAEMON2 $NAME2 && exit 0 || exit $?
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|status}" >&2
    exit 1
    ;;
esac

exit 0

Ro4cHii
Posts: 31
Joined: Fri Feb 13, 2015 10:35 pm
languages_spoken: German, English
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ro4cHii »

Ricardona wrote:
Ro4cHii wrote:So, boblight is finally working in Kodi - though only in the menu. Whenever I play a video, the lights go off. Anyone know why? :/
What client are you using ?
I use the official client from http://boblight.googlecode.com/svn/trunk/. To start it, I use the command boblight-X11.
So... this is not right!? Do I have to use boblight-aml? And about the boblight client from your repo: is boblight-aml already in it? What about using it with Kernel 3.10.84-117? Will it work for videos in Kodi using hardware decompression?

Ricardona
Posts: 93
Joined: Fri Feb 27, 2015 5:51 am
languages_spoken: english spanish
ODROIDs: ODROID C1
Location: Colombia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by Ricardona »

Ro4cHii wrote:I use the official client from http://boblight.googlecode.com/svn/trunk/. To start it, I use the command boblight-X11.
So... this is not right!?
That client have not access to hardware decode videos only have access to desktop applications.
Ro4cHii wrote:Do I have to use boblight-aml? And about the boblight client from your repo: is boblight-aml already in it?
Yep
Ro4cHii wrote:What about using it with Kernel 3.10.84-117? Will it work for videos in Kodi using hardware decompression?
Last night i did tests with new kernel and Kodi without problem. Leds only works when play videos with Kodi (not in desktop app).

KennYMcCormick
Posts: 5
Joined: Tue Jul 21, 2015 6:53 pm
languages_spoken: english,french
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Ambilight with Odroid C1 and Kodi

Post by KennYMcCormick »

My ambilight is finally working !
I have some issues with time response, but i will tweak it on my side !
Thanks a lot Ricardona for your client !

Example :

https://twitter.com/Ryo_0hky/status/623922718572986368
https://twitter.com/Ryo_0hky/status/623988353109749760

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest