Hallo all,
i working currently on cheese to make it use less resources. One thing what is in todo list is to make pulse use less CPU if i make record with cheese or other app. Current cheese will capture default stream and encode it. The problem is, gstreamers pulsesrc do not use same format provided by microphone, so pulse need to resample it and it use more cpu. Simple example: i have webcam which provide "s16le 1ch 16000Hz" pulsesrc will take "float32le 1ch 44100Hz". In this case pulse will convert it. At end point we have bigger file with 44100Hz even if we used source with 16000Hz. Solution is to use flags when creating the stream: PA_STREAM_FIX_FORMAT, PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS. My question is: what is the proper place for this flags? Hard coded in gst-plugins-good0.10? Or some haw by app what use pulsesrc? Other ideas? here is patch what i used to hard code this flags, it work fine for me: --- gst-plugins-good0.10-0.10.24.3.orig/ext/pulse/pulsesrc.c +++ gst-plugins-good0.10-0.10.24.3/ext/pulse/pulsesrc.c @@ -963,6 +963,8 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc #ifdef HAVE_PULSE_0_9_11 PA_STREAM_ADJUST_LATENCY | #endif + PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE | + PA_STREAM_FIX_CHANNELS | PA_STREAM_START_CORKED) < 0) { GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED, ("Failed to connect stream: %s", Regards, Alexey ------------------------------------------------------------------------------ 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 |
On 16.08.2010 13:47, Alexey Fisher wrote:
> Hallo all, > > i working currently on cheese to make it use less resources. One thing > what is in todo list is to make pulse use less CPU if i make record with > cheese or other app. Current cheese will capture default stream and > encode it. The problem is, gstreamers pulsesrc do not use same format > provided by microphone, so pulse need to resample it and it use more > cpu. > Simple example: i have webcam which provide "s16le 1ch 16000Hz" pulsesrc > will take "float32le 1ch 44100Hz". In this case pulse will convert it. > At end point we have bigger file with 44100Hz even if we used source > with 16000Hz. > won't it work using: pulsesrc ! audio/x-raw-int, channels=1,rate=16000 ! ... Stefan > Solution is to use flags when creating the stream: PA_STREAM_FIX_FORMAT, > PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS. > > My question is: what is the proper place for this flags? Hard coded in > gst-plugins-good0.10? Or some haw by app what use pulsesrc? > Other ideas? > > > here is patch what i used to hard code this flags, it work fine for me: > --- gst-plugins-good0.10-0.10.24.3.orig/ext/pulse/pulsesrc.c > +++ gst-plugins-good0.10-0.10.24.3/ext/pulse/pulsesrc.c > @@ -963,6 +963,8 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc > #ifdef HAVE_PULSE_0_9_11 > PA_STREAM_ADJUST_LATENCY | > #endif > + PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE | > + PA_STREAM_FIX_CHANNELS | > PA_STREAM_START_CORKED) < 0) { > GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED, > ("Failed to connect stream: %s", > > > Regards, > Alexey > > > _______________________________________________ > cheese-list mailing list > [hidden email] > http://mail.gnome.org/mailman/listinfo/cheese-list > ------------------------------------------------------------------------------ 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 |
On Mo, 2010-08-16 at 17:46 +0300, Stefan Kost wrote:
> On 16.08.2010 13:47, Alexey Fisher wrote: > > Hallo all, > > > > i working currently on cheese to make it use less resources. One thing > > what is in todo list is to make pulse use less CPU if i make record with > > cheese or other app. Current cheese will capture default stream and > > encode it. The problem is, gstreamers pulsesrc do not use same format > > provided by microphone, so pulse need to resample it and it use more > > cpu. > > Simple example: i have webcam which provide "s16le 1ch 16000Hz" pulsesrc > > will take "float32le 1ch 44100Hz". In this case pulse will convert it. > > At end point we have bigger file with 44100Hz even if we used source > > with 16000Hz. > > > > won't it work using: pulsesrc ! audio/x-raw-int, channels=1,rate=16000 ! ... I wrote - it is for Cheese or even for gnome sound recorder. Check your microphone - it will have other format. So - no. It should make automatically correct choice. PA_STREAM_FIX_ make it possible. > > Solution is to use flags when creating the stream: PA_STREAM_FIX_FORMAT, > > PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS. > > > > My question is: what is the proper place for this flags? Hard coded in > > gst-plugins-good0.10? Or some haw by app what use pulsesrc? > > Other ideas? > > > > > > here is patch what i used to hard code this flags, it work fine for me: > > --- gst-plugins-good0.10-0.10.24.3.orig/ext/pulse/pulsesrc.c > > +++ gst-plugins-good0.10-0.10.24.3/ext/pulse/pulsesrc.c > > @@ -963,6 +963,8 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc > > #ifdef HAVE_PULSE_0_9_11 > > PA_STREAM_ADJUST_LATENCY | > > #endif > > + PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE | > > + PA_STREAM_FIX_CHANNELS | > > PA_STREAM_START_CORKED) < 0) { > > GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED, > > ("Failed to connect stream: %s", > > > > > > Regards, > > Alexey > > > > > > _______________________________________________ > > cheese-list mailing list > > [hidden email] > > http://mail.gnome.org/mailman/listinfo/cheese-list > > > ------------------------------------------------------------------------------ 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 |
On 16.08.2010 17:57, Alexey Fisher wrote:
> On Mo, 2010-08-16 at 17:46 +0300, Stefan Kost wrote: > >> On 16.08.2010 13:47, Alexey Fisher wrote: >> >>> Hallo all, >>> >>> i working currently on cheese to make it use less resources. One thing >>> what is in todo list is to make pulse use less CPU if i make record with >>> cheese or other app. Current cheese will capture default stream and >>> encode it. The problem is, gstreamers pulsesrc do not use same format >>> provided by microphone, so pulse need to resample it and it use more >>> cpu. >>> Simple example: i have webcam which provide "s16le 1ch 16000Hz" pulsesrc >>> will take "float32le 1ch 44100Hz". In this case pulse will convert it. >>> At end point we have bigger file with 44100Hz even if we used source >>> with 16000Hz. >>> >>> >> won't it work using: pulsesrc ! audio/x-raw-int, channels=1,rate=16000 ! ... >> > > > I wrote - it is for Cheese or even for gnome sound recorder. Check your > microphone - it will have other format. So - no. It should make > automatically correct choice. PA_STREAM_FIX_ make it possible. > > > format without any conversions". Could you file a feature request for it into the gnome-bugzilla? Stefan > >>> Solution is to use flags when creating the stream: PA_STREAM_FIX_FORMAT, >>> PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS. >>> >>> My question is: what is the proper place for this flags? Hard coded in >>> gst-plugins-good0.10? Or some haw by app what use pulsesrc? >>> Other ideas? >>> >>> >>> here is patch what i used to hard code this flags, it work fine for me: >>> --- gst-plugins-good0.10-0.10.24.3.orig/ext/pulse/pulsesrc.c >>> +++ gst-plugins-good0.10-0.10.24.3/ext/pulse/pulsesrc.c >>> @@ -963,6 +963,8 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc >>> #ifdef HAVE_PULSE_0_9_11 >>> PA_STREAM_ADJUST_LATENCY | >>> #endif >>> + PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE | >>> + PA_STREAM_FIX_CHANNELS | >>> PA_STREAM_START_CORKED) < 0) { >>> GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED, >>> ("Failed to connect stream: %s", >>> >>> >>> Regards, >>> Alexey >>> >>> >>> _______________________________________________ >>> cheese-list mailing list >>> [hidden email] >>> http://mail.gnome.org/mailman/listinfo/cheese-list >>> >>> >> > > ------------------------------------------------------------------------------ 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 |
On Di, 2010-08-17 at 13:07 +0300, Stefan Kost wrote:
> > > > > > I wrote - it is for Cheese or even for gnome sound recorder. Check your > > microphone - it will have other format. So - no. It should make > > automatically correct choice. PA_STREAM_FIX_ make it possible. > > > > > > > Ahh, so you probably want a property to express "please use native > format without any conversions". Could you file a feature request for it > into the gnome-bugzilla? Ok, i did it: https://bugzilla.gnome.org/show_bug.cgi?id=627263 Thank you for understanding. Regards, Alexey ------------------------------------------------------------------------------ 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 |
Free forum by Nabble | Edit this page |