Opened 18 years ago

Closed 17 years ago

#1277 closed defect (wontfix)

Initial tuning of analog channel doesn't output sound

Reported by: mattsch@… Owned by: danielk
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords: analog sound
Cc: Ticket locked: no

Description

When I tune an analog (v4l) channel by selecting Watch TV, it does not output the sound. As soon as I change the channel, I get sound. Normally I wouldn't care about the Watch TV option but it seems like it is affecting recording as well because everytime I record an analog channel and playback the nuv file, I don't get any sound but if I were to select Watch TV, change the channel and then view that nuv file, then it outputs sound. I'm using MythTv? 0.19 and here's an lspci output of my system:

00:00.0 Host bridge: VIA Technologies, Inc. KT880 Host Bridge 00:00.1 Host bridge: VIA Technologies, Inc. KT880 Host Bridge 00:00.2 Host bridge: VIA Technologies, Inc. KT880 Host Bridge 00:00.3 Host bridge: VIA Technologies, Inc. KT880 Host Bridge 00:00.4 Host bridge: VIA Technologies, Inc. KT880 Host Bridge 00:00.7 Host bridge: VIA Technologies, Inc. KT880 Host Bridge 00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge 00:07.0 Ethernet controller: VIA Technologies, Inc. VT6120/VT6121/VT6122 Gigabit Ethernet Adapter (rev 11) 00:09.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder (rev 05) 00:09.1 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port] (rev 05) 00:09.2 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05) 00:0d.0 FireWire? (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80) 00:0f.0 IDE interface: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80) 00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) 00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81) 00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81) 00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81) 00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81) 00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86) 00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South] 00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60) 01:00.0 VGA compatible controller: nVidia Corporation NV10DDR 256 DDR? (rev 10)

Attachments (1)

cx88_mythtv_1277.patch (1.6 KB) - added by anonymous 17 years ago.
Kernel patch for drivers/media/video/cx88 for Mythtv issue 1277(workaround)

Download all attachments as: .zip

Change History (30)

comment:1 Changed 18 years ago by mattsch@…

Here's the log output after I select watch TV:

2006-02-13 23:13:28.527 Registering Internal as a media playback plugin. 2006-02-13 23:13:49.530 New DB connection, total: 2 2006-02-13 23:13:49.531 Connected to database 'mythconverg' at host: localhost 2006-02-13 23:13:49.593 Connecting to backend server: 192.168.0.3:6543 (try 1 of 5) 2006-02-13 23:13:49.624 Using protocol version 26 2006-02-13 23:13:49.696 TV: Attempting to change from None to WatchingLiveTV 2006-02-13 23:13:49.711 Using protocol version 26 2006-02-13 23:13:50.228 RingBuf?(/home/mythtv/4055_20060213231349.nuv): Invalid file (fd 17) when opening '/home/mythtv/4055_20060213231349.nuv'. 12 retries remaining. 2006-02-13 23:13:50.863 Opening audio device '/dev/dsp'. 2006-02-13 23:13:50.863 Opening OSS audio device '/dev/dsp'. 2006-02-13 23:13:51.687 TV: Changing from None to WatchingLiveTV 2006-02-13 23:13:51.689 New DB connection, total: 3 2006-02-13 23:13:51.694 Realtime priority would require SUID as root. 2006-02-13 23:13:51.729 Connected to database 'mythconverg' at host: localhost 2006-02-13 23:13:51.908 rebuffering (1 32768) 2006-02-13 23:13:52.431 Video timing method: SGI OpenGL 2006-02-13 23:13:52.919 rebuffering (1 32768) 2006-02-13 23:13:53.541 rebuffering (9692 32768) 2006-02-13 23:13:54.487 rebuffering (16420 32768) 2006-02-13 23:13:55.361 rebuffering (18945 32768) 2006-02-13 23:13:56.324 NVP: prebuffering pause 2006-02-13 23:13:56.745 rebuffering (15248 32768)

comment:2 Changed 18 years ago by Isaac Richards

Priority: criticalmajor
Severity: highmedium

comment:3 Changed 18 years ago by Isaac Richards

Priority: majorminor

comment:4 Changed 18 years ago by jens.andersen@…

Milestone: unknown
Version: 0.19

I'm having the same problem with mythtv 0.19-fixes from yesterday. Hauppage PVR-500 card. It happens both on livetv and occasionally on recordings (It seems to only happen on recordings with the second card, which of course is the least used one). Mythfrontend output here: 2006-03-29 18:14:17.909 Using runtime prefix = /usr/local 2006-03-29 18:14:17.999 New DB connection, total: 1 2006-03-29 18:14:18.031 Connected to database 'mythconverg' at host: 192.168.0.1 2006-03-29 18:14:18.033 Total desktop dim: 1024x768, with 1 screen[s]. 2006-03-29 18:14:18.036 Using screen 0, 1024x768 at 0,0 2006-03-29 18:14:18.049 Current Schema Version: 1123 2006-03-29 18:14:18.049 mythfrontend version: 0.19.20060121-2 www.mythtv.org 2006-03-29 18:14:18.049 Enabled verbose msgs: important general 2006-03-29 18:14:18.464 lang0: aar 2006-03-29 18:14:18.464 lang: aar 2006-03-29 18:14:18.481 lang1: aar 2006-03-29 18:14:18.481 lang: aar 2006-03-29 18:14:18.672 Total desktop dim: 1024x768, with 1 screen[s]. 2006-03-29 18:14:18.674 Using screen 0, 1024x768 at 0,0 2006-03-29 18:14:18.675 Switching to square mode (Iulius) 2006-03-29 18:14:19.177 Joystick disabled. 2006-03-29 18:14:19.182 New DB connection, total: 2 2006-03-29 18:14:19.192 Connected to database 'mythconverg' at host: 192.168.0.1 2006-03-29 18:14:19.336 Registering Internal as a media playback plugin. 2006-03-29 18:14:19.416 Registering MythDVD DVD Media Handler as a media handler 2006-03-29 18:14:19.417 Registering MythDVD VCD Media Handler as a media handler 2006-03-29 18:14:20.144 Registering MythMusic Media Handler as a media handler 2006-03-29 18:14:20.893 Starting media monitor. 2006-03-29 18:14:22.142 Connecting to backend server: 192.168.0.22:6543 (try 1 of 5) 2006-03-29 18:14:22.148 Using protocol version 26 2006-03-29 18:14:22.184 TV: Attempting to change from None to WatchingLiveTV 2006-03-29 18:14:22.192 Using protocol version 26 2006-03-29 18:14:22.621 RingBuf?(/media/recordings/1035_20060329181422.mpg): Invalid file (fd 16) when opening '/media/recordings/1035_20060329181422.mpg'. 12 retries remaining. 0: start_time: 0.036 duration: 0.158 1: start_time: 0.025 duration: 0.130 stream: start_time: 0.276 duration: 1.884 bitrate=6138 kb/s 2006-03-29 18:14:25.228 AFD: Opened codec 0x81f65d0, id(MPEG2VIDEO) type(Video) 2006-03-29 18:14:25.263 AFD: Opened codec 0x82670c0, id(MP2) type(Audio) 2006-03-29 18:14:25.265 Opening audio device 'default'. 2006-03-29 18:14:25.707 New DB connection, total: 3 2006-03-29 18:14:25.708 Using realtime priority. 2006-03-29 18:14:25.709 TV: Changing from None to WatchingLiveTV 2006-03-29 18:14:25.712 Connected to database 'mythconverg' at host: 192.168.0.1 2006-03-29 18:14:25.755 Video timing method: DRM

comment:5 Changed 18 years ago by anonymous

Milestone: unknown
Version: 0.19

comment:6 Changed 18 years ago by thekazan@…

Priority: minormajor

this issue is still occuring

comment:7 Changed 18 years ago by Isaac Richards

Priority: majorminor

comment:8 Changed 18 years ago by jens.andersen@…

For me it seems to have fixed it by upgrading the sound firmware to the HcwMakoC.ROM from the prerelease driver available at ftp://ftp.shspvr.com/download/wintv-pvr_150-500/prerelease/ The actual firmware seems to be exactly the same, only the sound one is different (it also contains a HcwMakoB.ROM, but this one is exactly the same as the recommended one) Can you confirm this works for you?

comment:9 Changed 18 years ago by mattsch@…

This is purely a MythTV bug and is not hardware related (I use a Dvico Fusion 5 card).

comment:10 Changed 18 years ago by jason.gabriele@…

This ticket has been open for a while, I hope people are still looking at it. I also have a DViCO Fusion 5 Gold card and am having problems with the sound and channel change. I've described my experience here http://www.mythtv.org/wiki/index.php/DVICO_FusionHDTV5_Gold . My problems are essentially the opposite of what the ones this guy was having. I have sound until I try to change the channel. At that point, I have to exit Live TV and then go back to Live TV to get it working again. As I describe in the wiki page, I'm not sure if this is a MythTV problem or not but it seems like a MythTV problem because I can record sound off the device after quitting to the menu. I can't rule out driver problems, however, as the driver for this device has had a troubled history.

