Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#439 closed defect (worksforme)

Resampling option causes eof problems.

Reported by: dev.null@… Owned by: alex@…
Priority: important Component: af
Version: HEAD Severity: major
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:


This started as my odyssey to convert a batch of ra files to mp3 (success now,
thank to sipro reordering code by Roberto bug 435). Along the way I tested
various mplayer configurations to create a wav file as a basis for compression
by lame.

I found that adding af options would generate a file padded with a lot of noise
because the encoding would continue at eof with "MPlayer interrupted by signal 1
in module: uninit_getch2 - MPlayer crashed. This shouldn't happen."

See below the results of my testing:

Roberto did some reordering magic and got MPlayer playing old (sipro) ra files
playing in MPlayer -- thanks.

But now I have discovered what I believe to be a bug in the af code (or maybe in
the interaction between Roberto's fix and the af code).

The interesting thing is that this creates a 497M wave file that is listenable
but of which, it appears only the first half contains the whole of the signal.
What follows is silence punctuated by regular ticks.

I wanted MP3 files and so thought to first create wav file at 44.1K. So, I
tried the following command:

$ mplayer -v test.ra -af resample=44100:0:1 -ao pcm:waveheader,file=test.wav -vc
dummy -vo null

MPlayer dev-CVS-060115-18:46-4.0.2 (C) 2000-2006 MPlayer Team
CPU: Intel Celeron 2/Pentium III Coppermine,Geyserville (Family: 6, Stepping: 6)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 SSE

get_path('codecs.conf') -> '/home/randy/.mplayer/codecs.conf'
Reading /home/randy/.mplayer/codecs.conf: 90 audio & 204 video codecs
CommandLine?: '-v' 'test.ra' '-af' 'resample=44100:0:1' '-ao'
'pcm:waveheader,file=test.wav' '-vc' 'dummy' '-vo' 'null'
get_path('font/font.desc') -> '/home/randy/.mplayer/font/font.desc'
Font /home/randy/.mplayer/font/font.desc loaded successfully! (206 chars)
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay?
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system startup
Using nanosleep() timing
get_path('input.conf') -> '/home/randy/.mplayer/input.conf'
Can't open input config file /home/randy/.mplayer/input.conf: No such file or
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or
Falling back on default (hardcoded) input config
get_path('test.ra.conf') -> '/home/randy/.mplayer/test.ra.conf'
Playing test.ra.
get_path('sub/') -> '/home/randy/.mplayer/sub/'
[file] File size is 2438884 bytes
STREAM: [file] test.ra
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
Checking for YUV4MPEG2
ASF_check: not ASF guid!
Checking for NuppelVideo?
Checking for REAL
Checking for SMJPEG
REALAUDIO file format detected.
==> Found audio stream: 0
[RealAudio?] File version: 4
[RealAudio?] Flavor: 0
[RealAudio?] Coded frame size: 232
[RealAudio?] Sub packet h: 6
[RealAudio?] Frame size: 232
[RealAudio?] Sub packet size: 0
[RealAudio?] 1 channel, 16 bit, 8000Hz
Audio: SIPR
======= WAVE Format =======
Format Tag: 26995 (0x6973)
Channels: 1
Samplerate: 8000
avg byte/sec: 813
Block align: 232
bits/sample: 16
cbSize: 0
Opening audio decoder: [realaud] RealAudio? decoder
opening shared obj '/usr/local/RealPlayer/codecs/'
Got sipr flavor 0 from bitrate 813
dec_audio: Allocating 232 bytes for input buffer.
dec_audio: Allocating 128000 + 65536 = 193536 bytes for output buffer.
AUDIO: 8000 Hz, 1 ch, s16le, 6.5 kbit/5.08% (ratio: 813->16000)
Selected audio codec: [rasipr] afm: realaud (RealAudio? Sipro)
Building audio filter chain for 8000Hz/1ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter resample
[resample] Changing sample rate to 44100Hz
[resample] Using integer processing and exact frequecy conversion.
[resample] New filter designed up: 441 down: 80
[resample] Using integer processing and exact frequecy conversion.
[AO PCM] File: audiodump.wav (WAVE)
PCM: Samplerate: 44100Hz Channels: Mono Format s16le
[AO PCM] Info: Faster dumping is achieved with -vc null -vo null
[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
AO: [pcm] 44100Hz 1ch s16le (2 bytes per sample)
AO: Description: RAW PCM/WAVE file writer audio output
AO: Author: Atmosfear
Building audio filter chain for 8000Hz/1ch/s16le -> 44100Hz/1ch/s16le...
[resample] Using integer processing and exact frequecy conversion.
[resample] Using integer processing and exact frequecy conversion.
Video: no video
Freeing 0 unused video chunks.
Starting playback...
[libaf] Reallocating memory in module resample, old len = 0, new len = 65544
ds_fill_buffer: EOF reached (stream: audio)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< line repeated over 10,000 times!
ds_fill_buffer: EOF reached (stream: audio)
EOF code: 1

Uninit audio filters...
[libaf] Removing filter resample
uninit audio:

It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it's MPlayer's fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
won't help unless you provide this information when reporting a possible bug.

vo: x11 uninit called but X11 not inited..

My testbed:
Ubuntu 2.6.12-10-386 #1 Thu Dec 22 11:37:10 UTC 2005 i686 GNU/Linux updated and

# ls -l /lib/libc[.-]* -rw-r--r-- 1 root root 1131932 2005-10-09 17:03
/lib/ lrwxrwxrwx 1 root root 13 2005-11-01 23:33
/lib/ ->

# gcc -v && ld -v Using built-in specs. Target: i486-linux-gnu Configured with:
../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang
--prefix=/usr --with-gxx-include-dir=/usr/include/c++/4.0.2 --enable-shared
--with-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext
--enable-threads=posix --program-suffix=-4.0 --enable-cxa_atexit
--enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug
--enable-java-gc=boehm --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0- --enable-mpfr
--disable-werror --enable-checking=release i486-linux-gnu Thread model: posix
gcc version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9) GNU ld version
2.16.1 Debian GNU/Linux

# as --version GNU assembler 2.16.1 Debian GNU/Linux

# cat /proc/cpuinfo

processor : 0
vendor_id : GenuineIntel?
cpu family : 6
model : 8
model name : Pentium III (Coppermine)
stepping : 6
cpu MHz : 930.397
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 mmx fxsr sse
bogomips : 1847.29

# lspci -vv|grep audio

0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801BA/BAM AC'97 Audio
(rev 02)

p.s. Here is my final recoding script

for i in $(find -iname *_*.ra); do

filename=basename "$i" .ra
#Rip with Mplayer / encode with LAME
echo "Ripping $i"
mplayer -quiet -vo null -vc dummy -ao pcm:file=audiodump.wav "$i"
echo "Encoding $i to "$filename".mp3"
lame -S -m m --preset fast standard --noshort -b 8 audiodump.wav -o


ls -lah "$filename".*

rm audiodump.wav


Change History (2)

comment:1 Changed 15 years ago by dev.null@…

  • Severity changed from normal to major

comment:2 Changed 14 years ago by reimar

  • Resolution set to worksforme
  • Status changed from new to closed

Works for me with SVN r20347 and the rjltest.ra sample from bug #435.

Note: See TracTickets for help on using tickets.