* Re: Afatech AF9013 [not found] <CAATJ+fu5JqVmyY=zJn_CM_Eusst_YWKG2B2MAuu5fqELYYsYqA@mail.gmail.com> @ 2011-08-21 1:51 ` Jason Hecker 2011-08-21 15:06 ` Josu Lazkano 2011-08-21 18:00 ` Malcolm Priestley 0 siblings, 2 replies; 11+ messages in thread From: Jason Hecker @ 2011-08-21 1:51 UTC (permalink / raw) To: linux-media I have a problem that may be related to the issues on this thread and it's driving me nuts. I have two dual tuner Afatech based cards, they are both Leadtek 2000DS cards, one made by Leadtek and the other branded as KWorld but they are otherwise identical in spite of different VID:PID. On each card tuner A is an AF9015 and tuner B is an AF9013. The KWorld card worked just fine for about 18 months in Mythbuntu 10.04 with the rebuilt and patched modules as described in the Wiki entry on the 2000DS. A few weeks ago tuner A started giving errors making the viewing unwatchable so figuring the card had died I bought the Leadtek. To my surprise it gave the same problem as the KWorld when using tuner A. It seems Tuner A is OK until Tuner B is used and then Tuner A gets a lot of errors. Tuner B never has errors. I did try using the latest "media_build" from V4L but that didn't help. So, I installed Mythbuntu 11.04 and with both cards I still get the same problem. Watching live TV with MythTV or with mplayer on tuner A gives errors and tuner B is always flawless even with "media_build" updates. I honestly can't recall if when the failure first occurred if I had done a routine kernel update at that time - though it would have just been the usual 2.6.32 update that is in line with 10.04 maintenance. I have tried everything imaginable to nail down the problem but can't seem to fix it. Even "options dvb-usb force_pid_filter_usage=1" seems to improve the problem somewhat but the errors are still there. I have tried every firmware from 4.65 to 5.10, adjusting the PCI latency from 32 to 96, fed each card directly from the antenna (taking the splitter out of the loop), one card fitted, both cards fitted, kernel and system upgrades (Mythbuntu 10.04 to 11.04), mplayer vs MythTV but the results are always the same. Tuner B is perfect, tuner A corrupts when Tuner B is used. There are no errors or warnings in syslog or dmesg to suggest anything has failed. I'd appreciate any suggestions at this point as I am pretty unhappy with the situation considering it *used* to work. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Afatech AF9013 2011-08-21 1:51 ` Afatech AF9013 Jason Hecker @ 2011-08-21 15:06 ` Josu Lazkano 2011-08-21 18:00 ` Malcolm Priestley 1 sibling, 0 replies; 11+ messages in thread From: Josu Lazkano @ 2011-08-21 15:06 UTC (permalink / raw) To: Jason Hecker; +Cc: linux-media Hello again, thanks Jason for your reply. It is interesting to ear that is not just my problem. I add the dual device on a laptop with same kernel 2.6.32. It works well, both tuners working great with no pixeled images. Two weeks ago, I must change my HTPC power supply, a 300W PFC. I had some problems when connecting a 2,5 USB drive (it use to shutdown). On the local shop they test it and there are more than 5V on the USB, so they change it. How can I test the USB? Is there any USB debug tool? I don't know how to continue with this, thanks for all your help, best regards. 2011/8/21 Jason Hecker <jwhecker@gmail.com>: > I have a problem that may be related to the issues on this thread and > it's driving me nuts. > > I have two dual tuner Afatech based cards, they are both Leadtek > 2000DS cards, one made by Leadtek and the other branded as KWorld but > they are otherwise identical in spite of different VID:PID. > > On each card tuner A is an AF9015 and tuner B is an AF9013. The > KWorld card worked just fine for about 18 months in Mythbuntu 10.04 > with the rebuilt and patched modules as described in the Wiki entry on > the 2000DS. A few weeks ago tuner A started giving errors making the > viewing unwatchable so figuring the card had died I bought the > Leadtek. To my surprise it gave the same problem as the KWorld when > using tuner A. It seems Tuner A is OK until Tuner B is used and then > Tuner A gets a lot of errors. Tuner B never has errors. I did try > using the latest "media_build" from V4L but that didn't help. > > So, I installed Mythbuntu 11.04 and with both cards I > still get the same problem. Watching live TV with MythTV or with > mplayer on tuner A gives errors and tuner B is always flawless even > with "media_build" updates. > > I honestly can't recall if when the failure first occurred if I had > done a routine kernel update at that time - though it would have just > been the usual 2.6.32 update that is in line with 10.04 maintenance. > > I have tried everything imaginable to nail down the problem but can't > seem to fix it. Even "options dvb-usb force_pid_filter_usage=1" seems > to improve the problem somewhat but the errors are still there. I > have tried every firmware from 4.65 to 5.10, adjusting the PCI latency > from 32 to 96, fed each card directly from the antenna (taking the > splitter out of the loop), one card fitted, both cards fitted, kernel > and system upgrades (Mythbuntu 10.04 to 11.04), mplayer vs MythTV but > the results are always the same. Tuner B is perfect, tuner A > corrupts when Tuner B is used. There are no errors or warnings in > syslog or dmesg to > suggest anything has failed. > > I'd appreciate any suggestions at this point as I am pretty unhappy > with the situation considering it *used* to work. > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Josu Lazkano ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Afatech AF9013 2011-08-21 1:51 ` Afatech AF9013 Jason Hecker 2011-08-21 15:06 ` Josu Lazkano @ 2011-08-21 18:00 ` Malcolm Priestley 2011-08-22 2:05 ` Jason Hecker 1 sibling, 1 reply; 11+ messages in thread From: Malcolm Priestley @ 2011-08-21 18:00 UTC (permalink / raw) To: Jason Hecker; +Cc: linux-media On Sun, 2011-08-21 at 11:51 +1000, Jason Hecker wrote: > I have tried everything imaginable to nail down the problem but can't > seem to fix it. Even "options dvb-usb force_pid_filter_usage=1" seems > to improve the problem somewhat but the errors are still there. I > have tried every firmware from 4.65 to 5.10, adjusting the PCI latency > from 32 to 96, fed each card directly from the antenna (taking the > splitter out of the loop), one card fitted, both cards fitted, kernel > and system upgrades (Mythbuntu 10.04 to 11.04), mplayer vs MythTV but > the results are always the same. Tuner B is perfect, tuner A > corrupts when Tuner B is used. There are no errors or warnings in > syslog or dmesg to > suggest anything has failed. I think there is a BUG, where on some systems, the frontends become swapped between kernels 2.6.35 and 2.6.38 on dual tuners. I haven't fully investigated the cause, but I think it's to do with applying a later build of dvb-usb to an earlier kernel. So, Tuner B on 2.6.38(11.04) is the old Tuner A. Regards Malcolm ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Afatech AF9013 2011-08-21 18:00 ` Malcolm Priestley @ 2011-08-22 2:05 ` Jason Hecker 2011-08-22 12:01 ` Josu Lazkano 0 siblings, 1 reply; 11+ messages in thread From: Jason Hecker @ 2011-08-22 2:05 UTC (permalink / raw) To: Malcolm Priestley; +Cc: linux-media I just tried LiveCDs of Mythbuntu 10.04 and 10.10 but had limited luck with the former and some joy with the latter. Unfortunately the default framebuffer slowed things down. Anyway in LiveCD 10.10 I used mplayer to set up and view Tuner A and Tuner B and Tuner A only showed some slight errors when Tuner B was being set up. After that for some strange reason attempt at retuning with mplayer failed utterly so I suspect there is some problems with the older versions of mplayer. These cards have blue LEDs for each tuner and light up when in use. I did notice in my testing that the LED on tuner A would flicker off briefly (and presumably issue the errors) when Tuner B was being set up. I am wondering if there is a general setup problem or even a I2S timing problem. Could someone contact me off list about sending me the data sheets for the AF901x chips? ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Afatech AF9013 2011-08-22 2:05 ` Jason Hecker @ 2011-08-22 12:01 ` Josu Lazkano 2011-08-23 0:59 ` Jason Hecker 0 siblings, 1 reply; 11+ messages in thread From: Josu Lazkano @ 2011-08-22 12:01 UTC (permalink / raw) To: Jason Hecker; +Cc: Malcolm Priestley, linux-media 2011/8/22 Jason Hecker <jwhecker@gmail.com>: > I just tried LiveCDs of Mythbuntu 10.04 and 10.10 but had limited luck > with the former and some joy with the latter. Unfortunately the > default framebuffer slowed things down. Anyway in LiveCD 10.10 I used > mplayer to set up and view Tuner A and Tuner B and Tuner A only showed > some slight errors when Tuner B was being set up. After that for some > strange reason attempt at retuning with mplayer failed utterly so I > suspect there is some problems with the older versions of mplayer. > > These cards have blue LEDs for each tuner and light up when in use. I > did notice in my testing that the LED on tuner A would flicker off > briefly (and presumably issue the errors) when Tuner B was being set > up. I am wondering if there is a general setup problem or even a I2S > timing problem. Could someone contact me off list about sending me > the data sheets for the AF901x chips? > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Hello again, yesterday I try to connect the KWorld USB Dual DVB-T TV Stick (DVB-T 399U) on my HTPC, I start MythTV and both tuners were working great, I could record a channel and watch an other one, both HD. But 2 hours later they start to watch bad, with pixeled images: http://dl.dropbox.com/u/1541853/kworld.3gp I don't know what happens with this tuner. I have two identical ones and both have same issues. I could share a SSH root access to everyone that want to test the tuner. I will install a fresh Debian Squeeze on my laptop and give full access to the machine. Anyone interested? I don't know what else to try with it. Thanks and best regards. -- Josu Lazkano ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Afatech AF9013 2011-08-22 12:01 ` Josu Lazkano @ 2011-08-23 0:59 ` Jason Hecker 2011-08-23 1:47 ` Jason Hecker 0 siblings, 1 reply; 11+ messages in thread From: Jason Hecker @ 2011-08-23 0:59 UTC (permalink / raw) To: Josu Lazkano; +Cc: Malcolm Priestley, linux-media I might have found one bug so far with the Afa9013 driver. As part of refactoring the code in http://git.linuxtv.org/linux-2.6.git/commitdiff/edb709b61abd3ba475e59d1ad81aab21ad025db6 I think one of the u32->u8 calculations is wrong. The think the second last u32 in the tables has to be changed. Here is the diff. I will try it later as I have run out of time to test it this morning. This may not fix the problems we are having but it might help... So patch the file af9013_priv.h with this in the latest git media_build and see what happens. I'll report back later with my results. af9013_priv.h.diff <snip>------------------------------ 74c74 < 0x29, 0x03, 0x5d, 0x7a, 0xec, 0x01, 0x45, 0x14, 0x14 } }, --- > 0x29, 0x00, 0xa2, 0x85, 0x14, 0x01, 0x45, 0x14, 0x14 } }, 77c77 < 0xe4, 0x03, 0x71, 0xcb, 0xe8, 0x01, 0x1c, 0x71, 0x32 } }, --- > 0xe4, 0x00, 0x8e, 0x34, 0x72, 0x01, 0x1c, 0x71, 0x32 } }, 80c80 < 0x9e, 0x03, 0x86, 0x1c, 0x31, 0x00, 0xf3, 0xcf, 0x0f } }, --- > 0x9e, 0x00, 0x79, 0xe3, 0xcf, 0x00, 0xf3, 0xcf, 0x0f } }, 84c84 < 0x49, 0x03, 0x1b, 0x74, 0xdb, 0x01, 0xc9, 0x24, 0x25 } }, --- > 0x49, 0x00, 0xe4, 0x8b, 0x25, 0x01, 0xc9, 0x24, 0x25 } }, 87c87 < 0x00, 0x03, 0x38, 0x06, 0x40, 0x01, 0x90, 0x00, 0x00 } }, --- > 0x00, 0x00, 0xc7, 0xf9, 0xc0, 0x01, 0x90, 0x00, 0x00 } }, 90c90 < 0xb7, 0x03, 0x54, 0x97, 0xa4, 0x01, 0x56, 0xdb, 0x1c } }, --- > 0xb7, 0x00, 0xab, 0x68, 0x5c, 0x01, 0x56, 0xdb, 0x1c } }, 94c94 < 0x05, 0x03, 0x58, 0xd6, 0x34, 0x01, 0x4e, 0x5e, 0x03 } }, --- > 0x05, 0x00, 0xa7, 0x29, 0xcc, 0x01, 0x4e, 0x5e, 0x03 } }, 97c97 < 0x25, 0x03, 0x6d, 0xbb, 0x6e, 0x01, 0x24, 0x92, 0x12 } }, --- > 0x25, 0x00, 0x92, 0x44, 0x92, 0x01, 0x24, 0x92, 0x12 } }, 100c100 < 0x44, 0x03, 0x82, 0xa0, 0xa7, 0x00, 0xfa, 0xc6, 0x22 } }, --- > 0x44, 0x00, 0x7d, 0x5f, 0x59, 0x00, 0xfa, 0xc6, 0x22 } }, 104c104 < 0xe7, 0x03, 0x44, 0xc6, 0xf3, 0x01, 0x76, 0x7d, 0x34 } }, --- > 0xe7, 0x00, 0xbb, 0x39, 0x0d, 0x01, 0x76, 0x7d, 0x34 } }, 107c107 < 0x0a, 0x03, 0x5c, 0x2e, 0x14, 0x01, 0x47, 0xae, 0x05 } }, --- > 0x0a, 0x00, 0xa3, 0xd1, 0xec, 0x01, 0x47, 0xae, 0x05 } }, 110c110 < 0x2d, 0x03, 0x73, 0x95, 0x36, 0x01, 0x18, 0xde, 0x17 } }, --- > 0x2d, 0x00, 0x8c, 0x6a, 0xca, 0x01, 0x18, 0xde, 0x17 } }, ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Afatech AF9013 2011-08-23 0:59 ` Jason Hecker @ 2011-08-23 1:47 ` Jason Hecker 2011-08-23 21:43 ` [PATCH] Re: Afatech AF9013 [TEST ONLY] AF9015 stream buffer size aligned with max packet size Malcolm Priestley 2011-08-29 18:40 ` Afatech AF9013 Josu Lazkano 0 siblings, 2 replies; 11+ messages in thread From: Jason Hecker @ 2011-08-23 1:47 UTC (permalink / raw) To: Josu Lazkano; +Cc: Malcolm Priestley, linux-media Damn, this patch didn't help so maybe forget this patch. Tuner A is still messed up. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] Re: Afatech AF9013 [TEST ONLY] AF9015 stream buffer size aligned with max packet size. 2011-08-23 1:47 ` Jason Hecker @ 2011-08-23 21:43 ` Malcolm Priestley 2011-08-23 22:29 ` Jason Hecker 2011-08-29 18:40 ` Afatech AF9013 Josu Lazkano 1 sibling, 1 reply; 11+ messages in thread From: Malcolm Priestley @ 2011-08-23 21:43 UTC (permalink / raw) To: Jason Hecker; +Cc: Josu Lazkano, linux-media On Tue, 2011-08-23 at 11:47 +1000, Jason Hecker wrote: > Damn, this patch didn't help so maybe forget this patch. Tuner A is > still messed up. Try this patch, applied to the latest media_build. it aligns buffer size to the max packet size instead of TS packet size. I think what might happening is that TS packets are getting chopped, as device seems to want to align to max packet size. Afatech seem to want create rather large buffers at considerable delay. The size of the buffer has also been considerably reduced. If you want to increase it change TS_USB20_PACKET_COUNT in multiplies of 2 (56 ... 112). --- drivers/media/dvb/dvb-usb/af9015.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index d7ad05f..eaf0800 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c @@ -404,21 +404,22 @@ static int af9015_init_endpoint(struct dvb_usb_device *d) We use smaller - about 1/4 from the original, 5 and 87. */ #define TS_PACKET_SIZE 188 -#define TS_USB20_PACKET_COUNT 87 -#define TS_USB20_FRAME_SIZE (TS_PACKET_SIZE*TS_USB20_PACKET_COUNT) - #define TS_USB11_PACKET_COUNT 5 #define TS_USB11_FRAME_SIZE (TS_PACKET_SIZE*TS_USB11_PACKET_COUNT) -#define TS_USB20_MAX_PACKET_SIZE 512 +#define TS_USB20_MAX_PACKET_SIZE 128 #define TS_USB11_MAX_PACKET_SIZE 64 +#define TS_USB20_PACKET_COUNT 28 +#define TS_USB20_FRAME_SIZE (TS_USB20_MAX_PACKET_SIZE\ + *TS_USB20_PACKET_COUNT) + if (d->udev->speed == USB_SPEED_FULL) { frame_size = TS_USB11_FRAME_SIZE/4; packet_size = TS_USB11_MAX_PACKET_SIZE/4; } else { - frame_size = TS_USB20_FRAME_SIZE/4; - packet_size = TS_USB20_MAX_PACKET_SIZE/4; + frame_size = TS_USB20_FRAME_SIZE; + packet_size = TS_USB20_MAX_PACKET_SIZE; } ret = af9015_set_reg_bit(d, 0xd507, 2); /* assert EP4 reset */ -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] Re: Afatech AF9013 [TEST ONLY] AF9015 stream buffer size aligned with max packet size. 2011-08-23 21:43 ` [PATCH] Re: Afatech AF9013 [TEST ONLY] AF9015 stream buffer size aligned with max packet size Malcolm Priestley @ 2011-08-23 22:29 ` Jason Hecker 0 siblings, 0 replies; 11+ messages in thread From: Jason Hecker @ 2011-08-23 22:29 UTC (permalink / raw) To: Malcolm Priestley; +Cc: Josu Lazkano, linux-media > I think what might happening is that TS packets are getting chopped, as device seems to want > to align to max packet size. Oh, I also noticed that the Linux driver uses a smaller USB packet count than Windows. Is there any discernible reason for this? Lag on DVB isn't an issue for me and probably everyone else due to the stream going to secondary storage first. Great, I'll try it out later. I have been studying the source code and noticed that the bus locking mechanism is TODOed and may be part of the problem. My symptom is that Tuner A fails when Tuner B is started and I have a theory that somehow the TDA18271 is getting some I2C data and being corrupted because of a gating problem with the I2C signal. The TDA18271 can change the last 2 bits of it's default I2C address by setting a voltage on its AS pin (presumably with resistor dividers) but I haven't delved in to determine if this what Leadtek have done - both tuners might be set to address 0xC0. I can only truly test this by putting CRO probe on and seeing if the I2C is going down the wrong path at the wrong time. I just wish ITE/Afa would release their data sheet to the public and make it as detailed and USEFUL as the TDA18271 data sheet. This obfuscation, need for NDAs and a half arsed data sheet and bloody sniffing Windows USB transactions for programming clues is such a waste of time and I fail to see how it benefits ITE to do this. The Afatech chips are 4+ years old anyway - what's the problem? If anyone wants to send me the data sheets and more importantly the DESIGN MANUAL from the devkit I'd be most grateful. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Afatech AF9013 2011-08-23 1:47 ` Jason Hecker 2011-08-23 21:43 ` [PATCH] Re: Afatech AF9013 [TEST ONLY] AF9015 stream buffer size aligned with max packet size Malcolm Priestley @ 2011-08-29 18:40 ` Josu Lazkano 2011-08-30 23:31 ` Malcolm Priestley 1 sibling, 1 reply; 11+ messages in thread From: Josu Lazkano @ 2011-08-29 18:40 UTC (permalink / raw) To: Jason Hecker; +Cc: Malcolm Priestley, linux-media 2011/8/23 Jason Hecker <jwhecker@gmail.com>: > Damn, this patch didn't help so maybe forget this patch. Tuner A is > still messed up. > Hello, thanks all to reply this post. I have no idea how to apply the patch on my Debian Squeeze. Can you help to apply the patch? Thanks your all your help. Best regards. -- Josu Lazkano ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Afatech AF9013 2011-08-29 18:40 ` Afatech AF9013 Josu Lazkano @ 2011-08-30 23:31 ` Malcolm Priestley 0 siblings, 0 replies; 11+ messages in thread From: Malcolm Priestley @ 2011-08-30 23:31 UTC (permalink / raw) To: Josu Lazkano; +Cc: Jason Hecker, linux-media On Mon, 2011-08-29 at 20:40 +0200, Josu Lazkano wrote: > 2011/8/23 Jason Hecker <jwhecker@gmail.com>: > > Damn, this patch didn't help so maybe forget this patch. Tuner A is > > still messed up. > > > > Hello, thanks all to reply this post. I have no idea how to apply the > patch on my Debian Squeeze. Can you help to apply the patch? > > Thanks your all your help. It is best applied using media_build and using a copy from the patchwork server. You can just copy the raw email to a text file, but sometimes it is malformed. Since you originally used s2-liplianin you just need patchutils to apply it to that. However, since it is older, I doubt it will apply cleanly. https://patchwork.kernel.org/patch/1090012/ For media build, check if the required packages for Debian Squeeze are the same as Ubuntu. But, it appears the patch makes no difference. Regards Malcolm MEDIA BUILD INSTALL (Instructions here are for Ubuntu) Using Terminal install git, patchutils and perl with sudo apt-get install git(or git-core) sudo apt-get install patchutils sudo apt-get install libdigest-sha1-perl sudo apt-get install libproc-processtable-perl Always build somewhere in your home directory with local user rights. Only use super user rights to install. git clone git://linuxtv.org/media_build.git cd media_build ---NO PATCH--- ./build sudo make install ---PATCH TO BE APPLIED--- Download any patch and place in the media_build directory and apply in the following way. ./build (skip this if already built) Wait for download and start to build. If you are confident that the build will complete without errors break the build with <CTRL> C Apply the patch. Make sure if applying multipliable patches they are applied oldest first. Just test the patch. patch -d linux -p1 --dry-run < the_patch_name.patch If okay apply it. patch -d linux -p1 < the_patch_name.patch make distclean make sudo make install More in depth instructions here http://www.linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-08-30 23:35 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAATJ+fu5JqVmyY=zJn_CM_Eusst_YWKG2B2MAuu5fqELYYsYqA@mail.gmail.com>
2011-08-21 1:51 ` Afatech AF9013 Jason Hecker
2011-08-21 15:06 ` Josu Lazkano
2011-08-21 18:00 ` Malcolm Priestley
2011-08-22 2:05 ` Jason Hecker
2011-08-22 12:01 ` Josu Lazkano
2011-08-23 0:59 ` Jason Hecker
2011-08-23 1:47 ` Jason Hecker
2011-08-23 21:43 ` [PATCH] Re: Afatech AF9013 [TEST ONLY] AF9015 stream buffer size aligned with max packet size Malcolm Priestley
2011-08-23 22:29 ` Jason Hecker
2011-08-29 18:40 ` Afatech AF9013 Josu Lazkano
2011-08-30 23:31 ` Malcolm Priestley
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox