[MPlayer-dev-eng] playing little endian format uncompressed PCM audio stream via RTSP

Ratin ratin3 at gmail.com
Thu Mar 20 18:44:47 CET 2008


From: Ratin <ratin3 at gmail.com>
To: mplayer-dev-eng at mplayerhq.hu
Date: Wed, 19 Mar 2008 17:02:58 -0700
Subject: [MPlayer-dev-eng] playing little endian format uncompressed PCM
audio stream via RTSP
When you stream audio over live555's component on mplayer, what decides the
audio data to be big endian vs little endian? I am specifying the format as
97 (dynamic format) with rtpmap being : 96 L16/8000 for single channel, 16
bit/sample, 8 khz sample rate audio. But mplayer somehow thinks audio data
is in  big endian format and attaches a BE -> LE conversion filter:

after getting "describe":

Initiated "audio/L16" RTP subsession on port 4770
....
...

after getting "play" command:

Building audio filter chain for 8000Hz/1ch/s16be -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 8000Hz/1ch/s16be
[dummy] Was reinitialized: 8000Hz/1ch/s16be
ao_dsound: Output Devices:
0 Primary Sound Driver <--
1 SoundMAX Digital Audio
2 Bluetooth Audio
ao_dsound: DirectSound initialized
ao_dsound: format s16be not supported defaulting to Signed 16-bit
Little-Endian
ao_dsound: Samplerate:8000Hz Channels:1 Format:s16le
ao_dsound: Buffersize:16000 bytes (1000 msec)
ao_dsound: primary buffer created
ao_dsound: secondary (stream)buffer created
AO: [dsound] 8000Hz 1ch s16le (2 bytes per sample)
AO: Description: Windows DirectSound audio output
AO: Author: Gabor Szecsi <deje at miki.hu>
Building audio filter chain for 8000Hz/1ch/s16be -> 8000Hz/1ch/s16le...
[dummy] Was reinitialized: 8000Hz/1ch/s16be
[libaf] Adding filter format
[format] Changing sample format from big-endian 16-bit signed int to
little-endian 16-bit signed int
[format] Accelerated endianness conversion only
[dummy] Was reinitialized: 8000Hz/1ch/s16be
[format] Changing sample format from big-endian 16-bit signed int to
little-endian 16-bit signed int
[format] Accelerated endianness conversion only
Video: no video
Freeing 0 unused video chunks.
Starting playback...
[libaf] Reallocating memory in module format, old len = 0, new len = 16000
No bind found for key ''.
A:  -1.0 (unknown) of 0.0 (unknown)  0.0%

I hear nothing but noise. The data is in little endian format.



---------- Forwarded message ----------
From: Compn <tempn at twmi.rr.com>
To: mplayer-dev-eng at mplayerhq.hu
Date: Wed, 19 Mar 2008 23:43:25 -0500
Subject: Re: [MPlayer-dev-eng] playing little endian format uncompressed PCM
audio stream via RTSP
On Wed, 19 Mar 2008 17:02:58 -0700, Ratin wrote:

>When you stream audio over live555's component on mplayer, what
>decides the audio data to be big endian vs little endian? I am
>specifying the format as 97 (dynamic format) with rtpmap being : 96
>L16/8000 for single channel, 16 bit/sample, 8 khz sample rate audio.
>But mplayer somehow thinks audio data is in  big endian format and
>attaches a BE -> LE conversion filter:
>I hear nothing but noise. The data is in little endian format.

a sample url might provide the devs with something they can work with
and fix...

also try with openrtsp or playrtsp from live555 project (if you can
find win32 binaries). to see if its a live555 or mplayer problem.

-compn

Thanks for your reply!

I think I tracked down where the problem might be. In ad_pcm.c, function
static int init(sh_audio_t *sh_audio):
it checks sh_audio->format  to  match a data format, in order for data to be
16 bit, little endian it has to be one of these formats:

'sowt' (0x74776F73)
0x0, 0x1, 0xfffe

However in demux_rtp_codec.cpp, function void
rtpCodecInitialize_audio(demuxer_t* demuxer, MediaSubsession* subsession,
unsigned& flags),

where codecName is checked and a format is assigned, no where I see any of
these formats are being assigned based on all the codec names supported. And
"L16" is assigned 'tows' causing it to be big endian format later on.

Since the data is already in little indian format, we need to add another
case here that interprets the data without adding any extra load on the CPU
to convert.

Ratin



More information about the MPlayer-dev-eng mailing list