Re: [pulseaudio-discuss] gst pulsesrc and default caps

2010-08-16 Thread Alexey Fisher
On Mo, 2010-08-16 at 07:58 +0300, Tanu Kaskinen wrote:
 Correcting myself:
 
 On Mon, 2010-08-16 at 06:42 +0300, Tanu Kaskinen wrote:
  I guess the problem is that pulsesrc doesn't know
  which source is going to be used before actually starts recording.
 
 No, that's not the problem. The problem is that pulsesrc doesn't use the
 proper flags when creating the stream: PA_STREAM_FIX_FORMAT,
 PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS can be used to create the
 stream with whatever parameters are used by the device that the stream
 connects to.
 

Thank you!!! i like this answer :D

Regards,
Alexey

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] gst pulsesrc and default caps

2010-08-16 Thread pl bossart
 On Mon, 2010-08-16 at 06:42 +0300, Tanu Kaskinen wrote:
  I guess the problem is that pulsesrc doesn't know
  which source is going to be used before actually starts recording.

 No, that's not the problem. The problem is that pulsesrc doesn't use the
 proper flags when creating the stream: PA_STREAM_FIX_FORMAT,
 PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS can be used to create the
 stream with whatever parameters are used by the device that the stream
 connects to.


 Thank you!!! i like this answer :D

I don't think that solves the problem. The performance issue is due to
the format/sample-rate conversion.
Using these flags essentially mean that you will record with whatever
native sampling-rate is used by the pulseaudio source (as specified in
daemon.conf) no matter what value is specified when the stream is
created.. It doesn't mean you are going to record at 16kHz natively in
pulseaudio. You will still have to go your src in gstreamer.
-Pierre
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] gst pulsesrc and default caps

2010-08-16 Thread Alexey Fisher
On Mo, 2010-08-16 at 09:06 -0500, pl bossart wrote:
  On Mon, 2010-08-16 at 06:42 +0300, Tanu Kaskinen wrote:
   I guess the problem is that pulsesrc doesn't know
   which source is going to be used before actually starts recording.
 
  No, that's not the problem. The problem is that pulsesrc doesn't use the
  proper flags when creating the stream: PA_STREAM_FIX_FORMAT,
  PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS can be used to create the
  stream with whatever parameters are used by the device that the stream
  connects to.
 
 
  Thank you!!! i like this answer :D
 
 I don't think that solves the problem. The performance issue is due to
 the format/sample-rate conversion.
 Using these flags essentially mean that you will record with whatever
 native sampling-rate is used by the pulseaudio source (as specified in
 daemon.conf) no matter what value is specified when the stream is
 created.. It doesn't mean you are going to record at 16kHz natively in
 pulseaudio. You will still have to go your src in gstreamer.
 -Pierre

It looks like it working for me. Or resample method: (null) mean some
thing other? 


1 source outputs(s) available.
index: 0
driver: protocol-native.c
flags: START_CORKED FIX_FORMAT FIX_RATE FIX_CHANNELS
state: RUNNING
source: 2
alsa_input.usb-046d_0991_9671DCEE-02-U0x46d0x991.analog-mono
current latency: 0,00 ms
requested latency: 27,56 ms
sample spec: s16le 1ch 16000Hz
channel map: mono
 Mono
resample method: (null)
owner module: 9
client: 33 gst-launch-0.10
properties:
media.name = Record Stream
application.name = gst-launch-0.10
native-protocol.peer = UNIX socket client
native-protocol.version = 16
application.process.id = 13431


___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] gst pulsesrc and default caps

2010-08-15 Thread Alexey Fisher
Hallo all,

i hacking currently on cheese and noticed one more performance issue.
i use web cam with sample spec: s16le 1ch 16000Hz, if i start
gstreamer pipe it will get float32le 1ch 44100Hz. I do not see match
sense to upsample stream and than get bigger file size and cpu load.
Especially on netbooks it is painful. Do you have any ideas how to let
gstreamer check what source caps are an than use it?

Here is pipe what i use gst-launch-0.10 pulsesrc ! audioconvert !
vorbisenc quality=0.5 ! oggmux ! filesink location=output.ogg

Regards,
Alexey

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] gst pulsesrc and default caps

2010-08-15 Thread Tanu Kaskinen
On Sun, 2010-08-15 at 19:30 +0200, Alexey Fisher wrote:
 Hallo all,
 
 i hacking currently on cheese and noticed one more performance issue.
 i use web cam with sample spec: s16le 1ch 16000Hz, if i start
 gstreamer pipe it will get float32le 1ch 44100Hz. I do not see match
 sense to upsample stream and than get bigger file size and cpu load.
 Especially on netbooks it is painful. Do you have any ideas how to let
 gstreamer check what source caps are an than use it?
 
 Here is pipe what i use gst-launch-0.10 pulsesrc ! audioconvert !
 vorbisenc quality=0.5 ! oggmux ! filesink location=output.ogg

This question seems more suitable for some GStreamer list, but I'll
comment what I can. I guess the problem is that pulsesrc doesn't know
which source is going to be used before actually starts recording.
Knowing that with 100% certainty isn't strictly speaking even possible,
in case someone writes a module that routes stuff randomly...

Ok, that's probably not going to happen, and certainly such module will
not gain much popularity, so is there something pulsesrc can do? It
could check what's the fallback source, and assume that's the one that
will be used. However, usually module-stream-restore is loaded, and its
opinion may override the fallback setting. Usually routing is done using
the media.role property, so if that's set on the stream, pulsesrc could
check from the stream restore database what routing will be used with
that role. If media.role is not set, there are then some other things
that module-stream-restore checks.

I don't think it makes sense to couple pulsesrc's implementation to
module-stream-restore's implementation, so currently the most sensible
thing is to just use whatever stream format is most comfortable for the
application, i.e. what happens now. It might make sense to add a
possibility for clients to ask pulseaudio where would a stream with
this property list be routed to? Any volunteers to implement that?

-- 
Tanu Kaskinen

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] gst pulsesrc and default caps

2010-08-15 Thread Tanu Kaskinen
Correcting myself:

On Mon, 2010-08-16 at 06:42 +0300, Tanu Kaskinen wrote:
 I guess the problem is that pulsesrc doesn't know
 which source is going to be used before actually starts recording.

No, that's not the problem. The problem is that pulsesrc doesn't use the
proper flags when creating the stream: PA_STREAM_FIX_FORMAT,
PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS can be used to create the
stream with whatever parameters are used by the device that the stream
connects to.

-- 
Tanu Kaskinen

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss