-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use sound from the grabber ? #9
Comments
With pulseaudio you can just select the source like here: #4 (comment) But if you want to use alsa like I prefer to, you can modify the
If you have multiple audio devices and use different device for recording and playback, the it's a bit trickier to setup. For the gstreamer I have used |
RanzQ
wich shows that I do not have any playing device. That makes senses since Pi is not connected to any monitor or audio, it's just driving the Video Grabber (input) to show LED with hyperion. So I understand I need a sound loopback in case of Pi playing audio to output and then get this audio back to analyse it to drive hyperion LED. So, just curious, I my case, do I need to use snd-aloop since the audio is captured by the grabber ? So I've done
seems all is now fine in term of device. so I updated /root/.asoundrc as you suggested (so setting the capture card)
and I launched
No led light and nothing more is displayed by main.py (just the above numbers) . What is strange is that when I run alsamixer I see my device but it says Of course, connected my Sonos RCA output to grabber audio input and played music ;-) Any idea ? Thank you very much for your help |
Actually I haven't driven this audio analyzer on my Pi, I think it will be too heavy... On my HTPC it runs fine by connecting to the local hyperion. For my Pi setup I use external PC to play music and run this software. Then it just connects to Pi via network. Anyway, the levels might be too low. If you can't change the volume with alsamixer, you can adjust the input level range with config here: https://github.com/RanzQ/hyperion-audio-effects/blob/master/effects/vumeter.json#L8 And set https://github.com/RanzQ/hyperion-audio-effects/blob/master/effects/vumeter.py#L155 The default VU meter effect isn't that heavy, but with EDIT: Try also to set the default control device:
|
Wohh, fast support 👍 Ok now I plugged the Sonos RCA output into the grabber and not into the HDMI2AV I've got better results, stupid am I, I took the 1st RCA I've seen (the grabber was behind my AVR)
Then I start effect
it grab some data and light the vu-meter on left/right of my TV ;-), but just once, I left the effect running and the only data I grabbed is the few lines above, after all is static and nothing move. It's like when grabbed one set of data, it was stopping and doing nothing. If I stop and I launch back arecord, arecord works fine so input entry still receiving signal. I tried both in .asoundrc, with and without
I'm pretty sure to be so close that it's generating some frustration ;-) . |
You removed everything else from the You can try to force the device by changing the And also try if Gstreamer messages work at all (my python code actually uses them internally) with this command:
Or with forced device:
It should output a message once per second. I got messages like these when playing music, I think the NULL values are caused by some legacy code, with python I get numeric values correctly:
|
yeah I removed everything else as you suggested. gstreamer works fine, got message every seconds with like you "null" bug value So I put a debug line into
So from "reading sound" view, all seems to be fine. May be a transfer problem to hyperion because when now I add the parameters |
Oh, forgot to mention, by the way parameter |
What is your LED type? Lightberry kit is WS2811 and the HD version is WS2812B if I remember correctly. I think there might be some problems when using sound and LEDs at the same time, check this for example: https://github.com/tvdzwan/hyperion/issues/194 Also, the levels you get seem to be quite high, so it would be better if you could lower the input signal with alsamixer or from your AVR. The reason I had the levels in config from 90 to 100 is that the led bar is shown on that range. Decay is the bar height and peak is the single led that stays up a bit longer, maybe this video from the debugging GUI helps a bit : |
Good catch, I've got home made kit :
Yeah I lowered signal on Sonos app, to be sure not "full scale", the number decrease but LED still blocked. Everything is fine, each video signal from my AVR is "ambilighted", now I'm trying music ;-) I've just tried with spectrum effect, in fact it works better the only drawback is about 1 refresh per second but you warned me about this. I will try disabling the video grabber to test but I just looked behind my avr, I'm stuck, amazing I do not have any line out, just one for Zone2 and does not output when input is digital, my goodness new technologies sometimes forget basic things, such as video and audio analog out !!!! |
Lightberry uses ws2801 in all versions :) |
Ok, I forgot that version. :) |
@RanzQ, Tried to set it up. Started: python main.py --effect vumeter --config /etc/hyperion.config.json --idx --json --host 127.0.0.1 --port 19444 and get: Can also see that the levels go up down depending on the loudness of the music or if I change the gain in alsamixer. Should this be fine and I can't see something going to the LEDs because of ws2801? |
@giovanne123 That looks like your sound setup is fine. First you can try without the json connection:
Are you on a Pi? On that the gui might be too heavy. And does your hyperion setup work, have you tried some effects with it? The |
@RanzQ , Yes, on a Pi. Will try to test if it is running there ;-) The hyperion setup on the same Pi with the config (/etc/hyperion.config.json) is working fine. Using the hyperion app for example. For the --idx / defined leds I have to look where this is defined... |
@giovanne123 it reads you led setup from the hyperion config. And actually I remembered wrong, So you run this Because if you run this remotely, then you have to copy your config .json from your Pi and check its local IP. Then use that ip on To make clear, this python script doesn't run hyperion, it just controls it. :) |
@RanzQ , Now additionally your python should control it locally. But there was a little mistake in my hyperion.config.json But now I get an index out of bounce !!?? : |
Ok, seems to be vumeter related. starting with effect color_spectrum works for both the gui and the ws2801 led strip ;-) Think have to look in detail how your python should work... |
@giovanne123 If you know which is your first led, you can also set them manually in
That would set the bars like 10 leds from both ends of your strip. I try to read left and right side from the hyperion config but it's not so simple format and I might have bugs there. :) |
@RanzQ , I have done this in vumeter.json also and can see the led numbers in output, but no led is lighting. python main.py --effect vumeter --config /etc/hyperion.config.json --json --host 127.0.0.1 --port 19444 --gui With color_spectrum effect it is working but not very smooth at the moment. Can I control smoothness? |
@giovanne123 also set the levels in
Sorry I have adjusted them to my own preference. It depends on your volume in alsamixer what looks good. :) |
Smoothness cannot be adjusted. Pi isn't just powerful enough to process the audio fast like this. |
@RanzQ , I will have a look to the other config params etc. But now everything for my first tests is working: Thanks a lot!!! |
Cool. :) |
Very nice effect ;-)
I'm using hyperion with a grabber so I can have hyperion working with all my sources from my avr (sat, bray, box ,,) and my sound system is a sonos connected to my avr also.
So how can I setup to get the sound from the capture board instead of the loopback alsa ? (like I do for the video in fact) ?
Thank you for your help
The text was updated successfully, but these errors were encountered: