spectrum element and seeking

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

spectrum element and seeking

Maximilan Hoegner
Hello,

I'm trying to use the spectrum element for displaying the spectrum in an
GTK application that uses seeking. Normally, when I connect to the bus
and listen for the spectrum messages, I get a message once every 100ms.
Now if I seek and set the pipeline to PLAYING, I get the messages for a
few seconds in advance all at once, then for some time no messages. This
only happens the second time I seek.
I programmed a minimal application that shows this behavior:
http://pastebin.org/463182
It plays one second of a song, beginning from 2.0, using a spectrum
element, and printing the stream time for each spectrum message. Then it
repeats this procedure, and this is what I get:

2000000000
[100ms of music]
2100000000
[100ms of music]
2200000000
[100ms of music]
2300000000
[100ms of music]
2400000000
[100ms of music]
2500000000
[100ms of music]
2600000000
[100ms of music]
2700000000
[100ms of music]
2800000000
[100ms of music]
2900000000
[100ms of music]
[some idle time until the timeout callback is called for second playback]
2000000000
2100000000
2200000000
2300000000
2400000000
2500000000
2600000000
2700000000
2800000000
2900000000
[1s of music]

Can anyone explain this behavior? Perhaps I made something fundamentally
wrong, but how then do I program a graphical spectrum analyzer that
supports seeking? Am I doing something wrong with the seeking part of
the program?

Thank you very much in advance,
Maxi


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

signature.asc (294 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: spectrum element and seeking

Stefan Sauer
Am 10.08.2010 02:10, schrieb maxi:

> Hello,
>
> I'm trying to use the spectrum element for displaying the spectrum in an
> GTK application that uses seeking. Normally, when I connect to the bus
> and listen for the spectrum messages, I get a message once every 100ms.
> Now if I seek and set the pipeline to PLAYING, I get the messages for a
> few seconds in advance all at once, then for some time no messages. This
> only happens the second time I seek.
> I programmed a minimal application that shows this behavior:
> http://pastebin.org/463182

Lol. I was reworking the spectrum analyer in buzztard and also stumbled over
some issues with seeking and the spectrum element. The first buffer after
seeking is marked as discont and then the spectrum analyzer needs a few more
samples before it can run a fft again. But that does not explain the behaviour
you see here.

Stefan


> It plays one second of a song, beginning from 2.0, using a spectrum
> element, and printing the stream time for each spectrum message. Then it
> repeats this procedure, and this is what I get:
>
> 2000000000
> [100ms of music]
> 2100000000
> [100ms of music]
> 2200000000
> [100ms of music]
> 2300000000
> [100ms of music]
> 2400000000
> [100ms of music]
> 2500000000
> [100ms of music]
> 2600000000
> [100ms of music]
> 2700000000
> [100ms of music]
> 2800000000
> [100ms of music]
> 2900000000
> [100ms of music]
> [some idle time until the timeout callback is called for second playback]
> 2000000000
> 2100000000
> 2200000000
> 2300000000
> 2400000000
> 2500000000
> 2600000000
> 2700000000
> 2800000000
> 2900000000
> [1s of music]
>
> Can anyone explain this behavior? Perhaps I made something fundamentally
> wrong, but how then do I program a graphical spectrum analyzer that
> supports seeking? Am I doing something wrong with the seeking part of
> the program?
>
> Thank you very much in advance,
> Maxi
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev 
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: spectrum element and seeking

Maximilan Hoegner
In the meantime, I found an example on how to use the spectrum element
properly:
http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/spectrum/demo-osssrc.c
They seem to delay the messages manually. I do not understand whether
the behavior of the spectrum messages is normal or not, but now I think
I know how to make the spectrum analyzer work with seeking.
Unfortunately, I cannot do this in Python because of
https://bugzilla.gnome.org/show_bug.cgi?id=380495, so have to program
this part in C.

Maxi

Am 11.08.2010 23:02, schrieb Stefan Kost:

> Am 10.08.2010 02:10, schrieb maxi:
>  
> Lol. I was reworking the spectrum analyer in buzztard and also stumbled over
> some issues with seeking and the spectrum element. The first buffer after
> seeking is marked as discont and then the spectrum analyzer needs a few more
> samples before it can run a fft again. But that does not explain the behaviour
> you see here.
>
> Stefan
>
>  


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

signature.asc (294 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: spectrum element and seeking

Stefan Sauer
Am 12.08.2010 02:29, schrieb maxi:
> In the meantime, I found an example on how to use the spectrum element
> properly:
> http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/spectrum/demo-osssrc.c
> They seem to delay the messages manually. I do not understand whether
> the behavior of the spectrum messages is normal or not, but now I think
> I know how to make the spectrum analyzer work with seeking.
> Unfortunately, I cannot do this in Python because of
> https://bugzilla.gnome.org/show_bug.cgi?id=380495, so have to program
> this part in C.

The delaying is actually a small detail. I makes sure you e.g. render the graph
on the screen at the same time , when the corresponding audio is played. This
matters a lot for the level meter, but not so much for spectrum (especially when
using many fft-bands -> bad time resolution).

Stefan

>
> Maxi
>
> Am 11.08.2010 23:02, schrieb Stefan Kost:
>> Am 10.08.2010 02:10, schrieb maxi:
>>  
>> Lol. I was reworking the spectrum analyer in buzztard and also stumbled over
>> some issues with seeking and the spectrum element. The first buffer after
>> seeking is marked as discont and then the spectrum analyzer needs a few more
>> samples before it can run a fft again. But that does not explain the behaviour
>> you see here.
>>
>> Stefan
>>
>>  
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev 
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel