Soundcard 'monitor' stream doesn't arrive with Spectrum plugin

Cefn Hoile lists.freedesktop.org at cefn.com
Tue Jun 12 07:25:37 PDT 2012


On 12 June 2012 14:40, Stefan Sauer <ensonic at hora-obscura.de> wrote:
> On 06/12/2012 04:13 AM, Cefn Hoile wrote:
>> I'm hoping to base a tutorial demo on the first python example linked
>> below, and I attempted to test its logic by playing music from
>> Rhythmbox through my (Ubuntu Oneiric) soundcard while visualising the
>> result of the 'spectrum' FFT as changing numbers streaming on the
>> console. Sadly this first debugging step was a failure.
>>
>> http://pzwart3.wdka.hro.nl/wiki/Spectrum.py
>>
>> The spectrum plugin loaded by this python script only ever reports -60
>> decibels for every frequency band in the spectrum, regardless how loud
>> I turn up the music!
> You can change that:
> spectrum threshold=-96
>
> Stefan
>>
>> I have tried both alsasrc and pulsesrc with various device names
>> (default, pulse, the introspected alsa monitor device name from pactl)
>> at the beginning of the listener_desc pipeline (declared in the linked
>> code). In most of the cases I've tried (barring typos) the pipeline
>> seems to be established and run perfectly fine (as far as I can tell)
>> but somehow no sound frequencies show up in the frequency analysis
>> from the spectrum plugin.
>>
>> Does this python code work for anyone else? How would I verify that
>> the pipeline is correct, or narrow down the problem? Any suggestions
>> what the initial source plugin or entire pipeline should in fact be on
>> an Ubuntu system to get loudnesses per frequency range streaming out
>> of the spectrum plugin to the console using this code as a reference?
>>
>> Thanks for any help.
>>
>> Cefn
>> http://cefn.com
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

Thanks for the suggestion, Stefan. You're right you can change it :)
Now I get regular lines which report -96 instead of -60 ...

data: -96.0 -96.0 -96.0 -96.0 -96.0 -96.0 -96.0 -96.0

My current pipeline looks like this...

pulsesrc device="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" !
spectrum threshold=-96 interval=1000000000 bands=8 ! fakesink

...and still the DB levels never vary depending on output from the soundcard.

Cefn
http://cefn.com


More information about the gstreamer-devel mailing list