pipelka / vdr-plugin-xvdr

DISCONTINUED - XVDR Plugin for VDR
GNU General Public License v2.0
43 stars 22 forks source link

group_channels.sh sample #115

Open otto2704 opened 10 years ago

otto2704 commented 10 years ago

Hi,

this is not a bug, but dunno where to ask else... Would it be possible to get a working sample of group_channels.sh?

Tried something like:

!/bin/bash

head -130 < /dev/stdin

But when loading I get: XVDR: Loading 2480 channels from cache

So - as a not really good workaround - I cut down channels.conf and changed vdr config to not update channels.

A sample script would be useful...

Thanks in advance and thanks for yor awesome work!

Otto

AndreyPavlenko commented 10 years ago

I use this https://github.com/AndreyPavlenko/chorder template based script.

otto2704 commented 10 years ago

Hi, thanks a lot! But this is quite a BIG canon ^^ Could you be so kind and post an EASY sample just to understand how piping is supposed to be done? For me it would be enough to have the first n lines of channels.conf handed to the clients. This way new channels would be added to channels.conf by vdr and the pretty weak raspberry pi client still could handle things fast enough... thanks in advance and best regards, Otto

AndreyPavlenko commented 10 years ago

It's assumed that the command reads the channels.conf from stdin and writes reordered channels to stdout. Try this:

ReorderCmd = head -3

otto2704 commented 10 years ago

Thank you! This was EXACTLY what I was looking for! Now I can leave vdr adding new channels while using xbmc performantly on my raspi :-)

Cheers,

Otto

otto2704 commented 10 years ago

Somehow this worked only once. now again: [code]Jan 18 14:24:17 spuck vdr: [32710] initializing plugin: xvdr (0.9.9): XVDR Server Jan 18 14:24:17 spuck vdr: [32710] loading /var/lib/vdr/plugins/xvdr/xvdr.conf Jan 18 14:24:17 spuck vdr: [32720] tuner on frontend 1/0 thread started (pid=32710, tid=32720, prio=high) Jan 18 14:24:17 spuck vdr: [32721] section handler thread started (pid=32710, tid=32721, prio=low) Jan 18 14:24:17 spuck vdr: [32710] XVDR: Loading 2549 channels from cache [/code] [code]Jan 18 14:25:43 spuck vdr: [32740] loading /var/lib/vdr/plugins/xvdr/allowed_hosts.conf Jan 18 14:25:43 spuck vdr: [32740] XVDR: Client 192.168.1.154:55507 with ID 1 connected. Jan 18 14:25:43 spuck vdr: [404] XVDR: Welcome client 'XVDR Client' with protocol version '5' Jan 18 14:25:43 spuck vdr: [404] XVDR: Preferred language: deu,ger / type: 1 Jan 18 14:25:43 spuck vdr: [404] XVDR: Channellist filter: Jan 18 14:25:43 spuck vdr: [404] XVDR: Free To Air channels: Yes Jan 18 14:25:43 spuck vdr: [404] XVDR: Only native language: No Jan 18 14:25:43 spuck vdr: [404] XVDR: Enabled CaIDs: Jan 18 14:25:43 spuck vdr: [404] XVDR: Setting channel update method: 5 Jan 18 14:25:43 spuck vdr: [404] XVDR: Connected to wirbelscan plugin ... Jan 18 14:25:43 spuck vdr: [404] XVDR: wirbelscan plugin version: 0.0.7 Jan 18 14:26:01 spuck vdr: [32740] XVDR: Client with ID 1 seems to be disconnected, removing from client list [/code]

looks like ReorderCmd and channelcache do not work together properly. I will try to delete /var/cache/vdr/plugins/xvdr/channelcache.data in my vdr startscript. maybe this helps...

edit: also does not work. again working with a static channels.conf (wirbelscan deactivated and UpdateChannels = 0 in setup.conf)

cheers Otto

