[Kwintv] Fwd: kdetv sound problem and possible reason

Dirk Ziegelmeier dziegel at gmx.de
Sun May 16 19:41:39 CEST 2004


On Sunday 16 May 2004 18:49, George Staikos wrote:
> Maybe someone on the list can help?  I have not done any V4L2 work since
> everytime I do, the API immediately changes on me again.  I do recall
> syncing the card mute status with the sound mute status in my original
> implementation of the driver, though.
The sound is indeed muted and unmuted via v4l (see kvideoio/v4ldev.cpp, 
enableAudio() and disableAudio(). The routines are "guarded" by checking 
whether the device supports audio. So there are two failure possibilities:

1) The driver reports not to have audio (see debug output: "Does this source 
have audio?  true/false")

2) The VIDIOCGAUDIO is buggy for this driver. kdetv only uses v4l1 calls, but 
they should be mapped to v4l2 calls by the driver.

Please read the console debug output (you need to compile with "configure 
--enable-debug) and check for the line mentioned in 1). If it reads "true", 
add debug output (see below) to kvideoio/v4ldev.cpp/enableAudio() and check 
if the ioctl is executed.

int V4LDev::enableAudio()
{
    kdDebug() << "********* v4ldev: Entering enableAudio." << endl;

    if (!_hasAudio) return -1;
    
    int rc;
    struct video_audio va;
    
    memset(&va, 0, sizeof(va));
    rc = ioctl(_fd, VIDIOCGAUDIO, &va);
    
    if (rc < 0) {
        perror("v4ldev: VIDIOCGAUDIO");
        return -1;
    }
    
    kdDebug() << "*********** v4ldev: Unmute iooctl." << endl;

    va.flags &= ~VIDEO_AUDIO_MUTE;
    rc = ioctl(_fd, VIDIOCSAUDIO, &va);
    if (rc < 0) {
        perror("v4ldev: VIDIOCSAUDIO");
        return -1;
    }
    
    return 0;
}

Dirk

> ----------  Forwarded Message  ----------
>
> Subject: kdetv sound problem and possible reason
> Date: Sunday 16 May 2004 04:54
> From: Marcin Gibuła <mg at iceni.pl>
> To: staikos at kde.org
>
> Hi,
> I have Avecs SmartTV card (it's using kernel driver saa7134) which is
> working fine with xawtv but with kdetv there is not sound. While searching
> for reason, I've found that this driver is muted by default (according to
> dmesg output with audio_debug=1) and probably kdetv don't unmute it (only
> alsa channel). I've tried to recompile saa7134 driver to be always unmuted
> (with hardcoded values) and the sound is ok, but this is only a dirty
> workaround for this problem...
>
> In sources of the driver there is some control value V4L2_CID_AUDIO_MUTE, I
> guess that it's connected with that...
>
> I'm using kernel 2.6.6-bk2. (with bytesex.org patches applied, but without
> them is doesn't work too).
>
> Sorry for my english.


More information about the kwintv mailing list