ch=int(channel.upper().replace("BS",""))
freq=str((ch-1)*38360/2+1049480)
return freq
-def testTune(adapter,channel):
+def testTune(adapter,channel,tsid):
my_env=recdblist.getEnv()
- tunecmd=configreader.getConfDVB("DVBtune")+u" "+adapter+u" "+channel2freq(channel)
+ #tunecmd=configreader.getConfDVB("DVBtune")+u" "+adapter+u" "+channel2freq(channel)
#p1=subprocess.Popen(tunecmd,shell=True)
- p1=subprocess.Popen([configreader.getConfDVB("DVBtune"),adapter,channel2freq(channel)],env=my_env,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+ p1=subprocess.Popen([configreader.getConfDVB("DVBtune"),adapter,channel2freq(channel),tsid,"0.2","/dev/null"],env=my_env,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
time.sleep(0.2)
try:
os.kill(p1.pid,signal.SIGKILL)
for i in chl:
chlr.append(int(i))
return chlr
-def getActiveAdapter(channel):
+def getActiveAdapter(channel,tsid="0"):
for i in getAdapter(channel):
- rt=testTune(str(i),channel)
+ rt=testTune(str(i),channel,tsid)
if rt==1:
return str(i)
def record(channel,tsid,out,timelength,decode=0):
ft.write(u"#!/bin/bash\n/bin/cat $1 > \"$2\"")
ft.close()
os.system(u"chmod +x "+tmppath+u"rec.sh")
- adapt=getActiveAdapter(channel)
+ adapt=getActiveAdapter(channel,tsid)
my_env=recdblist.getEnv()
if adapt!=None:
tunecmd=configreader.getConfDVB("DVBtune")+u" "+adapt+u" "+channel2freq(channel)+u" "+tsid+u" "+timelength+u" "+out