tvtime sound OK, but can't record in mencoder! Help!
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
And the "hissing" noise that is recorded stops/starts respectively. If I use the same commands while watching TV with tvtime it will stop/start the proper TV sound.
It is not mencoder problem. It is actually your settings. Type 'alsamixer -v All' to get access to all mixer settings. You need to make sure Capture is on. Then test it with arecord by recording audio. Specify the verbose command two times to show the VU meter. If you can record audio, then you can use mencoder or anything.
In mencoder include forceaudio and adevice in the -t option if it tells you that there is no audio. I am using a video capture card based on Philips SAA713x chips and I have to force mencoder to record audio.
Getting audio recording to work is trial and error. Just keep on adjusting mixer settings until the VU meter changes to a value higher than 0%.
Instead of recording to a file. Pipe it to hexdump. To do this, type 'arecord | hexdump'. You do not need to be a geek to understand the read out. You just need to notice a change in geek langauge which desingates a signal.
Jiggling with mixer settings while running arecord | hexdump allowed me to record audio (finally!) while watching tv with tvtime. I had to enable the "Capture" button which got switched off by freevo.
However, when mencoder "accesses" the tv the resulting sound is a "hiss".
So it seems this is a problem when mencoder accesses the tv card? That the sound isn't coming out as it does when tvtime access the tv card?
a) I can record audio when tvtime is playing
b) I can't record audio when mencoder is accessing /dev/video0
I've been trying to fix this for some time now, and am getting a little frustrated.
I have a Leadtek Winfast 2000XP Expert card using the cx88 driver under Ubuntu Dapper.
I have the Deluxe version of this card and your post got me trying to get the recording working again, I could already get the video like you just no sound. I had the line in capture set and could never get any sound at all it turned out that the setting needed to get it working was to set was is called the "Analog Mix" to record in Kmix and raise the capture volume up. I see you have a just simple Mix capture that is set to off perhaps if you try playing around with it or one of the others set to off here it might work.
Code:
amadeus@home-tv:~$ amixer
Simple mixer control 'Line',0
Capabilities: pvolume pswitch cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 31
Front Left: Playback 31 [100%] [on] Capture [off]
Front Right: Playback 31 [100%] [on] Capture [off]
Simple mixer control 'Line Jack Sense',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'CD',0
Capabilities: pvolume pswitch cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 31
Front Left: Playback 25 [81%] [on] Capture [on]
Front Right: Playback 25 [81%] [on] Capture [on]
Simple mixer control 'Video',0
Capabilities: cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Capture channels: Front Left - Front Right
Front Left: Capture [off]
Front Right: Capture [off]
Simple mixer control 'Phone',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Playback channels: Mono
Capture channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono: Playback 0 [0%] [off]
Front Left: Capture [off]
Front Right: Capture [off]
Simple mixer control 'IEC958 Playback Source',0
Capabilities: enum
Items: 'AC-Link' 'A/D Converter'
Item0: 'AC-Link'
Simple mixer control 'Aux',0
Capabilities: pvolume pswitch cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 31
Front Left: Playback 0 [0%] [off] Capture [off]
Front Right: Playback 0 [0%] [off] Capture [off]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 15
Front Left: Capture 13 [87%] [off]
Front Right: Capture 13 [87%] [off]
Simple mixer control 'Mix',0
Capabilities: cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Capture channels: Front Left - Front Right
Front Left: Capture [off]
Front Right: Capture [off]
Simple mixer control 'Mix Mono',0
Capabilities: cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Capture channels: Front Left - Front Right
Front Left: Capture [off]
Front Right: Capture [off]
And using the same size values in memcoder I pretty sure the Expert version should be able to do the same here is what I used to get the 720x480 recording.
Thanks for the reply; I'm using the v4l driver at the moment not the v4l2 driver as it simply doesn't get the picture.
However using the v4l driver I get the following with your settings:
Code:
MPlayer 2:0.99+1.0pre7try2+cvs20060117-0ubuntu8 (C) 2000-2006 MPlayer Team
CPU: Intel Pentium 4/Celeron D Prescott; Xeon Nocona (Family: 15, Stepping: 4)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
91 audio & 204 video codecs
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support.
You will not be able to use your remote control.
Playing tv://.
Selected driver: v4l
name: Video 4 Linux input
author: Alex Beregszaszi
comment: under development
=================================================================
WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!
As the V4L1 compatibility layer is broken, this may not work.
If you encounter any problems, use driver=v4l2 instead.
Bugreports on driver=v4l with v4l2 drivers will be ignored.
=================================================================
Selected device: Leadtek Winfast 2000XP Expert
Capabilites: capture tuner teletext overlay
Device type: 15
Supported sizes: 48x32 => 768x576
Inputs: 3
0: Television: tuner tv (tuner:1, norm:pal)
1: Composite1: (tuner:0, norm:pal)
2: S-Video: (tuner:0, norm:pal)
Using input 'Television'
ioctl get picture failed: Invalid argument
ioctl get picture failed: Invalid argument
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 480 (preferred colorspace: Packed YUY2)
VDec: using Packed YUY2 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 720x480 => 720x480 Packed YUY2
Selected video codec: [rawyuy2] vfm: raw (RAW YUY2)
==========================================================================
Audio: no sound
Starting playback...
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
V: 0.0 1/ 1 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
ioctl mcapture failed: Invalid argument
V: 0.0 2/ 2 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
V: 0.1 3/ 3 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
V: 0.1 4/ 4 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
V: 0.2 5/ 5 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
V: 0.2 6/ 6 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
V: 0.2 7/ 7 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
V: 0.3 8/ 8 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
V: 0.3 9/ 9 ??% ??% ??,?% 0 0
ioctl mcapture failed: Invalid argument
And just a green screen with some static.
Amadeus
Did you use it exactly as I wrote it if so you would be trying to get a NTSC signal with what looks like a PAL tuner so change that from ntsc to pal in the line and you may want to increase the size to 768 576 which it says in the output above it supports also what input are you using the television tuner, svideo or composite this is what it looks like when I use it here.
Code:
>$ mplayer tv:// -tv driver=v4l2:norm=NTSC:input=0:alsa:width=720:height=480:outfmt=yuy2:device=/dev/video0
MPlayer 1.0pre8-4.1.2 (C) 2000-2006 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model: 35, Stepping: 2)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2
Failed to open /dev/rtc: Permission denied (it should be readable by the user.)
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0: Permission denied
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: Connection refused
Failed to open LIRC support.
You will not be able to use your remote control.
Playing tv://.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
comment: first try, more to come ;-)
Selected device: BT878 video (Leadtek WinFast 20
Tuner cap:
Tuner rxs: LANG1 LANG2
Capabilites: video capture video overlay VBI capture device tuner read/write streaming
supported norms: 0 = PAL; 1 = NTSC; 2 = SECAM; 3 = PAL-Nc; 4 = PAL-M; 5 = PAL-N; 6 = NTSC-JP; 7 = PAL-60;
inputs: 0 = Television; 1 = Composite1; 2 = S-Video; 3 = Composite3;
Current input: 0
Current format: YUYV
v4l2: current audio mode is : LANG1
open: No such file or directory
Couldn't open: /dev/mga_vid
open: No such file or directory
Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: No such device or address.
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 480 (preferred colorspace: Packed YUY2)
VDec: using Packed YUY2 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 720x480 => 720x480 Packed YUY2
Selected video codec: [rawyuy2] vfm: raw (RAW YUY2)
==========================================================================
Audio: no sound
Starting playback...
v4l2: 1274 frames successfully processed, 12 frames dropped.
Exiting... (Quit)
I just posted this to v4l and freevo mailing lists:
Hello,
I just came back from a wining and dining and in my grogginess managed
to get v4l2 working! It turns out that settings brightness, contrast and
hue are what is needed.
Here are two scripts for watching and recording with a "Leadtek Winfast
2000XP Expert" in Belgium with the card's audio out plugged into the
motherboards AUX in. It only took 3 weeks to figure out
For integration into Freevo I will update their wiki with instructions.
I hope this can help someone browsing the list. I'll also put
instructions on how to get my card to work on my site; poff.sixbit.org
Thanks for your help!
Amadeus
script 'watch':
Code:
#!/bin/bash
# usage: watch channel
channel=$1
if [ -z $channel ]; then
echo "Usage: watch channel"
exit 1
fi
# some settings:
mplayer='/usr/bin/mplayer'
width=768
height=576
adevice=hw.0,0:alsa
# 2 bodges for converting tvtime channel names into mplayer channel names
# U29 -> 29
channel=${channel#U}
# S1-S20 -> SE1-SE20
if [[ ${channel#S} != $channel && ${channel#S} -lt 21 ]]; then
channel="SE${channel#S}"
fi
# mplayer options with deinterlace
options="tv:// -tv
driver=v4l2:brightness=53:contrast=26:saturation=50:hue=50:adevice=$adevice:forceaudio:audiorate=32000:amode=1:norm=PAL-BG:input=0:chanlist=europe-west:channel=$channel:width=$width:height=$height:outfmt=yuy2:device=/dev/video0
buffersize=64 -vf pp=ci"
# start the playback process:
# unmute aux
amixer -q cset numid=22 on
# set aux vol
amixer -q cset numid=23 95%
# set capture aux
amixer -q cset numid=26 3
# set capture on
amixer -q cset numid=27 on
# set capture volume
amixer -q cset numid=28 95%
# video mute off
v4lctl volume mute off
# watch
$mplayer $options
# stop the playback process
# video mute on
v4lctl volume mute on
script 'record':
Code:
#!/bin/bash
# usage: record channel filename
channel=$1; output=$2
if [ -z $output ]; then
echo "Usage: record channel filename"
exit 1
fi
# some settings:
mencoder='/usr/bin/mencoder'
width=768
height=576
adevice=hw.0,0:alsa
# 2 bodges for converting tvtime channel names into mplayer channel names
# U29 -> 29
channel=${channel#U}
# S1-S20 -> SE1-SE20
if [[ ${channel#S} != $channel && ${channel#S} -lt 21 ]]; then
channel="SE${channel#S}"
fi
# mencoder options with deinterlace
options="tv:// -tv
driver=v4l2:brightness=53:contrast=26:saturation=50:hue=50:adevice=$adevice:forceaudio:audiorate=32000:amode=1:norm=PAL-BG:input=0:chanlist=europe-west:channel=$channel:width=$width:height=$height:outfmt=yuy2:device=/dev/video0
buffersize=64 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=5000:keyint=30
-oac mp3lame -lameopts br=128:cbr:mode=3 -ffourcc divx -vf pp=ci -o $output"
# start the recording process:
# mute aux
amixer -q cset numid=22 off
# set aux vol
amixer -q cset numid=23 90%
# set capture aux
amixer -q cset numid=26 3
# set capture on
amixer -q cset numid=27 on
# set capture volume
amixer -q cset numid=28 90%
# video mute off
v4lctl volume mute off
# record
$mencoder $options
# stop recording process
# video mute on
v4lctl volume mute on
# unmute aux
amixer -q cset numid=22 on
# set aux vol
amixer -q cset numid=23 80%
# set capture off
amixer -q cset numid=27 off
# set capture volume
amixer -q cset numid=28 80%
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.