problem with pa_stream_make_writeable_size() failed connection terminated

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

problem with pa_stream_make_writeable_size() failed connection terminated

Nathanael D. Noblet
Hello Everyone,

   So I've built an application based on gstreamer that's been working
well so far. I've recently run into an issue that I don't understand.
I'm hoping someone here will know what I should look at.

   So I read from an IP camera via rtspsrc. It sends video in MP4 format
and Audio in AAC. We're running a beta with our client and recently
after installing it on location I've run into issues with one location.
After 5-9 seconds I get

pa_stream_make_writeable_size() failed connection terminated

this causes the stream to pause if I'm recording, but not if I'm just
viewing.

After taking a look I found the following differences. The cameras that
worked were set to have audio at 96Kbps vs 16Kbps. I only noticed when I
compared the caps that each pad-added pad from the decoder had.

The one that has the problem was:

application/x-rtp, media=(string)audio, payload=(int)97,
clock-rate=(int)16000, encoding-name=(string)MPEG4-GENERIC,
encoding-params=(string)2, streamtype=(string)5,
profile-level-id=(string)15, mode=(string)AAC-hbr, config=(string)1410,
sizelength=(string)13, indexlength=(string)3,
indexdeltalength=(string)3, ctsdeltalength=(string)0,
dtsdeltalength=(string)0, a-charset=(string)Shift_JIS,
a-etag=(string)1234567890, clock-base=(uint)0, seqnum-base=(uint)0,
npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1;

and the one that worked:
application/x-rtp, media=(string)audio, payload=(int)97,
clock-rate=(int)44100, encoding-name=(string)MPEG4-GENERIC,
encoding-params=(string)2, streamtype=(string)5,
profile-level-id=(string)15, mode=(string)AAC-hbr, config=(string)1210,
sizelength=(string)13, indexlength=(string)3,
indexdeltalength=(string)3, ctsdeltalength=(string)0,
dtsdeltalength=(string)0, a-charset=(string)Shift_JIS,
a-etag=(string)1234567890, clock-base=(uint)0, seqnum-base=(uint)0,
npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1;

A diff of the two was what tipped me off to the difference between the
two cameras:

@@ -1,13 +1,13 @@
  Structure application/x-rtp,
  media=(string)audio,
  payload=(int)97,
-clock-rate=(int)16000,
+clock-rate=(int)44100,
  encoding-name=(string)MPEG4-GENERIC,
  encoding-params=(string)2,
  streamtype=(string)5,
  profile-level-id=(string)15,
  mode=(string)AAC-hbr,
-config=(string)1410,
+config=(string)1210,
  sizelength=(string)13,
  indexlength=(string)3,
  indexdeltalength=(string)3,


Once I changed the settings on the camera it started working again,
lowering the bitrate causes the error again.

So I'm at a total loss as to what the error I get about
pa_stream_make_writeable_size() has to do with the audio bitrate.

I'm *really* hoping someone could shed some light on this so I can
understand what the issue is and how to work around it.

--
Nathanael d. Noblet


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem with pa_stream_make_writeable_size() failed connection terminated

pl bossart
>   So I read from an IP camera via rtspsrc. It sends video in MP4 format
> and Audio in AAC. We're running a beta with our client and recently
> after installing it on location I've run into issues with one location.
> After 5-9 seconds I get
>
> pa_stream_make_writeable_size() failed connection terminated

This is an issue in the connection with PulseAudio. Since it's PCM at
that point, I don't think it's an issue with the bitrate of the AAC
payload.
Can you try and capture the pulseaudio log (pulseaudio -vvvv 2>
log.txt). Don't send the log, which can be pretty long, just a link on
something like pastebin.
-Pierre

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem with pa_stream_make_writeable_size() failed connection terminated

Nathanael D. Noblet
On 01/26/2011 10:21 AM, pl bossart wrote:

>>    So I read from an IP camera via rtspsrc. It sends video in MP4 format
>> and Audio in AAC. We're running a beta with our client and recently
>> after installing it on location I've run into issues with one location.
>> After 5-9 seconds I get
>>
>> pa_stream_make_writeable_size() failed connection terminated
>
> This is an issue in the connection with PulseAudio. Since it's PCM at
> that point, I don't think it's an issue with the bitrate of the AAC
> payload.
> Can you try and capture the pulseaudio log (pulseaudio -vvvv 2>
> log.txt). Don't send the log, which can be pretty long, just a link on
> something like pastebin.

Yeah I can't seem to figure out what it could be either. I do have
SELinux rules in place, however the messages don't stop when SELinux is
disabled. Also in testing, my x86_64 box doesn't exhibit the same
behaviour *nearly* as often/reliably as the little netbooks do. In
anycase, here's the output from a pulseaudio session where I did get
this message....

http://fpaste.org/j0Jo/


I don't see anything obvious but with that many lines I really didn't
have a clue what to look for at all. Ask for whatever output you need
and I'll do my best to make it happen.

Since you feel it is permissions based I'll also explain that my app is
setgid in the areas that are starting the gstreamer threads. So it is
quite possible that for one reason or another gstreamer/pulse
interaction is having issues, however they do go away with higher
bitrates which is really odd to me... Perhaps the bitrates/clock-rate
cause a change request or something that doesn't happen when they are
higher but I'm really at a loss. I may try to debug using gdb to see if
I can get a bt...

Thanks for the help thus far, I'd really like to understand what is
going on...

--
Nathanael d. Noblet

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem with pa_stream_make_writeable_size() failed connection terminated

David Henningsson
On 2011-01-27 07:55, Nathanael D. Noblet wrote:

> On 01/26/2011 10:21 AM, pl bossart wrote:
>>>     So I read from an IP camera via rtspsrc. It sends video in MP4 format
>>> and Audio in AAC. We're running a beta with our client and recently
>>> after installing it on location I've run into issues with one location.
>>> After 5-9 seconds I get
>>>
>>> pa_stream_make_writeable_size() failed connection terminated
>>
>> This is an issue in the connection with PulseAudio. Since it's PCM at
>> that point, I don't think it's an issue with the bitrate of the AAC
>> payload.
>> Can you try and capture the pulseaudio log (pulseaudio -vvvv 2>
>> log.txt). Don't send the log, which can be pretty long, just a link on
>> something like pastebin.
>
> Yeah I can't seem to figure out what it could be either. I do have
> SELinux rules in place, however the messages don't stop when SELinux is
> disabled. Also in testing, my x86_64 box doesn't exhibit the same
> behaviour *nearly* as often/reliably as the little netbooks do. In
> anycase, here's the output from a pulseaudio session where I did get
> this message....
>
> http://fpaste.org/j0Jo/
>
>
> I don't see anything obvious but with that many lines I really didn't
> have a clue what to look for at all. Ask for whatever output you need
> and I'll do my best to make it happen.
>
> Since you feel it is permissions based I'll also explain that my app is
> setgid in the areas that are starting the gstreamer threads. So it is
> quite possible that for one reason or another gstreamer/pulse
> interaction is having issues, however they do go away with higher
> bitrates which is really odd to me... Perhaps the bitrates/clock-rate
> cause a change request or something that doesn't happen when they are
> higher but I'm really at a loss. I may try to debug using gdb to see if
> I can get a bt...
>
> Thanks for the help thus far, I'd really like to understand what is
> going on...

PulseAudio eats too much CPU in RT-prio time and ends up getting killed
by the kernel. One way to counteract this is for gstreamer to send few
big packets instead of many small ones, so soes the patch I posted here
recently help to resolve this symptom?

See
http://gstreamer-devel.966125.n4.nabble.com/attachment/3207515/0/default-buffer-size.patch

--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem with pa_stream_make_writeable_size() failed connection terminated

Nathanael D. Noblet
On 01/27/2011 03:36 AM, David Henningsson wrote:

>> Thanks for the help thus far, I'd really like to understand what is
>> going on...
>
> PulseAudio eats too much CPU in RT-prio time and ends up getting killed
> by the kernel. One way to counteract this is for gstreamer to send few
> big packets instead of many small ones, so soes the patch I posted here
> recently help to resolve this symptom?
>
> See
> http://gstreamer-devel.966125.n4.nabble.com/attachment/3207515/0/default-buffer-size.patch


I don't think pulse is dying as I've killed pulse manually and the error
message I get is different, however I will patch my copy with the above
and let you know if it helps at all.

--
Nathanael d. Noblet


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem with pa_stream_make_writeable_size() failed connection terminated

Nathanael D. Noblet
In reply to this post by David Henningsson
On 01/27/2011 03:36 AM, David Henningsson wrote:
> PulseAudio eats too much CPU in RT-prio time and ends up getting killed
> by the kernel. One way to counteract this is for gstreamer to send few
> big packets instead of many small ones, so soes the patch I posted here
> recently help to resolve this symptom?
>
> See
> http://gstreamer-devel.966125.n4.nabble.com/attachment/3207515/0/default-buffer-size.patch


This does indeed fix it. Patching the latest release with that patch,
and upgrading to it I don't see the error anymore, downgrading and its
back. So is there a bug someplace I can voice my experience thus far?

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel