Bug 745456

Summary: Systemd launch mythbackend too fast (before the initiatlisation of the firmware).
Product: [openSUSE] openSUSE 12.1 Reporter: q l <9700pro2>
Component: BasesystemAssignee: E-mail List <bnc-team-screening>
Status: VERIFIED NORESPONSE QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: fcrozat
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 12.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description q l 2012-02-06 22:38:03 UTC
User-Agent:       Opera/9.80 (X11; Linux x86_64; U; fr) Presto/2.10.229 Version/11.60

Hello, i have got a tv card asus Asus My Cinema P7131-Hybrid.

This card like somes, need a firmware dvb-fe-tda10046.

With openSuse 11.4 all was alright.

After the update to the 12.1 all goes wrong. 


In fact with systemD the system lauch a lot of things in the same time, the result is that mythbackend is launched before the initialisation of the firmware (or in the sametime but it finish before the initialisation of the tv card). The result is that the tv card could not be use.

And in dmesg i see:
tda1004x: setting up plls for 48MHz sampling clock
tda1004x: timeout waiting for DSP ready
tda1004x: found firmware revision 0 -- invalid
tda1004x: trying to boot from eeprom
tda1004x: timeout waiting for DSP ready
tda1004x: found firmware revision 0 -- invalid
tda1004x: waiting for firmware upload...

Like if there is no firmware.

If in yast i disable the mythtvbackend service. Then boot. It allways work, the firmware is always launched like before. 

If i start after that the mythbackend service it works! So it confirm that it's mythbackend that lock the card before the initialisation of the card.

Reproducible: Always

Steps to Reproduce:
1. use a tv card that use a firmware
2. use myththbackend
3. Stop the computer (it works some times before reboot that depend but never on cold start)
4. try to use the tuner, it's not possible
Actual Results:  
The tv card is unsuable as the card is locked by mythbackend before the initialisation, and modeprobe -r and co does not solve this problem

Expected Results:  
mythtvservice should start after a time (like 30s or more) or after the launch of the firmware if it's possible to wait that

I have found a solution to workaround that

I have add a sleep 30 in the init script of mythbackend (/etc/init.d/mythbackend in the start option).

And it works now. But it's not a safe option. Is there any solution to wait until the firmware of the tv card is loaded before to launch the mythbackend service?
Comment 1 Frederic Crozat 2012-02-08 09:45:02 UTC
this is because we don't wait for udev events to settle (it is usually not needed).

Either mythtvbackend should listen to udev events and reacts when the dvr card become available (correct solution) or .service should be written for mythbackend and have a dependency on udev-settle.service.
Comment 2 q l 2012-02-11 08:46:06 UTC
And how to do that? Will it be a solution or should i contact someone else?
Comment 3 Frederic Crozat 2012-02-13 09:59:19 UTC
ask mythtv maintainer, first..
Comment 4 Kun Kun Zhang 2012-03-09 13:16:59 UTC
Long time no response.So closed.Feel free to reopen it.Thanks.