LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-30-2021, 07:29 PM   #16
critola
LQ Newbie
 
Registered: Sep 2021
Posts: 5

Rep: Reputation: Disabled
Lightbulb More progress


Quote:
Originally Posted by tom55 View Post
it happens only when USALS positioner (maybe even some other equipment but i have nothing else to try) is in-between tuner and LNB. cannot be overcurrent because:

1. LNB consume about 2W at 13V and 3W at 18V (power from wall pulled by small adapter that comes in box), and positioner can pull up to 8W when driving at high speed
2. only first time after "cold boot" (e.g. plugging in the card into USB port) this happens, but if you tune 13V first and shut it down then it will tune fine at 18V

i think better solution that should not sacrifice tuning speed would be to just make the driver tune to V pol first after loading for few hundred ms (as much as needed for stable operation) and then sets the tuner to idle. afterwards, everything will be fine from userspace, no matter which polarization is being tuned

edit: i tried the patch you sent to mailing list, it fixes the problem, but not entirely - sometimes there will be no data received e.g. black screen, and again - only reconnect the USB helps. when this happens the power draw is the same as when it works fine. surprisingly, there is no any delay in tuning speed that could be considered as a regression (windows drivers take more than bloody 30 seconds to init the card)

update: used patch from mailing list now, the solution is acceptable, no problems observed with tuning
The patch I submitted uses a faster slew rate than the code I posted earlier in this thread, deliberately to avoid a perceptible delay in tuning. The code above might help if the problem still lingers as it waits a longer time.

Is it looking like it is 100% reliable now? If there are still random issues, try quadrupling the slew time in the patch (drivers/media/usb/em28xx/em28xx-dvb.c) where it says:
Code:
 a8293_pdata.volt_slew_nanos_per_mv = 20;
... increase to about 80 so it says:
Code:
 a8293_pdata.volt_slew_nanos_per_mv = 80;
If this fixes lingering issues please let me know. If there were no issues disregard this suggestion.

I never used the 461e in Windows but the drivers taking an order of 30sec to init sounds rough. Makes me wonder if it is trying to energize your downlead, detecting the bit-7 flag (vIN undervoltage), and retrying every 2s until it gives up.

Tried your suggestion by adding the following to an unmodified kernel
to drivers/media/usb/em28xx/em28xx-dvb.c in unmodified kernel,
at function em28178_dvb_init_pctv_461e(...)
Code:
/* Init by pulling to 13V for a moment then back to 0V */
	dvb->fe[0]->ops.set_voltage(dvb->fe[0], SEC_VOLTAGE_13);
	usleep_range(1000000, 1500000);/*Wait 1-1.5s*/
	dvb->fe[0]->ops.set_voltage(dvb->fe[0], SEC_VOLTAGE_OFF);
... just before the `return 0` line.

It did not fix the issue for me. After a reset,
Code:
tuned 0->13V -Works
quit so it is back to 0V
quickly tuned 0->18V -Works
quit so it is back to 0V
waited at least 5 minutes
tuned 0->18V -Doesn't work, bad state, needs reset.
... so the working state caused by going from 0->13V does not linger for long. It sounds like a capacitor somewhere is holding a charge between tunings. Once it loses the charge it's like a fresh boot and the issue returns unless it can be reset then charged again with 0->13V. This is probably why plugging it into a windows machine then moving it over to linux seemed to make it work right for a limited time.

Though the rated wattage draw is within the range of the power supply, does that take into account the inrush current when first energizing the downlead and whatever capacitance is on all the equipment on said downlead?

My current hyptothesis is that there are capacitors inside the 461e's power supply for its boost converters, plus capacitors in the downlead at the USALS rotor and maybe even in the LNB which draw heavy inrush current on powerup. The power system inside the dongle cannot keep up, the voltage sags, and trips vIN undervoltage error. I tried a bigger power supply and it didn't help. Apparently the current still isn't enough to trip the OCP bit. When the dongle is powered up alone it is ok, then when it energizes the downlead it is ok as well. Guess everything at once is too much for it.

Before the patch(es) posted, there were some intermediary experiments I did:
* Step-increase with each tuning 0->13->18V in the driver module. This worked and was the predecessor with the code posted above, which itself was the predecessor to the code submitted to the kernel list.
* Turn the LNB off, set the voltage, wait a short time, turn the LNB on. This only worked 50/50 randomly.
* Use all voltages supported by the a8293 and calculate an adjustable slew rate to make the transition as smooth as possible - this is what the newest version does.
* An earlier version printed the a8293 error states from its status register. That is how I was able to detect that the failure was caused by vIN undervoltage being thrown (bit 7, register 1), which then puts the frontend in a disabled error state unless the status register is read again, which the driver does not do.

Quote:
Originally Posted by Kjeld Flarup View Post
Thanks, that saved me a lot. I may try out the kernel patch after New Year. I moved the receiver to a Raspberry Pi, with LibreELEC, making it easier to experiment.

Did You upstream the patch?
I submitted a patch but it had some minor issues to be fixed.

Have been holding off a little bit to make sure it is working for other users but it's probably getting time for me to do it already.

A side-note: If your distro has it, the
Code:
usbreset
command is helpful at getting the 461e back to life if it goes in a bad state w/o physically unplugging - though a forewarning it generally doesn't cause new kernel module changes to take effect. That's best done with a reboot.

Last edited by critola; 12-30-2021 at 07:37 PM. Reason: Typo
 
Old 01-13-2022, 03:56 PM   #17
tom55
LQ Newbie
 
Registered: Dec 2021
Posts: 3

Rep: Reputation: Disabled
Quote:
Originally Posted by critola View Post
If there were no issues disregard this suggestion.
i think that the issues were caused by new app i tested, neumodvb

Quote:
Originally Posted by critola View Post
I never used the 461e in Windows but the drivers taking an order of 30sec to init sounds rough. Makes me wonder if it is trying to energize your downlead, detecting the bit-7 flag (vIN undervoltage), and retrying every 2s until it gives up.
i used driver from 2013. at first on win10 and don't remember it was taking that long to init. but i do remember there were problems tuning H pol
now i run it on win7 with drivers from 2020. init is long, but there are no more tuning problems, and dish rotating works as expected on both pol.

Quote:
Originally Posted by critola View Post
Tried your suggestion by adding the following to an unmodified kernel
to drivers/media/usb/em28xx/em28xx-dvb.c in unmodified kernel,
at function em28178_dvb_init_pctv_461e(...)
Code:
/* Init by pulling to 13V for a moment then back to 0V */
	dvb->fe[0]->ops.set_voltage(dvb->fe[0], SEC_VOLTAGE_13);
	usleep_range(1000000, 1500000);/*Wait 1-1.5s*/
	dvb->fe[0]->ops.set_voltage(dvb->fe[0], SEC_VOLTAGE_OFF);
... just before the `return 0` line.

It did not fix the issue for me. After a reset,
Code:
tuned 0->13V -Works
quit so it is back to 0V
quickly tuned 0->18V -Works
quit so it is back to 0V
waited at least 5 minutes
tuned 0->18V -Doesn't work, bad state, needs reset.
... so the working state caused by going from 0->13V does not linger for long. It sounds like a capacitor somewhere is holding a charge between tunings. Once it loses the charge it's like a fresh boot and the issue returns unless it can be reset then charged again with 0->13V. This is probably why plugging it into a windows machine then moving it over to linux seemed to make it work right for a limited time.
so, while testing this neumodvb app i observed something similar:
if only tuned V pol (but not started streaming) and then closed the app and restarted, trying to tune H pol sometimes worked and sometimes caused undervoltage
it appears the card has to tune V pol first and utilize everything in the chain; tuner, demod, usb-bridge for at least a second. then after restart tuning H pol works

at least this is how i've been operating it on a openwrt router for the past year or so. with only one tune to V pol and streaming a second of data via tvheadend, i could close stream and tune H pol without issues hours later

Quote:
Originally Posted by critola View Post
Though the rated wattage draw is within the range of the power supply, does that take into account the inrush current when first energizing the downlead and whatever capacitance is on all the equipment on said downlead?

My current hyptothesis is that there are capacitors inside the 461e's power supply for its boost converters, plus capacitors in the downlead at the USALS rotor and maybe even in the LNB which draw heavy inrush current on powerup. The power system inside the dongle cannot keep up, the voltage sags, and trips vIN undervoltage error. I tried a bigger power supply and it didn't help. Apparently the current still isn't enough to trip the OCP bit. When the dongle is powered up alone it is ok, then when it energizes the downlead it is ok as well. Guess everything at once is too much for it.
bigger power supply won't help as its on the boost converter input, the problem occurs on output. if you have oscilloscope you could try to hook it up to the coax cable and see what happens. at least wall wattmeter that i use is probably too slow to catch anything like that
 
Old 01-26-2023, 07:45 AM   #18
critola
LQ Newbie
 
Registered: Sep 2021
Posts: 5

Rep: Reputation: Disabled
Patch posted

Patch was posted to upstream, and apparently accepted:
https://patchwork.linuxtv.org/projec...ola@gmail.com/
 
Old 02-24-2023, 02:28 PM   #19
critola
LQ Newbie
 
Registered: Sep 2021
Posts: 5

Rep: Reputation: Disabled
Fix is in the Linux kernel as of 6.2
 
  


Reply

Tags
dvbs, pctv



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hauppauge wintv-hvr h006 - dvb-t tuner - usb-stick - hybrid tv stick Xeratul Linux - Hardware 5 12-23-2012 09:47 AM
Pinnacle PCTV Hybrid Pro Stick 340e darkmaster977 Linux - Hardware 1 11-07-2010 04:03 AM
[SOLVED] Problems with DVB-S and a dual-band LNB Electrode Linux - Software 1 05-19-2010 12:12 PM
How to make Pinnacle PCTV Stick 72e work? linuxcbon Linux - Hardware 10 10-04-2008 10:56 AM
DVB stick loads modules, and creates /dev/dvb/adapter0+, BUT Balarabay1 Linux - Software 0 09-20-2008 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration