[MEncoder-users] Sound recording problem with SAA7134 TV card and alsa

Martin Collins martin at mkcollins.org
Wed Apr 26 18:01:53 CEST 2006


I am getting strange and unwelcome behaviour when recording from my
VCR via the composite input and associated audio sockets on my new
MSI TV at nywhere saa7134 TV card.

I am using the saa7134-alsa module, not my soundcard.

The card has three audio sources:
Video,0	- tuner
Line,1	- ?
Line,2	- composite fly-leads

Regardless how my mixer is set mencoder always (initially) records
sound from the tuner source, not the audio sockets.
Once recording has begun if I toggle the correct source in the mixer
then the correct sound is recorded.
Most bizarrely, if I start recording (tuner sound), toggle the source
(composite sound), then press play on the VCR; mencoder reverts to
recording the tuner sound. I have to toggle the source again.

It looks like audioid should select the source but when I use it I
get no sound at all until I press play or toggle.

I am using Debian 2.6.15 and mencoder cvs from today.

mencoder -v tv://$1 \
-tv driver=v4l2:device=/dev/video0:input=1:alsa:width=720:height=576:\
chanlist=europe-west:channels=26-BBC1,33-BBC2,23-ITV,30-CHN4,37-CHN5,40-VCR:\
adevice=hw.1:audiorate=32000:amode=1:forceaudio:immediatemode=0:norm=PAL \
-endpos $DURATION \
-ovc lavc -lavcopts vcodec=mjpeg:aspect=768/576 \
-oac pcm \
-mc 0 -noskip \
-vf harddup \
-fps 25 \
-o $3.avi

MEncoder dev-CVS-060426-15:17-4.0.3 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Duron/Athlon 4/MP/XP Palomino (Family: 6, Stepping: 2)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

91 audio & 204 video codecs
init_freetype
get_path('font/font.desc') -> '/home/martin/.mplayer/font/font.desc'
Font /home/martin/.mplayer/font/font.desc loaded successfully! (206 chars)
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
STREAM: [null] tv://4
STREAM: Description: Null stream
STREAM: Author: Albeu
STREAM: Comment:
success: format: 9  data: 0x0 - 0x0
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski at zpr.uni-koeln.de>
 comment: first try, more to come ;-)
Selected device: MSI TV at Anywhere plus
 Tuner cap: STEREO LANG1 LANG2
 Tuner rxs: MONO
 Capabilites:  video capture  video overlay  VBI capture device  tuner  read/write  streaming
 supported norms: 0 = PAL; 1 = PAL-BG; 2 = PAL-I; 3 = PAL-DK; 4 = NTSC; 5 = SECAM; 6 = PAL-M; 7 = PAL-Nc; 8 = PAL-60;
 inputs: 0 = Television; 1 = Composite1; 2 = S-Video;
 Current input: 1
 Format GREY   ( 8 bits, 8 bpp gray): Planar Y800
 Format RGB555 (16 bits, 15 bpp RGB, le): BGR 15-bit
 Format RGB555X (16 bits, 15 bpp RGB, be): Unknown
 Format RGB565 (16 bits, 16 bpp RGB, le): BGR 16-bit
 Format RGB565X (16 bits, 16 bpp RGB, be): Unknown
 Format BGR24  (24 bits, 24 bpp RGB, le): BGR 24-bit
 Format RGB24  (24 bits, 24 bpp RGB, be): RGB 24-bit
 Format BGR32  (32 bits, 32 bpp RGB, le): BGRA
 Format RGB32  (32 bits, 32 bpp RGB, be): RGBA
 Format YUYV   (16 bits, 4:2:2 packed, YUYV): Packed YUY2
 Format UYVY   (16 bits, 4:2:2 packed, UYVY): Packed UYVY
 Format YUV422P (16 bits, 4:2:2 planar, Y-Cb-Cr): Planar 422P
 Format YUV420 (12 bits, 4:2:0 planar, Y-Cb-Cr): Planar I420
 Format YVU420 (12 bits, 4:2:0 planar, Y-Cb-Cr): Planar YV12
 Current format: BGR24
