Re: [vdr] external EPG data broken encoding (epg4vdr)

2008-04-26 Thread Soeren Sonnenburg
On Sat, 2008-04-19 at 11:48 +0200, Klaus Schmidinger wrote:
 On 04/16/08 14:45, Matthias Schwarzott wrote:
  On Mittwoch, 16. April 2008, Soeren Sonnenburg wrote:
  Dear List,
 
  I am desperately trying to get the german umlauts going for both vdr
  receiving EPG information (out of the air directly from the channels...)
  and via epg4vdr 0.5
  http://www.wontorra.net/article.php?story=20050429181815661
 
  I've noticed that standard EPG has the correct encoding, but only the
  one from epg4vdr has not. However the pulled .xml files still have the
  right (i.e. utf-8) encoding.
 
  Only when this information is transferred to vdr (I guess via SVDRP)
  umlauts and everything is distorted. Also then the dumped epgdata file
  contains wrongly encoded parts...
 
  Any ideas what I could do about this?
 
  I guess you need to know the encoding your vdr runs with, and then use this 
  for the SVDRP connection.
  
  
  For future VDR development I still think it could be useful to:
  1. Either add a header for epg data (and other places where vdr exchanges 
  texts) telling the encoding.
 
 The only reasonable thing IMO would be to make an SVDRP command (or extend an
 existing one) that tells which encoding is used by this VDR. Maybe an extended
 signon message would be ok, like
 
 220 video SVDRP VideoDiskRecorder 1.7.1; Sat Apr 19 11:43:27 2008; ISO-8859-1
 
 I wouldn't like to fiddle around with headers in many places.

That sounds like a good solution.

Regarding the specific epg4vdr problem: it was sufficient to 

a) put the locale to some utf8 locale
b) extract the epg4vdr archive and change the occurance of iso8859 to
utf8 for writng the xml file


Otherwise utf8 is erraneously read as iso8859-1. Also as a workaround I
wrote a small proxy that does this translation on the fly (attached).

Soeren
#!/usr/bin/env python

import SocketServer
import socket
import os
import time

src=('localhost', 2002)
dst=(localhost, 2001)

linelen=100

overflow=dict()

def read_line(f, who):
	if not overflow.has_key(f):
		overflow[f]=''
	s=overflow[f]
	while True:
		i=s.find('\n')
		if i-1:
			data=s[:(i+1)]
			overflow[f]=s[(i+1):]
			break

		d=f.recv(1024)
		if not d:
			data=s
			overflow[f]=''
			break
		s+=d

	l=len(data)
	#print '-- %s: %d %s' % (who, l, data)
	return data

def write_line(f, data, who):
	f.sendall(data)
	l=len(data)
	#print '-- %s: %d %s' % (who, l, data)

class MyClientHandler(SocketServer.BaseRequestHandler):

	def handle(self):
		#print connect from:  + `self.client_address`

		epg=self.request
		vdr=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
		vdr.connect(dst) # connecting to vdr

		while 1:
			try:
data = read_line(vdr, vdr)
if not data:
	break 
write_line(epg, data, epg4vdr)

if data.startswith('354'):
	#print sending EPG to vdr
	sending=True
	while sending:
		data = read_line(epg, epg4vdr)
		if not data or data=='.\n':
			data='.\n'
			sending=False

		cvt=data.decode('utf-8', 'ignore').encode('iso8859-1','ignore')
		write_line(vdr, cvt, vdr)
	#print -- vdr : epgs done
else:
	data = read_line(epg, epg4vdr)
	if not data:
		break 
	#print(u'' + data.decode('utf-8').encode('iso8859-1').decode('utf-8'))
	#print data.decode('utf-8').encode('iso8859-1','ignore')
	#print data.encode('utf-8')
	#print data.decode('utf-8')
	#cvt=data.decode('utf-8', 'ignore').encode('iso8859-1','ignore')
	write_line(vdr, data, vdr)
			except KeyboardInterrupt:
break

		vdr.shutdown(socket.SHUT_RDWR)
		vdr.close()
		epg.close()

# make a threaded server, listen/handle clients forever 
try:
	server = SocketServer.TCPServer(src, MyClientHandler)
	server.serve_forever()
except KeyboardInterrupt:
	server.server_close()
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] external EPG data broken encoding (epg4vdr)

2008-04-16 Thread Soeren Sonnenburg
On Wed, 2008-04-16 at 14:45 +0200, Matthias Schwarzott wrote:
 On Mittwoch, 16. April 2008, Soeren Sonnenburg wrote:
  Dear List,
 
  I am desperately trying to get the german umlauts going for both vdr
  receiving EPG information (out of the air directly from the channels...)
  and via epg4vdr 0.5
  http://www.wontorra.net/article.php?story=20050429181815661
 
  I've noticed that standard EPG has the correct encoding, but only the
  one from epg4vdr has not. However the pulled .xml files still have the
  right (i.e. utf-8) encoding.
 
  Only when this information is transferred to vdr (I guess via SVDRP)
  umlauts and everything is distorted. Also then the dumped epgdata file
  contains wrongly encoded parts...
 
  Any ideas what I could do about this?

 I guess you need to know the encoding your vdr runs with, and then use this 
 for the SVDRP connection.

Well so it is epg4vdr then that is doing some conversion internally (I
use a system wide utf-8 encoding) ...

 For future VDR development I still think it could be useful to:
 1. Either add a header for epg data (and other places where vdr exchanges 
 texts) telling the encoding.
 
 2. or switch all external interfaces (epg.data, svdrp, channels.conf) to utf8.
 
 3. going even further, switch vdr so that it internally only uses utf8 (or 
 utf16 if one can tell that is easier - I doubt). So all code that does 
 switch/case on the charset can be simplified.

I guess easiest would be to have a single encoding as a requirement,
however in a real world there are always exceptions that cause
breakage :(

Soeren

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] blacklisting channels for certain dvb cards?

2007-09-15 Thread Soeren Sonnenburg
On Fri, 2007-09-14 at 22:50 +0200, Richard Lithvall wrote:
 Soeren Sonnenburg wrote:
  Dear all,
  
  I would want to blacklist a certain channel (transponder), such that it
  vdr does not try to use a certain dvb-card on that one, e.g. I am having
  reception problems (no channel lock) on one dvb-t card for ZDF  co.
  although it works perfectly on the other dvb card. I would therefore
  just not allow vdr to use the `bad card' for ZDF ...
  
  Is this possible?
 
 Not that I know of, but the other way around - if you put the DVB-card 
 number in the CA field in channels.conf, VDR will only use that card for 
 the specific channel.

OK, for my case that still is enough, (I've put a 2 in that field to
only allow ZDF on dvb1 (though there are dvb0/dvb1/dvb2), it may even
work with more adapters if I understand the vdr manpage correctly if I
put X,Y,Z in that field (X,Y,Z being the device nr). However as dvb0 is
a dvb-c card not connected to the cable network I cannot test this...

Thanks,
Soeren
-- 
Sometimes, there's a moment as you're waking, when you become aware of
the real world around you, but you're still dreaming.

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] blacklisting channels for certain dvb cards?

2007-09-14 Thread Soeren Sonnenburg
Dear all,

I would want to blacklist a certain channel (transponder), such that it
vdr does not try to use a certain dvb-card on that one, e.g. I am having
reception problems (no channel lock) on one dvb-t card for ZDF  co.
although it works perfectly on the other dvb card. I would therefore
just not allow vdr to use the `bad card' for ZDF ...

Is this possible?

Soeren
-- 
Sometimes, there's a moment as you're waking, when you become aware of
the real world around you, but you're still dreaming.

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Dual Tuner Cards

2007-06-26 Thread Soeren Sonnenburg
On Mon, 2007-06-25 at 09:53 +0100, Alex Stansfield wrote:
 Hi,
 
 This seems like a pretty dumb question but I hadn't seen it mentioned
 before and just wanted to check.
 
 I'm looking to buy a dual tuner card, most likely the WinTV Nova-T 500.
 
 My question is, as long as the card is supported in Linux will vdr treat
 it as two dvb-t devices?

Don't buy this card if you want to use it in a permanent (i.e. vdr)
setup where your computer is on 24/7. You will notice disconnects every
now an then rendering the device rather useless...

And yes this still happens with *any* kernel version (2.6.20 - 21.5) +
even the experimental mercurial tree out there...

Soeren
-- 
Sometimes, there's a moment as you're waking, when you become aware of
the real world around you, but you're still dreaming.

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] mplayer plugin - no sound on vdr-1.4.4 ?

2007-01-07 Thread Soeren Sonnenburg
On Fri, 05 Jan 2007 23:23:54 +, VDR User wrote:

 Works fine here.  I'd suggest you double-check your settings and make sure
 something didn't get messed up somewhere.

you were right, I messed up, as I was still using 0.9.15-pre10 :/

It is working fine with 0.9.15.

Soeren



___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr