[MEncoder-users] sound recording/capture problem

Moritz Barsnick barsnick at gmx.net
Thu Aug 2 22:21:10 CEST 2007


Hi Jody,

On Thu, Aug 02, 2007 at 08:02:02 -0400, Jody Gugelhupf wrote:

> i want to capture from my tv card, but somehow i can't get audio to
> work, I have the line-out of my tv tuner card in the line-in of my
> onboard via soundcard, i can hear audio while watching tv, and
> capture also used to work, but i haven'tt used it iin a while and now
> it does not work, here is some info about my sound conf:

What is the command line you are trying to use? What is not working?

How do you watch TV with sound? As you are on _this_ list, you should
be using mplayer. ;-) Mencoder takes similar settings as mplayer.

Looking at my own scripts, I think I recall a common problem:
mplayer/mencoder doesn't set all required ALSA configurations, you need
to set e.g. the unmute yourself. But read below. :)

> cat /proc/asound/pcm
> 01-01: Bt87x Analog : Bt87x Analog : capture 1
> 01-00: Bt87x Digital : Bt87x Digital : capture 1
> 00-02: CMI8738-MC6 : C-Media PCI IEC958 : playback 1 : capture 1
> 00-01: CMI8738-MC6 : C-Media PCI 2nd DAC : playback 1
> 00-00: CMI8738-MC6 : C-Media PCI DAC/ADC : playback 1 : capture 1
> 02-01: VIA 8233-Pre : VIA 8233-Pre : playback 1 : capture 1
> 02-00: VIA 8233-Pre : VIA 8233-Pre : playback 4 : capture 1

Well, that's a lot of capture-capable sources. :-)

> amixer -c 1 cget name='Capture Source'
> numid=3,iface=MIXER,name='Capture Source'
> ; type=ENUMERATED,access=rw------,values=1,items=3
> ; Item #0 'TV Tuner'
> ; Item #1 'FM'
> ; Item #2 'Mic/Line'
> : values=0

And more options.

> cat /proc/asound/oss/sndstat

Avoid OSS if you can use ALSA directly.

> i don't know how to get it working, also I would like to know how my
> sounds devices and my tv tuner card are called in the form of
> '/dev/XYZ' i know my tvcad (the video part) is on /dev/video0 so much
> is for sure, i also know that mostly sound is on /dev/dsp, but this
> is not for sure

I think /dev/dsp is the ALSA OSS emulation. It could work, but I would
try pure ALSA first.

As hinted above, try (experiment) to see if mplayer successfully plays
the tuner's sound through your computer first, then use that setting
for mencoder.

First, figure out which of your cards is the one you're capturing from,
I assume your onboard device is number 2(?). Let's call this number
"${CARD}".

My mplayer/mencoder "-tv" opts include:
alsa:audiorate=48000:amode=1:forcechan=2:adevice=hw.${CARD},0,0

* adevice selects card and sub-item; the latter is stuff like line
  vs. mike on my onboard (MCH5)
(* amode=1 is stereo
* forcechan=2 always records two audio channels in the resulting
  audio stream)

But to actually get audio data, I need to set the following before
playback or capture:

amixer -c ${CARD} set Capture cap
amixer -c ${CARD} set Capture 20%
amixer -c ${CARD} set Capture unmute
amixer -c ${CARD} set Line cap
amixer -c ${CARD} set Line 30%
amixer -c ${CARD} set Line unmute

Perhaps this is something you need to do.

Hope this helps,
Moritz





 on my system is there a command which gives me a list
> of my devices int he form of '/dev/XYZ' so i will know for sure? and
> how the hell do i get to capture the sound from my tv tuner, i don't
> care if i have to capture it directly from the bt878 or from the line
> in of one of my soundcards, i have



More information about the MEncoder-users mailing list