Here is the log of what happens when I first try to view analog live tv. I startup myth, and the tuner is set to dvb by default. I hit C to change the input to Analog TV and then get a black screen with yellow lines and crackling (like I'm tuned to a channel which has no signal).

http://files.radixpub.com/initialtune.txt

Here is the log where I have done the first part and exited back to the menu. I then go back Live TV which is now set to default to the Analog tuner. The picture now is black and white for about 2 seconds but then comes in fine. From there the picture and sound come in fine until I attempt to change the channel. At that point I lose the audio but the picture remains fine.

http://files.radixpub.com/channelchange.txt

If I exit Live TV after this, and then return I get audio for that channel fine. That is until I try to change the channel again.

Thanks

comment:11 Changed 18 years ago by mattsch@…

It's good to know that people are interested in this bug. Sometimes I wonder if the mythtv folks will get to it at some point but I'm patient as this isn't the only bug. At any rate, it's not a driver problem. I can view analog channels just fine using tvtime without sound issues. This all applies to x86 of course. I have tested this card on AMD64 with 64-bit libraries and the digital tuning works fine but the analog tuning does not in both tvtime and mplayer. In that case, it's a driver issue.

comment:12 Changed 18 years ago by cpinkham

Can you collect the frontend logs with audio debugging enabled (ie, add a 'audio' to your '-v' argument). Also, have you checked to make sure that the audio isn't just muted? What happens when you try to mute/umute or adjust the volume?

comment:13 Changed 18 years ago by mattsch@…

I'd like to give you the audio logs but right now by x86 box is down due to the motherboard catching fire. I know when I tested it, the sound was not muted as all I'd have to do at the time was change the channel and live tv would output the sound. I never tried to see if mythtv muted the sound initially and then unmuted it when I changed a channel. I'll have to check it when I get my x86 box up and running again.

comment:14 in reply to:  10 Changed 18 years ago by mrussotto@…

Replying to jason.gabriele@gmail.com:

This ticket has been open for a while, I hope people are still looking at it. I also have a DViCO Fusion 5 Gold card and am having problems with the sound and channel change. I've described my experience here http://www.mythtv.org/wiki/index.php/DVICO_FusionHDTV5_Gold . My problems are essentially the opposite of what the ones this guy was having. I have sound until I try to change the channel.

This is a driver bug, I believe. Note this change: http://linuxtv.org/hg/v4l-dvb?cmd=changeset;node=fcbc40540e1b;style=gitweb Also note that if you build the latest linuxtv snapshot it doesn't fix it, because the define in this change set (CONFIG_VIDEO_CX88_ALSA) doesn't get defined (CONFIG_VIDEO_CX88_ALSA_MODULE does, though). Easiest thing to do is to just comment out the stop/start DMA lines.

However, this doesn't impact the original bug of no sound on initial tuning. I'm getting a similar issue; it's not that there's no sound, but that the sound is set to the wrong sample rate. My card only supports 48000, anything else and you get garbage. I am not sure this is the same problem as changing channels _doesn't_ fix it. Leaving LiveTV and coming back does.

comment:15 Changed 18 years ago by danielk

Milestone: unknown
Owner: changed from Isaac Richards to danielk
Version: head

mrussotto, do you have the Sampling rate set to 48000 in all your "Software Encoders (v4l based)" Utilities/Setup:Setup:TV Settings:Recording Profiles?

comment:16 Changed 18 years ago by mattsch@…

Let me mention that when I originally submitted this bug, CX88 ALSA did not exist. I was connecting to the card using an internal audio cable to my sound card.

comment:17 Changed 18 years ago by mrussotto@…

Yes, all my software encoders are set to 48000. I added VERBOSE statements at all the places in NuppelVideoRecorder? I could see it using the sample rate, and they all came out as 48000 both when the sound was good and when the sound was bad.

comment:18 Changed 18 years ago by dwinkel@…

I am having the same problem with a Hauppage PVR-350 card. It doesn't play sound when initially turned on, but if I change channels w/ LiveTV, I get sound. Unfortunately, since I want to use it almost exclusively through Mythweb, that means that none of my recordings have sound. Alternatively, is there a way to have Mythweb change a channel a second or two after starting a recording, so that the sound can start up? I'm up for a hack, I just want the sucker to work at this point.

comment:19 Changed 18 years ago by jason.gabriele@…

OK, I finally got around to testing this again. I am using 2.6.18-ck1, MythTV .20, and a Fusion 5 Gold ATSC.

I still have the same issue. Using cx88-alsa, I lose the sound after changing the channel. Using the internal audio connecter, I don't have sound until I change the channel. In either case, switching from dvb to analog causes the tuner to display snow until I exit to the menu and go back to Watch TV. Upgrading to 2.6.18 made no difference.

comment:20 Changed 18 years ago by mattsch@…

I'm not quite sure why the v4l2 driver is being blamed for this bug. Tvtime does not have any problems with sound under the x86 arch. This is still purely a mythtv problem especially since many people are reporting this problem with a variety of different cards. Try tuning analog channels with tvtime, you'll find that it tunes channels just fine whereas mythtv does not.

comment:21 Changed 18 years ago by anonymous

There's more than one bug being reported here.

The "losing sound after changing channel" bug definitely lies in the cx88-alsa driver, and it affects sound output through ALSA when changing channels with tvtime as well. This can be fixed by removing the cx88_stop_audio_dma/cx88_start_audio_dma in set_audio_finish in cx88-tvaudio.c.

The issue of switching from digital to analog displaying snow isn't exactly a bug, it's a feature, which can be turned off by adding a file in /etc/modprobe.d containing "options dvb_core dvb_shutdown_timeout=0".

The original "no sound on initial tuning" bug is one I haven't seen (because I don't use the analog audio out), but I would guess it's also a driver bug; it sounds like the multiplexer isn't being set properly when changing from digital to analog. MythTV doesn't have direct control of that process, which is why I think it's probably not a MythTV bug.

