gkaindl / ambi-tv

a flexible ambilight clone for embedded linux
296 stars 85 forks source link

NTSC support #10

Closed mjseid closed 10 years ago

mjseid commented 10 years ago

Hello, I am using the same USB capture device you are (verified same chipset) but since all my content is in NTSC format, I've commented the "define AMBITV_PAL_HACK" out of the usbtv driver and compiled the kernel module.

It looks like the device is getting recognized from "v4l-info" and "v4l2-compliance -T", but when I try to run the program with composite NTSC 480i input I get the following error:

root@raspberrypi:/ambi-tv/bin# ./ambi-tv


registration: registered component 'v4l2-video' (class v4l2-grab-source). device name: /dev/video0 buffers: 4 crop-top: 1 crop-right: 4 crop-bottom: 1 crop-left: 4 auto-crop luma threshold: 8 registration: registered component 'timer-30fps' (class timer-source). millis: 33 registration: registered component 'led-frame' (class lpd8806-spidev-sink). device name: /dev/spidev0.0 spi hz: 2500000 number of leds: 98 blending frames: 3 led insets (tblr): -0.8%, -3.0%, -9.0%, -9.0% gamma (rgb): 1.55, 1.60, 1.50 registration: registered component 'avg-color' (class avg-color-processor). registration: registered component 'edge-color' (class edge-color-processor). box-width: 8 box-height: 8 registration: registered component 'mood-light' (class mood-light-processor). speed: 2.0 program: 'program_tv_edge_color': appended component 'v4l2-video'. program: 'program_tv_edge_color': appended component 'edge-color'. program: 'program_tv_edge_color': appended component 'led-frame'. program: registered program 'program_tv_edge_color'. program: 'program_tv_avg_color': appended component 'v4l2-video'. program: 'program_tv_avg_color': appended component 'avg-color'. program: 'program_tv_avg_color': appended component 'led-frame'. program: registered program 'program_tv_avg_color'. program: 'program_mood_light': appended component 'timer-30fps'. program: 'program_mood_light': appended component 'mood-light'. program: 'program_mood_light': appended component 'led-frame'. program: registered program 'program_mood_light'. main: configuration finished, 3 programs available. program_tv_edge_color program_tv_avg_color program_mood_light component: activating component 'v4l2-video'... v4l2-grab: video format: 720x480 (YUYV). v4l2-grab: failed to start video streaming: 71 (Protocol error). main: failed to start initial program 'program_tv_edge_color', aborting... root@raspberrypi:/ambi-tv/bin#

Have you seen this in your testing, or any suggestions?

mjseid commented 10 years ago

Another thought....I ordered the hdmi to composite converter you used, but still waiting for it to show up so right now I'm testing with composite straight from a DVD player. Looking through the other "issues" I noticed someone said the converter itself has a PAL/NTSC switch on it.

In your setup is your source feed NTSC to the converter, and then using the PAL switch from there to the USB cap? Or is your video PAL all the way from the source. Thanks

mjseid commented 10 years ago

I found the issue. The easycap device comes with a skinny USB extension cable. I was using the cable between the easycap and the pi when getting this error.

I removed the extension cable and plugged directly into the pie ports and the error went away. I haven't connected the LED lights to verify %100 functionality yet, but I am positive the USB extension was the issue, so if you get one don't use it. Hope this was helpful for someone else.

Mrjohns42 commented 10 years ago

The USB extension cable might have had resistance in it that was preventing the easycap from getting the power it needs to run properly. Did you try using the USB extension, but having it go through a powered USB hub instead of directly to the RPi?

mjseid commented 10 years ago

Good suggestion, I did try that actually since I'm using a powered usb hub for my wireless network and keyboard cards. No luck.

The usb cord does seem to work for mounting a usb drive on my desktop, but maybe you're right and the wires are too small having too much resistance. Or maybe the cables aren't shielded well enough since its sitting next to a 10amp power supply for the LED's and a older 46" LCD TV?

sn00zerman commented 10 years ago

Hello,

My Ambi-light is up-and-running, with my 118" / 300 cm screen. (Epson HD / 3D beamer) I used 5M x 48 LED/m, my frame to put the LEDs on, is about 15 cm behind the screen, in every direction. I completely needed to use the 5M LEDstrip, resulting in 260 LEDs. Everything works fine now, no need for overclocking my PI.

