[jitsi-dev] Portaudio again


#1

Dear all,

a few day ago I reported that I receive error message from portaudio. This
problem got worse . I use the latest SVN version (about 1 day old) and I
receive a large number of the followinh messages:

     [java] Expression 'PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4466
     [java] 16:24:41.848 SCHWERWIEGEND: impl.neomedia.jmfext.media.renderer.audio.PortAudioRenderer.process().495 Failed to process Buffer.
     [java] net.java.sip.communicator.impl.neomedia.portaudio.PortAudioException: Internal PortAudio error
     [java] at net.java.sip.communicator.impl.neomedia.portaudio.PortAudio.Pa_WriteStream(Native Method)
     [java] at net.java.sip.communicator.impl.neomedia.jmfext.media.renderer.audio.PortAudioRenderer.process(PortAudioRenderer.java:557)
     [java] at net.java.sip.communicator.impl.neomedia.jmfext.media.renderer.audio.PortAudioRenderer.process(PortAudioRenderer.java:488)
     [java] at net.sf.fmj.media.BasicRendererModule.processBuffer(Unknown Source)
     [java] at net.sf.fmj.media.BasicRendererModule.scheduleBuffer(Unknown Source)
     [java] at net.sf.fmj.media.BasicRendererModule.doProcess(Unknown Source)
     [java] at net.sf.fmj.media.RenderThread.process(Unknown Source)
     [java] at net.sf.fmj.media.util.LoopThread.run(Unknown Source)

The message show up in a rapid succession and the audio is bearly recognizable.

I don't have the sources of portaudio that were used to build the portaudio lib. Which versions
do you use? Somewhere in the SVN tree?

I use the following Java version to run Jitsi:

java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)

On my openSuse 12.1 I use Alsa (no Pulseaudio) and the sound chips is
a Intel HDA 888 with the latest Alsa drivers. All other sound application
work just fine.

Any ideas?

Best regards,
Werner


#2

Hi Werner,

the current binary is using hotplug branch and our hotplug patch.
https://subversion.assembla.com/svn/portaudio/portaudio/branches/hotplug/
I've just committed the patched sources in libsrc.

Regards
damencho

···

On Wed, Mar 28, 2012 at 5:33 PM, Werner Dittmann <Werner.Dittmann@t-online.de> wrote:

Dear all,

a few day ago I reported that I receive error message from portaudio. This
problem got worse . I use the latest SVN version (about 1 day old) and I
receive a large number of the followinh messages:

\[java\] Expression &#39;PaAlsaStream\_WaitForFrames\( stream, &amp;framesAvail, &amp;xrun \)&#39; failed in &#39;src/hostapi/alsa/pa\_linux\_alsa\.c&#39;, line: 4466
\[java\] 16:24:41\.848 SCHWERWIEGEND: impl\.neomedia\.jmfext\.media\.renderer\.audio\.PortAudioRenderer\.process\(\)\.495 Failed to process Buffer\.
\[java\] net\.java\.sip\.communicator\.impl\.neomedia\.portaudio\.PortAudioException: Internal PortAudio error
\[java\]     at net\.java\.sip\.communicator\.impl\.neomedia\.portaudio\.PortAudio\.Pa\_WriteStream\(Native Method\)
\[java\]     at net\.java\.sip\.communicator\.impl\.neomedia\.jmfext\.media\.renderer\.audio\.PortAudioRenderer\.process\(PortAudioRenderer\.java:557\)
\[java\]     at net\.java\.sip\.communicator\.impl\.neomedia\.jmfext\.media\.renderer\.audio\.PortAudioRenderer\.process\(PortAudioRenderer\.java:488\)
\[java\]     at net\.sf\.fmj\.media\.BasicRendererModule\.processBuffer\(Unknown Source\)
\[java\]     at net\.sf\.fmj\.media\.BasicRendererModule\.scheduleBuffer\(Unknown Source\)
\[java\]     at net\.sf\.fmj\.media\.BasicRendererModule\.doProcess\(Unknown Source\)
\[java\]     at net\.sf\.fmj\.media\.RenderThread\.process\(Unknown Source\)
\[java\]     at net\.sf\.fmj\.media\.util\.LoopThread\.run\(Unknown Source\)

The message show up in a rapid succession and the audio is bearly recognizable.

I don't have the sources of portaudio that were used to build the portaudio lib. Which versions
do you use? Somewhere in the SVN tree?

I use the following Java version to run Jitsi:

java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)