AndreyPavlenko commented 10 years ago

The command is not called for each client connection. It's called only once, on the firtst connection or if the channels list has been changed by VDR.

otto2704 commented 10 years ago

Yes, but with command activated when restarting vdr: [code] Loading 2549 channels from cache [/code] And all those channels are sent to xvdr-addon as well (including epg) - what makes a raspberry pi REALLY slow... :-(

AndreyPavlenko commented 10 years ago

Hm... Does it really send all the channels to the addon? I've just looked at my log and also found a similar message:

XVDR: Loading 77 channels from cache

However, the list of the channels in XBMC is identical to the list generated by my ReorderCmd script.

pipelka commented 10 years ago

The cache contains the stream information of all previously played channels. It has nothing to do with the channel list. A gargabe collector eliminates all orphaned entries (channels not in the channellist) from the cache.

Afaik, XBMC has still a problem dealing with dynamic growing / shrinking channel lists. A PVR database reset is needed to update the channels in XBMC.

otto2704 commented 10 years ago

I cant prove it with logfiles (I am abroad now), but this happened: I had a fresh channel list on my vdr server (about 150 channels), and UpdateChannels = 5 in setup.conf. Everything was good. Then (while xbmc on my raspi running) vdr scanned for channels and channels.conf grew. Still no problem. But then I restarted xbmc. And as a result I got > 2000 channels sent to xbmc, what my raspi could handle only VERY slow... Something is wrong, but I do not know what. If I can help testing, please let me know - for me it would be very comfortable if I could continue to let vdr scan for new channels (using streamdev and mplayer it is cool to test new found channels...)

Cheers,

Otto

pipelka commented 10 years ago

You can do this.

Just add a filtering script. It won't touch your vdr channels. It just filters the channels sent to xvdr.

Andrey already suggested a simple solution. BTW, disabling the XBMC EPG database also improves performance.

Unfortunately your log is not complete. It should also contain the results of the channel cache garbage collection and some messages about the number of channels sent to XBMC.

otto2704 commented 10 years ago

I HAD activated ReorderCmd = head -150 in xvdr.conf !!!! this should be the filtering script you mentioned?! what logs would be helpful? xbmc.log or log from vdr? disabling epg is not an option - I need the epg when watching TV ;-)

AndreyPavlenko commented 10 years ago

BTW, Alexander, if XBMC has a problem with dynamic lists, is it possible to reset the PVR database programmatically by the addon when the list has changed? Currently I use sqlite3 to reset the PVR database from the XBMC startup script.

pipelka commented 10 years ago

From my experience the only way to avoid these problems is to disable the EPG database. Using this database is dog slow and XBMC doesnt really use it. It just reloads its entries at startup.

Maybe disabling the EPG database should be tried first.

AndreyPavlenko commented 10 years ago

I always disable the EPG database - it does not help. So, I've written a simple script for resetting the PVR database on XBMC startup.

otto2704 commented 10 years ago

Hi,

could you maybe provide this script? btw: i have been playing around also with epg in mysql (server side). not a good idea for performance?

AndreyPavlenko commented 10 years ago

Here is my script:

sqlite3 $HOME/.xbmc/userdata/Database/TV22.db 'delete from channels; delete from channelgroups' rm -f $HOME/.xbmc/userdata/Database/Epg7.db

The second (rm) command may be also replaced with a corresponding sql statement, but removing the db file works as well.

otto2704 commented 10 years ago

Thank you! So you empty the database... Checked my config, i already had disabled EPG database.

Just to talk about it, maybe this would also be possible: As I have a server with vdr and xbmc running, which of course has a much faster hardware than raspberry pi. Would it be possible to let the server-side xbmc do all the data work (channels, epg) to mysql and on the client just import the data from mysql instead of vdr - I suppose, this should be MUCH faster.

I know, this is not implemented yet, but would this be possible? (for me this sounds very interesting)