I also have the same Easycap. For me, the small USB extension cable works fine. However, I need to use a power USB hub ! With or without the extension cable, doesn't make any difference. BTW, I'm using Raspberry Pi of the first revision.

What was weird for me, was the fact that B & G seems to be "the other way around" on my LED-strips. (ebay objectnr 171078423920 - 5M x 48 LED/m) So, I modified the LPD_8806 code, to output the green and blue the other way around, which solved my only problem that I had :-) Already watched some TV, and 2 movies ...

THANKS FOR THIS GREAT SOFTWARE ! (I will put a 5-minutes movie onto my website, this weekend)

best regards from Belgium, Kris

-=[http://www.digitalplayground.be]=- where fun meets technology

On 22 aug 2013 01:37 "mjseid" notifications@github.com wrote:

Good suggestion, I did try that actually since I'm using a powered usb hub for my wireless network and keyboard cards. No luck.

The usb cord does seem to work for mounting a usb drive on my desktop, but maybe you're right and the wires are too small having too much resistance. Or maybe the cables aren't shielded well enough since its sitting next to a 10amp power supply for the LED's and a older 46" LCD TV?

Date: Wed, 21 Aug 2013 15:21:17 -0700 From: notifications@github.com To: ambi-tv@noreply.github.com CC: seidy01@hotmail.com Subject: Re: [ambi-tv] NTSC support (#10)

The USB extension cable might have had resistance in that was preventing the easycap from getting the power it needs to run properly. Did you try using the USB extension, but having it go through a powered USB hub instead of directly to the RPi?

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub https://github.com/gkaindl/ambi-tv/issues/10#issuecomment-23058818.

mjseid commented 10 years ago

Kris, looking forward to your video. I've just temporarily taped my lights to the TV to get things working before I decide a more permanent setup so I'd love to see how your frame looks.

Also since the USB extension cable I got didn't work for me, I figured I'd cut it in half and use it to go from my PS plug to a mini-USB cord and then to the PI for power. That way I wouldn't have to cut up a min-usb cable that I have lots of other uses for.

Long story short the extension cable was as expected not shielded. So I'm guessing either that was it or maybe the internal connections for the data lines were just bad.

gkaindl commented 10 years ago

@sn00zerman whoa, that's a huge screen! really looking forward to your video! odd about the switched color channels, though – maybe I should turn this into a configuration option then, so that you can define the order of the colors via the conf file.

@mjseid yes, I really wouldn't recommend a USB extension cable to connect the grabber, since I haven't had a lot of luck with that either. Also, make sure that the supply powering the RPi can at least provide 1A or so, since the grabber will draw a good amount of power as well.

sn00zerman commented 10 years ago

Hi gkaindl,

Movie of my "setup": http://www.youtube.com/embed/1Ld5XBeL8n4 (I like the "cool" effect, around 4 minutes in the video, the green radar fullscreen, followed by the green lights around the screen) Pictures will also follow within the next week ... on my personal blog http://www.digitalplayground.be

Because my setup also supports 3D, I'm currently implementing an "interpreter" for 3D movies. (I will implement both "Side-by-Side" and "Top-to-bottom") I hope I can contribute my code to your project :-)

greetings from Belgium, Kris

-=[http://www.digitalplayground.be]=- where fun meets technology

On 23 aug 2013 00:55 "gkaindl" notifications@github.com wrote:

@sn00zerman https://github.com/sn00zerman whoa, that's a huge screen! really looking forward to your video! odd about the switched color channels, though – maybe I should turn this into a configuration option then, so that you can define the order of the colors via the conf file.

@mjseid https://github.com/mjseid yes, I really wouldn't recommend a USB extension cable to connect the grabber, since I haven't had a lot of luck with that either. Also, make sure that the supply powering the RPi can at least provide 1A or so, since the grabber will draw a good amount of power as well.

— Reply to this email directly or view it on GitHub https://github.com/gkaindl/ambi-tv/issues/10#issuecomment-23132508.

Mrjohns42 commented 10 years ago

Just to be clear, what is required to support an NTSC hdmi signal? Just commenting out the #define AMBITV_PAL_HACK? Flipping the switch on the converter to PAL (does that switch determine output format, or configure the circuitry to process the corresponding input format)?

mjseid commented 10 years ago

Yep, just comment out that define and recompile.

The switch on the converter sets the output format, regardless of what the input format is. I.E you can use NTSC input and just switch the converter to the PAL setting and everything is fine.