gkaindl / ambi-tv

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

Incorporating Audio #8

Open Mrjohns42 opened 10 years ago

Mrjohns42 commented 10 years ago

Most USB video capture devices, including the one you recommend, also capture audio channels.

How easy would it be to incorporate such data into the LED effects? For example, you could have one program that does "mood lighting" but the colors are driven by some parameter(s) of the audio. Or perhaps, in the traditional ambilight mode, the intensity of the LEDs could be modulated by the volume of the left and right channels.

gkaindl commented 10 years ago

yes, audio would be cool.

the grabber I'm using (not really recommending, but it's the only one I have) is not officially supported, but only has a work-in-progress driver in linux-next that I had to patch in order to support PAL grabbing, which (unlike NTSC) doesn't saturate the RPi's USB bus with its 25fps (as compared to NTSC's 30fps). however, the usbtv driver currently doesn't even support audio.

for other grabbers (like stk1160-powered ones), audio could work, but you will need to write a new "source" component for it. In fact, you might even need to redesign (or at least add another function pointer) to the "soure" component model, since there isn't really a good way to integrate audio right now ("source" components are supposed to output image frames).

The effects you are describing might be cool with music videos (I doubt that they work well with other content), and I'd really like a non-image-based effect that reacts to sound, since I use the same A/V receiver for TV that I also use for audio, so it'd all run over the same device anyway!

Mrjohns42 commented 10 years ago

Which one are you using? Is this the EasyCap DC60 on your parts list?

gkaindl commented 10 years ago

It's an EasyCap-branded device distributed by a company called LogiLink. There are lots of brands that basically sell the same hardware rebranded, but apparently, newer models use the fushicai usbtv chipset, rather than the stk1160. for the former, you should use the driver from my repository, which is one I found in linux-next and patched for PAL support. For the latter, it is well-supported under linux, and will probably work out-of-the-box on the Pi.

Mrjohns42 commented 10 years ago

Do you know if the EasyCap and usbtv driver you've included support audio capture? If so, I can look into creating the necessary components to incorporate into a lighting program.

Phil1988 commented 10 years ago

I had the same idea.. hope you can integrate it Mrjohns... would be great to directly switch from optical (edge-color/average-color, moodlight) to acustics mode... maybe with another key (like "s" for switch...) so i can maybe integrate it to let my arduino say the PI in which mode it should run ^^