Receive with Streamutil.c

SB
St Burcher
Wed, Jun 30, 2010 1:27 PM

Hi,

I'm the next newbie, who is using PJSip for a project.
To start learning, I use the streamutil.c, because the first part of the project is to stream files over RTP and the second is to implement a small sip application. However, I have a small problem with the streamutil.c.
If the program starts to receive a stream, it displays this error.

Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1873
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1994
15:19:19.904      stream.c  Unable to create sound port: Invalid sample rate [code=469996]

If the program gets the parameter --record-file=test.wav, it works.
I have written a program which plays only a file without a stream. This works fine with the same wave file.

Thanks for help.

All regard
Steven


http://redirect.gimas.net/?n=M1006xHMTL4
Künftig E-Mails über Hotmail ohne Werbung versenden!

Hi, I'm the next newbie, who is using PJSip for a project. To start learning, I use the streamutil.c, because the first part of the project is to stream files over RTP and the second is to implement a small sip application. However, I have a small problem with the streamutil.c. If the program starts to receive a stream, it displays this error. Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294 Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1873 Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1994 15:19:19.904 stream.c Unable to create sound port: Invalid sample rate [code=469996] If the program gets the parameter --record-file=test.wav, it works. I have written a program which plays only a file without a stream. This works fine with the same wave file. Thanks for help. All regard Steven _________________________________________________________________ http://redirect.gimas.net/?n=M1006xHMTL4 Künftig E-Mails über Hotmail ohne Werbung versenden!
TF
Thomas Falk
Wed, Jun 30, 2010 3:00 PM

Hi,

this message says, that it can't set the sample rate requested:

2010/6/30 St Burcher stburcher@hotmail.com:

...
Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in
'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294

All the other messages or following from tihs because the alsa device
is not ready. The sample rate requested by streamutil depends on the
codec it has been given on the command line. There are also some alsa
configuration which don't support all sample rates.

It works with --record-file because in this case the alsa device
doesn't get openend. You should check what rate is requested and that
your alsa device is configured for resampling if it doesn't support
this rate in the hardware.

Best regards,

Thomas

Hi, this message says, that it can't set the sample rate requested: 2010/6/30 St Burcher <stburcher@hotmail.com>: > ... > Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in > 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294 All the other messages or following from tihs because the alsa device is not ready. The sample rate requested by streamutil depends on the codec it has been given on the command line. There are also some alsa configuration which don't support all sample rates. It works with --record-file because in this case the alsa device doesn't get openend. You should check what rate is requested and that your alsa device is configured for resampling if it doesn't support this rate in the hardware. Best regards, Thomas
SB
St Burcher
Thu, Jul 1, 2010 7:44 AM

Hi,

thanks for the fast answer.

both (sender and receiver) uses PCMU the file is also PCMU with 8000Hz and 16Bit.
There exist another sample programm called playfile.c, which play wav files. This has the same problem on my maschine. But, it works fine with 48000Hz and 16Bit L16.

So, I tried to use --codec=PCMA --recv-only or codec=L16 --recv-only in the streamutil.c.

Then the computer bring this error message.

PJSipRTP: ../src/pjmedia/codec.c:307: pjmedia_codec_mgr_find_codecs_by_id: Assertion `mgr && codec_id && count && *count' failed.

If I uses an self program ALSA application it works with PCMU and 8000hz.

best regards
Steven

From: thfalk@gmail.com
Date: Wed, 30 Jun 2010 17:00:58 +0200
To: pjsip@lists.pjsip.org
Subject: Re: [pjsip] Receive with Streamutil.c

Hi,

this message says, that it can't set the sample rate requested:

2010/6/30 St Burcher stburcher@hotmail.com:

...
Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in
'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294

All the other messages or following from tihs because the alsa device
is not ready. The sample rate requested by streamutil depends on the
codec it has been given on the command line. There are also some alsa
configuration which don't support all sample rates.

It works with --record-file because in this case the alsa device
doesn't get openend. You should check what rate is requested and that
your alsa device is configured for resampling if it doesn't support
this rate in the hardware.

Best regards,

Thomas


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


http://redirect.gimas.net/?n=M1007xIMFreunde4
Echte Freunde sagen's per Messenger!

Hi, thanks for the fast answer. both (sender and receiver) uses PCMU the file is also PCMU with 8000Hz and 16Bit. There exist another sample programm called playfile.c, which play wav files. This has the same problem on my maschine. But, it works fine with 48000Hz and 16Bit L16. So, I tried to use --codec=PCMA --recv-only or codec=L16 --recv-only in the streamutil.c. Then the computer bring this error message. PJSipRTP: ../src/pjmedia/codec.c:307: pjmedia_codec_mgr_find_codecs_by_id: Assertion `mgr && codec_id && count && *count' failed. If I uses an self program ALSA application it works with PCMU and 8000hz. best regards Steven > From: thfalk@gmail.com > Date: Wed, 30 Jun 2010 17:00:58 +0200 > To: pjsip@lists.pjsip.org > Subject: Re: [pjsip] Receive with Streamutil.c > > Hi, > > this message says, that it can't set the sample rate requested: > > 2010/6/30 St Burcher <stburcher@hotmail.com>: > > ... > > Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in > > 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294 > > All the other messages or following from tihs because the alsa device > is not ready. The sample rate requested by streamutil depends on the > codec it has been given on the command line. There are also some alsa > configuration which don't support all sample rates. > > It works with --record-file because in this case the alsa device > doesn't get openend. You should check what rate is requested and that > your alsa device is configured for resampling if it doesn't support > this rate in the hardware. > > Best regards, > > Thomas > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _________________________________________________________________ http://redirect.gimas.net/?n=M1007xIMFreunde4 Echte Freunde sagen's per Messenger!
SB
St Burcher
Thu, Jul 1, 2010 12:01 PM