v4l2: setting audio mode
v4l2: current audio mode is : STEREO
v4l2: set Volume: 15 [-15, 15]
v4l2: set format: YVU420
v4l2: set input: 1
Selected norm: PAL
v4l2: set norm: PAL
v4l2: set width: 720
v4l2: set height: 576
Selected channel list: europe-west (including 104 channels)
TV channel names detected.
Selected channel: 30 - CHN4 (freq: 543.250)
Current frequency: 8692 (543.250)
Current frequency: 8692 (543.250)
==> Found video stream: 0
v4l2: get format: YVU420
v4l2: get fps: 25.000000
v4l2: get width: 720
v4l2: get height: 576
Hardware PCM card 1 'SAA7134' device 0 subdevice 0

Its setup is:
stream       : CAPTURE
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 48000
exact rate   : 48000 (48000/1)
msbits       : 16
buffer_size  : 48000
period_size  : 12000
period_time  : 250000
tick_time    : 4000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 12000
xfer_align   : 12000
start_threshold  : 0
stop_threshold   : 48000
silence_threshold: 0
silence_size : 0
boundary     : 1572864000
v4l2: set audio samplerate: 32000
Hardware PCM card 1 'SAA7134' device 0 subdevice 0

Its setup is:
stream       : CAPTURE
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 32000
exact rate   : 32000 (32000/1)
msbits       : 16
buffer_size  : 32000
period_size  : 8000
period_time  : 250000
tick_time    : 4000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 8000
xfer_align   : 8000
start_threshold  : 0
stop_threshold   : 32000
silence_threshold: 0
silence_size : 0
boundary     : 2097152000
v4l2: get audio format: 9
==> Found audio stream: 0
v4l2: get audio samplerate: 32000
v4l2: get audio samplesize: 2
v4l2: get audio channels: 2
  TV audio: 2 channels, 16 bits, 32000 Hz
Audio capture - buffer 256 blocks of 32000 bytes, skew average from 16 meas.
Using a ring buffer for maximum 424 frames, 251 MB total size.
v4l2: set Brightness: 128 [0, 255]
v4l2: set Hue: 0 [-128, 127]
v4l2: set Saturation: 64 [0, 127]
v4l2: set Contrast: 68 [0, 127]
[V] filefmt:9  fourcc:0x32315659  size:720x576  fps:25.00  ftime:=0.0400
input fps will be interpreted as 25.00 instead
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer.
AUDIO: 32000 Hz, 2 ch, s16le, 1024.0 kbit/100.00% (ratio: 128000->128000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
Trying filter chain: harddup expand lavc
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (720x576->720x576,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
REQ: flags=0x401  req=0x0
videocodec: libavcodec (720x576 fourcc=47504a4d [MJPG])
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================
Building audio filter chain for 32000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 32000Hz/2ch/s16le
[dummy] Was reinitialized: 32000Hz/2ch/s16le
Building audio filter chain for 32000Hz/2ch/s16le -> 32000Hz/2ch/s16le...
[dummy] Was reinitialized: 32000Hz/2ch/s16le
[dummy] Was reinitialized: 32000Hz/2ch/s16le
Forcing audio preload to 0, max pts correction to 0
v4l2: going to capture
*** [harddup] Exporting mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
*** [expand] Exporting mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
*** [lavc] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
Muxer frame buffer sending 2 frame(s) to muxer. 0mb  A-V:0.000 [0:0] A/Vms 0/12 D/B/S 0/0/0
Writing header...
ODML: vprp aspect is 4:3.
Writing header...
ODML: vprp aspect is 4:3.
Pos:  20.0s    501f ( 0%)  24fps Trem:   0min   0mb  A-V:0.000 [10239:1024] A/Vms 258/15 D/B/S 0/0/0
Flushing video frames
Writing index...
Writing header...
ODML: vprp aspect is 4:3.

Video stream: 10239.492 kbit/s  (1279936 B/s)  size: 25649928 bytes  20.040 secs  501 frames

Audio stream: 1024.000 kbit/s  (128000 B/s)  size: 2560000 bytes  20.000 secs
Uninit audio filters...
[libaf] Removing filter dummy
uninit audio: pcm
uninit video: raw
v4l2: 512 frames successfully processed, 0 frames dropped.
v4l2: up to 18 video frames buffered.


Is this a bug in mencoder, saa7134-alsa or my command line?

Martin




More information about the MEncoder-users mailing list