[pvrusb2] "failed to grab control of dtv input (code=-1)"

Mike Isely isely at isely.net
Tue Jan 10 13:11:05 CST 2012


Hmm, if I remember correctly, the DVB side has to grab the device 
momentarily at initialization time.  However the device hardware can't 
be shared between the V4L and DVB sides (there's only video pipeline 
after all).  And the driver doesn't really do anything explicit to deny 
open() on the V4L side during initialization - so if a V4L app gets in 
there right away when the driver initializes it might be able to grab 
control of it before the DVB side has had a chance.

The solution here would probably be to explicitly prevent open() from 
succeeding until the device is fully initialized - including DVB.  
There's implicit enforcement already, in that the driver won't register 
itself to V4L until the hardware itself is initialized, but the DVB 
software initialization is probably (still) happening concurrently with 
this.  I can look into serializing this better.

  -Mike


On Mon, 9 Jan 2012, Gary Buhrmaster wrote:

> (Back to what I was trying to reproduce).  I think
> there may be a race in the pvrusb2 driver during
> initialization which can result in the dvb side of
> a hybrid device not completing initialization.
> 
> Environment: Fedora 16, 64 bit, 3.1.7 kernel, HVR-1950
> How reproducable: 100% (well, 3 out of 3 test cases).
> Importance: Medium (it seems to randomly occur)
> Result: "failed to grab control of dtv input...."
> 
> Scenerio:
> 
> While running a perl program doing a
>   while(1) { sysopen(F,"/dev/video0",O_RDWR); close(F);}
> (the v4l device will be instantiated as /dev/video0),
> plug in HVR-1950, and receive the following messages:
> 
> To recover and start again, kill the perl program first,
> unplug the device, and then start again.
> 
> 
> [ 2012.100657] usb 2-1.8: new high speed USB device number 9 using ehci_hcd
> [ 2012.189815] usb 2-1.8: New USB device found, idVendor=2040, idProduct=7501
> [ 2012.189818] usb 2-1.8: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 2012.189819] usb 2-1.8: Product: WinTV
> [ 2012.189820] usb 2-1.8: Manufacturer: Hauppauge
> [ 2012.189821] usb 2-1.8: SerialNumber: 7300-00-F06D46EC
> [ 2012.190185] pvrusb2: Hardware description: WinTV HVR-1950 Model 751xx
> [ 2013.193177] pvrusb2: Device microcontroller firmware (re)loaded; it
> should now reset and reconnect.
> [ 2013.236418] usb 2-1.8: USB disconnect, device number 9
> [ 2013.236484] pvrusb2: Device being rendered inoperable
> [ 2014.947997] usb 2-1.8: new high speed USB device number 10 using ehci_hcd
> [ 2015.044277] usb 2-1.8: New USB device found, idVendor=2040, idProduct=7501
> [ 2015.044280] usb 2-1.8: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 2015.044281] usb 2-1.8: Product: WinTV
> [ 2015.044282] usb 2-1.8: Manufacturer: Hauppauge
> [ 2015.044283] usb 2-1.8: SerialNumber: 7300-00-F06D46EC
> [ 2015.045284] pvrusb2: Hardware description: WinTV HVR-1950 Model 751xx
> [ 2015.076900] pvrusb2: Binding ir_rx_z8f0811_haup to i2c address 0x71.
> [ 2015.076923] pvrusb2: Binding ir_tx_z8f0811_haup to i2c address 0x70.
> [ 2015.080360] cx25840 18-0044: cx25843-24 found @ 0x88 (pvrusb2_a)
> [ 2015.090343] pvrusb2: Attached sub-driver cx25840
> [ 2015.093836] tuner 18-0042: Tuner -1 found with type(s) Radio TV.
> [ 2015.093839] pvrusb2: Attached sub-driver tuner
> [ 2017.248125] cx25840 18-0044: loaded v4l-cx25840.fw firmware (16382 bytes)
> [ 2017.344020] tveeprom 18-00a2: Hauppauge model 75111, rev D1F5,
> serial# 7161580
> [ 2017.344023] tveeprom 18-00a2: MAC address is 00:0d:fe:6d:46:ec
> [ 2017.344025] tveeprom 18-00a2: tuner model is NXP 18271C2 (idx 155, type 54)
> [ 2017.344026] tveeprom 18-00a2: TV standards NTSC(M) ATSC/DVB Digital
> (eeprom 0x88)
> [ 2017.344027] tveeprom 18-00a2: audio processor is CX25843 (idx 37)
> [ 2017.344029] tveeprom 18-00a2: decoder processor is CX25843 (idx 30)
> [ 2017.344030] tveeprom 18-00a2: has radio, has IR receiver, has IR transmitter
> [ 2017.344033] pvrusb2: Supported video standard(s) reported available
> in hardware: PAL-M/N/Nc;NTSC-M/Mj/Mk;ATSC-8VSB/16VSB
> [ 2017.344036] pvrusb2: Mapping standards mask=0x300b700
> (PAL-M/N/Nc;NTSC-M/Mj/Mk;ATSC-8VSB/16VSB)
> [ 2017.344037] pvrusb2: Setting up 6 unique standard(s)
> [ 2017.344039] pvrusb2: Set up standard idx=0 name=PAL-M
> [ 2017.344040] pvrusb2: Set up standard idx=1 name=PAL-N
> [ 2017.344041] pvrusb2: Set up standard idx=2 name=PAL-Nc
> [ 2017.344042] pvrusb2: Set up standard idx=3 name=NTSC-M
> [ 2017.344043] pvrusb2: Set up standard idx=4 name=NTSC-Mj
> [ 2017.344044] pvrusb2: Set up standard idx=5 name=NTSC-Mk
> [ 2017.344046] pvrusb2: Initial video standard (determined by device
> type): NTSC-M
> [ 2017.344052] pvrusb2: Device initialization completed successfully.
> [ 2017.344199] pvrusb2: registered device video0 [mpeg]
> [ 2017.344201] DVB: registering new adapter (pvrusb2-dvb)
> [ 2019.548234] cx25840 18-0044: loaded v4l-cx25840.fw firmware (16382 bytes)
> [ 2019.656766] tda829x 18-0042: setting tuner address to 60
> [ 2019.678622] tda18271 18-0060: creating new instance
> [ 2019.708716] TDA18271HD/C2 detected @ 18-0060
> [ 2020.526880] tda18271: performing RF tracking filter calibration
> [ 2031.884937] tda18271: RF tracking filter calibration complete
> [ 2031.920777] tda829x 18-0042: type set to tda8295+18271
> [ 2034.450550] pvrusb2: failed to grab control of dtv input (code=-1)
> [ 2034.450553] pvrusb2: unregistering DVB devices
> _______________________________________________
> pvrusb2 mailing list
> pvrusb2 at isely.net
> http://www.isely.net/cgi-bin/mailman/listinfo/pvrusb2
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8


More information about the pvrusb2 mailing list