More info as I continue to debug:
I started using mplayer now to directly display /dev/video0 and
/dev/video1. When using video1 all is ok.
Using video0 doesn't show anything unless I use the tricks in the
previous post. But after more testing, it seems that the debug value
isn't the factor that makes it work. What I can do is open two
terminals, execute mplayer in one; then nothing happens unless I press
enter a lot in the second terminal. Once I got the stream going it stays
up. So initially it requires me to press enter in a totally non-related
terminal, not executing any command. Then I got thinking and it seems
the pvr500 and the ethernet card share an interrupt:
~$ cat /proc/interrupts
CPU0
0: 346923732 IO-APIC-edge timer
2: 0 XT-PIC cascade
4: 7951572 IO-APIC-edge lirc_serial
8: 3 IO-APIC-edge rtc
14: 12425311 IO-APIC-edge ide0
15: 2283306 IO-APIC-edge ide1
153: 100000 IO-APIC-level ohci1394
161: 44397953 IO-APIC-level eth0, ivtv0, ivtv1
169: 3693 IO-APIC-level uhci_hcd:usb1, uhci_hcd:usb2,
uhci_hcd:usb3, ehci_hcd:usb4
177: 4303137 IO-APIC-level VIA8237
NMI: 0
LOC: 347809891
ERR: 0
MIS: 0
and I got the theory confirmed that somehow the eth0 interrupts are
involved. The pressing enter just triggered interrupts (I access over
SSH) and that's what made the video0 work. I later tried with accessing
mythweb and using the subversion server that also runs on the box and in
both cases I got video0 "jumpstarted".
There are more issues with shaky images and audio that's out of sync,
but I'm guessing these are all related to the interrupt issue.
I've looked at the irq code of both ivtv (driver/ivtv-irq.c) and the
code of the ethernet driver (drivers/net/via-velocity.c) and both seem
to handle shared interrupts correctly.
Then I noticed the following is shown the first time I use video0.
Message from [EMAIL PROTECTED] at Sun Jan 1 02:04:02 2006 ...
lrn-mythtv kernel: [ 332.802547] Disabling IRQ #153
in /var/log/messages I find:
[ 332.801858] irq 153: nobody cared (try booting with the "irqpoll" option)
[ 332.801947] [<c014de24>] __report_bad_irq+0x24/0x80
[ 332.802007] [<c014e09a>] note_interrupt+0x21a/0x250
[ 332.802059] [<c014d393>] handle_IRQ_event+0x33/0x60
[ 332.802109] [<c014d4c9>] __do_IRQ+0x109/0x120
[ 332.802165] [<c0105dd1>] do_IRQ+0x31/0x70
[ 332.802215] [<c01041fa>] common_interrupt+0x1a/0x20
[ 332.802247] [<c0101ca0>] default_idle+0x0/0x60
[ 332.802305] [<c0101cd1>] default_idle+0x31/0x60
[ 332.802339] [<c0101d47>] cpu_idle+0x47/0xd0
[ 332.802376] [<c03f77cc>] start_kernel+0x33c/0x3b0
[ 332.802410] [<c03f7220>] unknown_bootoption+0x0/0x270
[ 332.802475] handlers:
[ 332.802488] [<f88622b0>] (ohci_irq_handler+0x0/0x990 [ohci1394])
[ 332.802547] Disabling IRQ #153
I changed some debug code in drivers/ivtv-driver.c so the info at the
end of ivtv_setup_pci is shown.
Tuner1:
22 (rev 1) at 02:08.0, irq: 161, latency: 64, memory: 0xf0000000
Tuner2:
22 (rev 1) at 02:09.0, irq: 161, latency: 64, memory: 0xec000000
First I thought that somehow the first tuner should be on interrupt 153,
but after registering the irq handler on both 161 and 153 it doesn't
change anything.
Then I somehow thought it was a good idea to upgrade to Ubunutu 7.04
(2.6.20 kernel and ivtv 0.10.1) and spend the next 10 hours getting
things to work again.
Right now it's pretty ok (with only second tuner), but the CPU usage is
way heigher, resulting in some annoying interruptions. I'll have to look
into that later
gr.
Ronald
Ronald Vanschoren wrote:
> Hi,
>
> I've been debugging more and things are getting really weird.
>
> When I "cat /dev/video0 > /tmp/testmpg" I get nothing, unless I press a
> key while the cat is busy. Then all of a sudden the testmpg file
> contains data. There seems to be a slight delay between pressing the key
> and the start of the recording, because when I press a key and
> immeadiatly afterwards ctrl+c the file is still empty.
>
> Another thing I tried was playing with the debug level using ivtvctl and
> came to more weird conclusions. When debugging is set to a higher level
> (e.g. 2 works) I can make the "cat" work without pressing a key, BUT I
> have to display the kernel logs before I get data in my testmpg file. So
> when "tail -f /var/log/messages" is running in another terminal, the
> testmpg file gets data, otherwise not.
>
> The data that comes out of video0 seems to have a really low frame rate,
> but I'm still investigating this.
>
> Hope this helps,
>
> Ronald
>
> Ronald Vanschoren wrote:
>
>> Hi
>>
>> I'm having a problem with the first tuner of a PVR-500 card.
>>
>> My setup:
>> VIA EPIA EN12000E 1200MHz Fanless LVDS MiniITX
>> Hauppauge WIN PVR-500MCE
>> Ubuntu 6.10 installed using this tutorial:
>> https://help.ubuntu.com/community/MythTV (option "Combined Backend
>> Frontend")
>>
>> TV capture card: PVR 500 (with Samsung tuners)
>> Linux version 2.6.18.6-blicboxivtv ([EMAIL PROTECTED]) (gcc version 4.1.2
>> 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)) #1 SMP Wed Jan 10
>> 01:11:32 CET 2007
>> ivtv 0.10.1
>>
>> I used to have a PVR 500 with Philips tuners but the second tuner was
>> broken (see other post I made earlier).
>> I exchanged the card but it now comes with the Samsung tuners. Both
>> tuners seem to initialize properly now (see trace below), but the first
>> one doesn't work.
>> I tried something as simple as "cat /dev/video0 > /tmp/testmpg" and the
>> file remains empty
>>
>> The second tuner works "perfect". It seems to have worse quality then
>> the Philips tuner I had before but at least I have fairly decent video.
>> Sometimes the first tuner works, so I'm guessing some software issue
>> rather then hardware.
>>
>> I manually had to update the kernel to 2.6.28 to be able to use ivtv
>> 0.10.1 for the Samsung tuner PVR 500 support.
>>
>>
>> [1385760.246664] ivtv: ==================== START INIT IVTV
>> ====================
>> [1385760.246678] ivtv: version 0.10.1 (tagged release) loading
>> [1385760.246684] ivtv: Linux version: 2.6.18.6-blicboxivtv SMP
>> mod_unload 586 REGPARM gcc-4.1
>> [1385760.246692] ivtv: In case of problems please include the debug
>> info between
>> [1385760.246700] ivtv: the START INIT IVTV and END INIT IVTV lines,
>> along with
>> [1385760.246706] ivtv: any module options, when mailing the ivtv-users
>> mailinglist.
>> [1385760.249211] ivtv0: Autodetected Hauppauge card (cx23416 based)
>> [1385760.250684] PCI: Enabling device 0000:02:08.0 (0000 -> 0002)
>> [1385761.017989] ivtv0: loaded v4l-cx2341x-enc.fw firmware (376836 bytes)
>> [1385761.236027] ivtv0: Encoder revision: 0x02060039
>> [1385761.247136] tuner 1-0043: chip found @ 0x86 (ivtv i2c driver #0)
>> [1385761.248284] tda9887 1-0043: tda988[5/6/7] found @ 0x43 (tuner)
>> [1385761.253853] tuner 1-0060: TEA5767 detected.
>> [1385761.253861] tuner 1-0060: chip found @ 0xc0 (ivtv i2c driver #0)
>> [1385761.255422] tuner 1-0060: type set to 62 (Philips TEA5767HN FM Radio)
>> [1385761.256419] tuner 1-0061: chip found @ 0xc2 (ivtv i2c driver #0)
>> [1385761.292194] cx25840 1-0044: cx25843-23 found @ 0x88 (ivtv i2c
>> driver #0)
>> [1385766.478646] cx25840 1-0044: loaded v4l-cx25840.fw firmware (16382
>> bytes)
>> [1385766.595444] wm8775 1-001b: chip found @ 0x36 (ivtv i2c driver #0)
>> [1385766.712100] tveeprom 1-0050: Hauppauge model 23559, rev E696,
>> serial# 10259094
>> [1385766.712115] tveeprom 1-0050: tuner model is Samsung TCPG 6121P30A
>> (idx 96, type 73)
>> [1385766.712126] tveeprom 1-0050: TV standards PAL(B/G) PAL(I)
>> SECAM(L/L') PAL(D/D1/K) (eeprom 0x74)
>> [1385766.712136] tveeprom 1-0050: second tuner model is Philips
>> TEA5768HL FM Radio (idx 101, type 62)
>> [1385766.712146] tveeprom 1-0050: audio processor is CX25843 (idx 37)
>> [1385766.712154] tveeprom 1-0050: decoder processor is CX25843 (idx 30)
>> [1385766.712161] tveeprom 1-0050: has radio, has no IR remote
>> [1385766.712169] ivtv0: Autodetected WinTV PVR 500 (unit #1)
>> [1385766.887933] ivtv0: Registered device video0 for encoder MPEG (4 MB)
>> [1385766.908189] ivtv0: Registered device video32 for encoder YUV (2 MB)
>> [1385766.928979] ivtv0: Registered device vbi0 for encoder VBI (1 MB)
>> [1385766.949185] ivtv0: Registered device video24 for encoder PCM audio
>> (1 MB)
>> [1385766.970383] ivtv0: Registered device radio0 for encoder radio
>> [1385766.971044] tuner 1-0061: type set to 73 (Samsung TCPG 6121P30A)
>> [1385767.419641] ivtv0: Initialized WinTV PVR 500 (unit #1), card #0
>> [1385767.420386] ivtv: ====================== NEXT CARD
>> ======================
>> [1385767.420402] ivtv1: Autodetected Hauppauge card (cx23416 based)
>> [1385767.421471] PCI: Enabling device 0000:02:09.0 (0000 -> 0002)
>> [1385768.209912] ivtv1: loaded v4l-cx2341x-enc.fw firmware (376836 bytes)
>> [1385768.427937] ivtv1: Encoder revision: 0x02060039
>> [1385768.435210] tuner 2-0043: chip found @ 0x86 (ivtv i2c driver #1)
>> [1385768.436753] tda9887 2-0043: tda988[5/6/7] found @ 0x43 (tuner)
>> [1385768.441816] tuner 2-0061: chip found @ 0xc2 (ivtv i2c driver #1)
>> [1385768.478725] cx25840 2-0044: cx25843-23 found @ 0x88 (ivtv i2c
>> driver #1)
>> [1385773.662502] cx25840 2-0044: loaded v4l-cx25840.fw firmware (16382
>> bytes)
>> [1385773.779175] wm8775 2-001b: chip found @ 0x36 (ivtv i2c driver #1)
>> [1385773.895867] tveeprom 2-0050: Hauppauge model 23559, rev E696,
>> serial# 10259094
>> [1385773.895882] tveeprom 2-0050: tuner model is Samsung TCPG 6121P30A
>> (idx 96, type 73)
>> [1385773.895893] tveeprom 2-0050: TV standards PAL(B/G) PAL(I)
>> SECAM(L/L') PAL(D/D1/K) (eeprom 0x74)
>> [1385773.895903] tveeprom 2-0050: second tuner model is Philips
>> TEA5768HL FM Radio (idx 101, type 62)
>> [1385773.895913] tveeprom 2-0050: audio processor is CX25843 (idx 37)
>> [1385773.895921] tveeprom 2-0050: decoder processor is CX25843 (idx 30)
>> [1385773.895928] tveeprom 2-0050: has radio, has no IR remote
>> [1385773.895937] ivtv1: Correcting tveeprom data: no radio present on
>> second unit
>> [1385773.895944] ivtv1: Autodetected WinTV PVR 500 (unit #2)
>> [1385774.070839] ivtv1: Registered device video1 for encoder MPEG (4 MB)
>> [1385774.091429] ivtv1: Registered device video33 for encoder YUV (2 MB)
>> [1385774.112037] ivtv1: Registered device vbi1 for encoder VBI (1 MB)
>> [1385774.132148] ivtv1: Registered device video25 for encoder PCM audio
>> (1 MB)
>> [1385774.133275] tuner 2-0061: type set to 73 (Samsung TCPG 6121P30A)
>> [1385774.543193] ivtv1: Initialized WinTV PVR 500 (unit #2), card #1
>> [1385774.543854] ivtv: ==================== END INIT IVTV
>> ====================
>>
>>
>> I also sometimes see
>>
>> [1385568.866060] ivtv0: DMA TIMEOUT 00000003 0
>>
>> show up in kernel traces and mythbackend shows the following error in
>> his logs:
>> 2007-04-28 22:05:11.931 TVRec(1): Changing from None to WatchingLiveTV
>> 2007-04-28 22:05:11.939 TVRec(1): HW Tuner: 1->1
>> 2007-04-28 22:05:18.084 MPEGRec(/dev/video0) Error: select timeout -
>> ivtv driver has stopped responding
>> 2007-04-28 22:05:18.852 TVRec(1): Changing from WatchingLiveTV to None
>> 2007-04-28 22:05:19.116 Finished recording De thuisploeg: channel 1000
>> 2007-04-28 22:06:24.729 Expiring De thuisploeg from Sat Apr 28 21:25:00
>> 2007, 0 MBytes, forced expire (LiveTV recording)
>>
>>
>> Does anyone have any idea? Is there anything I can do to provide more info?
>>
>>
>> Thanks in advance,
>>
>> Ronald
>>
>>
>> _______________________________________________
>> ivtv-users mailing list
>> [email protected]
>> http://ivtvdriver.org/mailman/listinfo/ivtv-users
>>
>>
>
>
> _______________________________________________
> ivtv-users mailing list
> [email protected]
> http://ivtvdriver.org/mailman/listinfo/ivtv-users
>
_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users