On my openSuse 12.1 I use Alsa (no Pulseaudio) and the sound chips is
a Intel HDA 888 with the latest Alsa drivers. All other sound application
work just fine.

Any ideas?

Best regards,
Werner


#3

Hi Werner,

the current binary is using hotplug branch and our hotplug patch.
https://subversion.assembla.com/svn/portaudio/portaudio/branches/hotplug/
I've just committed the patched sources in libsrc.

Thanks, I'll take a look and check what happens there :slight_smile: .

Best regards,
Werner

···

Am 29.03.2012 09:39, schrieb Damian Minkov:

Regards
damencho

On Wed, Mar 28, 2012 at 5:33 PM, Werner Dittmann > <Werner.Dittmann@t-online.de> wrote:

Dear all,


#4

Damian, Emil,

as reported in some previous e-mails I had quite some problems with
portaudio and thus audio quality (sometimes really bad audio).

Several facts lead to that bad quality:
- sometimes bad network (or delays at iptel.org Music service) that lead
  to RTP bursts. During the bursts the audio (Jitter) buffers got empty

- a small, but important error in the pa_linux_alsa.c: an underrun was
  reported back to the application (Java) as an "Internal Error". That lead
  to Java exception handling, which delayed the audio feed even more.

I fixed the problem in pa_linux_alsa.c (this problem was fixed in the current
portaudio SVN repo and I just copied it back to Jitsi's portaudio source).

After reading some more Alsa stuff I modified the runtime behaviour a little
bit: I reduced the "start threshold" to 1, was previously "frames per buffer"
(882 frames at 44.1 kHz). This modification causes Alsa (or Pulseaudio) to
start automatically as soon as it has some data availabe. Thus I removed the
"manual start".

The result of all modifications are that, at least on my system, Alsa (now with
Puleaudio) runs smoother and has very few underruns. Also underruns are not
treated as "Internal Error" anymore and do not cause a lot of recovery handling.

Attached the modified source and a diff to the current pa_linux_alsa.c . Maybe
it helps.

Best regards,
Werner

diff_jitsi_pa.diff (3.84 KB)

pa_linux_alsa.c (169 KB)

···

Am 29.03.2012 09:39, schrieb Damian Minkov:

Hi Werner,

the current binary is using hotplug branch and our hotplug patch.
https://subversion.assembla.com/svn/portaudio/portaudio/branches/hotplug/
I've just committed the patched sources in libsrc.

Regards
damencho

On Wed, Mar 28, 2012 at 5:33 PM, Werner Dittmann > <Werner.Dittmann@t-online.de> wrote:

Dear all,

a few day ago I reported that I receive error message from portaudio. This
problem got worse . I use the latest SVN version (about 1 day old) and I
receive a large number of the followinh messages:

    [java] Expression 'PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4466
    [java] 16:24:41.848 SCHWERWIEGEND: impl.neomedia.jmfext.media.renderer.audio.PortAudioRenderer.process().495 Failed to process Buffer.
    [java] net.java.sip.communicator.impl.neomedia.portaudio.PortAudioException: Internal PortAudio error
    [java] at net.java.sip.communicator.impl.neomedia.portaudio.PortAudio.Pa_WriteStream(Native Method)
    [java] at net.java.sip.communicator.impl.neomedia.jmfext.media.renderer.audio.PortAudioRenderer.process(PortAudioRenderer.java:557)
    [java] at net.java.sip.communicator.impl.neomedia.jmfext.media.renderer.audio.PortAudioRenderer.process(PortAudioRenderer.java:488)
    [java] at net.sf.fmj.media.BasicRendererModule.processBuffer(Unknown Source)
    [java] at net.sf.fmj.media.BasicRendererModule.scheduleBuffer(Unknown Source)
    [java] at net.sf.fmj.media.BasicRendererModule.doProcess(Unknown Source)
    [java] at net.sf.fmj.media.RenderThread.process(Unknown Source)
    [java] at net.sf.fmj.media.util.LoopThread.run(Unknown Source)

The message show up in a rapid succession and the audio is bearly recognizable.

I don't have the sources of portaudio that were used to build the portaudio lib. Which versions
do you use? Somewhere in the SVN tree?

I use the following Java version to run Jitsi:

java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)

On my openSuse 12.1 I use Alsa (no Pulseaudio) and the sound chips is
a Intel HDA 888 with the latest Alsa drivers. All other sound application
work just fine.

Any ideas?

Best regards,
Werner