comment:22 Changed 18 years ago by mattsch@…

I was referring to my original bug. I can't help it if other people have latched other bugs onto this bug. I do not have problems with the sound when I start up tvtime and any time I switch channels so I'm not sure why this would be a driver bug then. In the original bug report, I never referred to cx88-alsa. I don't use that driver. I use the cable attached directly to the card so any problems related to that do not relate to my original report.

comment:23 Changed 18 years ago by anonymous

Sorry about bringing cx88_alsa into the mix but it seems if we can get one solution working then we can everyone's card working.

I tried making the changes anonymous suggested - there is sound now all the time but it stutters. Occasionally it is followed by prebuffering pauses but not all the time. I have tried selecting extra audio buffering, the putting sampling rate limits on the card. It doesn't seem to have any effect. I don't have any problems with the digital channels.

comment:24 Changed 18 years ago by mrussotto@…

I believe the stuttering may be related to the original bug, but not directly. It happens because during the switch from digital to analog, too many sound interrupts occur and the driver disables the sound interrupt to save the system. I have a workaround for that -- add

cx_set(MO_PCI_INTMSK,0x02);

to snd_cx88_pointer() (in cx88_alsa.c) just before the return statement. This simply turns the interrupt back on every time sound data is requested.

I think there must be some sort of race occurring during the switch from digital to analog that results in this and in the loss of analog sound.

comment:25 Changed 17 years ago by anonymous

Yikes,
A whole year and no resolution. IMHO, this should not have a minor priority, at least not anymore.

1) It’s reproducible
2) It's common
3) It’s specific to MythTV ( not mplayer nor tvtime )
4) The workaround requires a kernel rebuild
5) Its been a year.
6) It prevents use of MythTV ( to new users it SEEMS that analog sound is completely broken, especially during setup and testing )

6 alone merits an escalation. When someone hits this bug, they can easily waste a day messing with ALSA, mplayer, codec.conf, and recording profiles.

comment:26 Changed 17 years ago by luitjens

I have a PVR350 and PVR500 and neither of them have this problem. Is it a problem in the recording or a problem in the playback? You can check this by using something like mplayer to play the livetv recorded file.

I did have a problem which might be consistent with this once with playback and that was that when first starting mythtv analog sound did not work. This was a problem with outputing without a mixer. I added a mixer software mixer to my .asoundrc and the problem went away.

comment:27 Changed 17 years ago by anonymous

I actually got my card (DVICO Fusion 5 Gold) working with the changes to the driver posted above. I meant to put all of the changes into a patch and host it somewhere but never got around to it. So if you have that card, it does work (although there are some weird white blocks when it transitions to absolute black).

Changed 17 years ago by anonymous

Attachment: cx88_mythtv_1277.patch added

Kernel patch for drivers/media/video/cx88 for Mythtv issue 1277(workaround)

comment:28 Changed 17 years ago by anonymous

If this is of any use, I've attached a patch with the changes above. Please don't use it if you don't like the looks of it. If you don't know how to patch your kernel, you should think long and hard before trying this. ( But if you are ready to jump in at your own risk, see http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3014 for a howto on making/using patches )

This SEEMS to work around the issue, but I now get "bangs" and "hisses" when tuning. Your Milage May Vary. I still think MythTV should have it's own work-around, as mplayer and tvtime seem to.

comment:29 Changed 17 years ago by danielk

Resolution: wontfix
Status: newclosed

This appears to be a driver bug. Unless someone has a patch ready to go, I don't think we should add a workaround in MythTV just because mplayer and tvtime have workarounds. There is a patch for the driver which should be pushed into the kernel proper.

Note: See TracTickets for help on using tickets.