Hi again,

both (sender and receiver) uses PCMU the file is also PCMU with 8000Hz and 16Bit.
There exist another sample programm called playfile.c, which play wav files. This has the same problem on my maschine. But, it works fine with 48000Hz >and 16Bit L16.

So, I tried to use --codec=PCMA --recv-only or codec=L16 --recv-only in the streamutil.c.

I have a small update. If I use this parameter
/* Create sound device port. */
status = pjmedia_snd_port_create_player(pool,
-1,
// stream_port->info.clock_rate,
48000,
stream_port->info.channel_count,
stream_port->info.samples_per_frame,
stream_port->info.bits_per_sample,
0,
&snd_port);
And only with 48000 Hz.

best regards
Steven

From: thfalk@gmail.com
Date: Wed, 30 Jun 2010 17:00:58 +0200
To: pjsip@lists.pjsip.org
Subject: Re: [pjsip] Receive with Streamutil.c

Hi,

this message says, that it can't set the sample rate requested:

2010/6/30 St Burcher stburcher@hotmail.com:

...
Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in
'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294

All the other messages or following from tihs because the alsa device
is not ready. The sample rate requested by streamutil depends on the
codec it has been given on the command line. There are also some alsa
configuration which don't support all sample rates.

It works with --record-file because in this case the alsa device
doesn't get openend. You should check what rate is requested and that
your alsa device is configured for resampling if it doesn't support
this rate in the hardware.

Best regards,

Thomas


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Echte Freunde sagen's  per Messenger!


http://redirect.gimas.net/?n=M1007xIMFreunde4
Echte Freunde sagen's per Messenger!

Hi again, > >both (sender and receiver) uses PCMU the file is also PCMU with 8000Hz and 16Bit. >There exist another sample programm called playfile.c, which play wav files. This has the same problem on my maschine. But, it works fine with 48000Hz >and 16Bit L16. > >So, I tried to use --codec=PCMA --recv-only or codec=L16 --recv-only in the streamutil.c. I have a small update. If I use this parameter /* Create sound device port. */ status = pjmedia_snd_port_create_player(pool, -1, // stream_port->info.clock_rate, 48000, stream_port->info.channel_count, stream_port->info.samples_per_frame, stream_port->info.bits_per_sample, 0, &snd_port); And only with 48000 Hz. best regards Steven > From: thfalk@gmail.com > Date: Wed, 30 Jun 2010 17:00:58 +0200 > To: pjsip@lists.pjsip.org > Subject: Re: [pjsip] Receive with Streamutil.c > > Hi, > > this message says, that it can't set the sample rate requested: > > 2010/6/30 St Burcher <stburcher@hotmail.com>: > > ... > > Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in > > 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294 > > All the other messages or following from tihs because the alsa device > is not ready. The sample rate requested by streamutil depends on the > codec it has been given on the command line. There are also some alsa > configuration which don't support all sample rates. > > It works with --record-file because in this case the alsa device > doesn't get openend. You should check what rate is requested and that > your alsa device is configured for resampling if it doesn't support > this rate in the hardware. > > Best regards, > > Thomas > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org Echte Freunde sagen's per Messenger! _________________________________________________________________ http://redirect.gimas.net/?n=M1007xIMFreunde4 Echte Freunde sagen's per Messenger!