[mythtv] Audio unmuting and V4L2

David Zanetti dave2 at wetstring.net
Sat Dec 6 23:43:51 EST 2003

Hash: SHA1

Audio stopped working for me a few days ago out of the blue, and got me to
properly look at why it wasn't working in the first place. (It eventually
started working by using v4lctl, but that's stopped working now..)

MythTV decides to unmute the audio if the channel has audio, which it
decides by looking for the VIDEO_VC_AUDIO flag after the VIDIOCGCHAN
ioctl. If it's not present, it doesn't unmute audio.

Since I'm using an saa7134 board, I have to patch to v4l2 and use the
v4l1-compat module. On examining VIDIOCGCHAN handling in it, it appears it
never sets VIDEO_VC_AUDIO to anything specific. Thus, MythTV never tries
to unmute audio.

tvtime works, however, and looking at it's code, it decides whether there
is audio available by whether or not the VIDIOCGAUDIO ioctl barfs. I
patched a copy of MythTV here to do the same, and now audio works without
messing around with v4lctl.

Simple change in myth, replace:
  if ((vchan.flags & VIDEO_VC_AUDIO) == VIDEO_VC_AUDIO) {
  if (ioctl(fd, VIDIOCGAUDIO, &va) >= 0) {
in NuppelVideoRecorder.cpp does it. 

I guess a fix could also be put into the compatablity module, but it may
be quicker to fix it in myth..

- -- 
David Zanetti           |  (__)             
#include <geek/unix.h>  |  ( oo    Mooooooo 
http://hairy.geek.nz/   |  /(_O ./         
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6


More information about the mythtv-dev mailing list