FernetMenta / vdr-plugin-vnsiserver

VDR plugin to handle XBMC clients.
GNU General Public License v2.0
16 stars 33 forks source link

The Radio ID field seems not supported. #56

Closed AndreyPavlenko closed 8 years ago

AndreyPavlenko commented 8 years ago

According to the VDR documentation https://linuxtv.org/vdrwiki/index.php/Syntax_of_channels.conf#RID :

RID Radio ID. Typical 0. Can be used to differentiate between channels having the same SID, NID and TID.

However, VNSI seems ignores this field. I've created a few groups with duplicate channels but different RID. Here is a short example:

:~HTB+~ EUROSPORT 1 HD;HTB+:12207:vC34M5O35S1:S36.0E:27500:301=27:401=rus@4,421=eng@4:0:500:26001:112:9:0

:Sport EUROSPORT 1 HD;HTB+:12207:vC34M5O35S1:S36.0E:27500:301=27:401=rus@4,421=eng@4:0:500:26001:112:9:1

The first group is the provider name and it contains all channels of this provider. The second group contains only the sport channels from the first group, but these channels have a different RID.

I can see all these groups in Streamdev but not in VNSI. Seems VNSI ignores the RID field and treats the channels from the second group as duplicates.

FernetMenta commented 8 years ago

vnsi does not ignore RID. it uses VDR's tChannelID::ToString, that recognises RID

Did you set "sync channel groups with backend" in PVR settings?

AndreyPavlenko commented 8 years ago

Yes I did. If I add a non-duplicate channel into the second group, it appears in VNSI.

FernetMenta commented 8 years ago

Interesting. VNSI creates a hash for the channelID, which is string, because Kodi PVR requires an integer. The hash function was there before I took over vnsi and I have never touched it. RID is the last character of the stringId and maybe the hash calculates string length incorrectly. I'll have a deeper look.

FernetMenta commented 8 years ago

could you try setting RID to > 1? ref: https://github.com/FernetMenta/vdr-plugin-vnsiserver/commit/d4761a0633e3551558424fb3088e696552d6b07f

RID set to 1 defines the channel as radio channel: http://forum.kodi.tv/showthread.php?tid=222386

AndreyPavlenko commented 8 years ago

It works with RID = 2. Thanks.

FernetMenta commented 8 years ago

You are welcome.

AndreyPavlenko commented 7 years ago

Seems this functionality is broken now. I have two channels in the list:

2X2;HTB+:12092:vC34M5O35S1:S36E:27500:201:301=rus:0:500:2101:112:21:0 2X2 (2);HTB+:12092:vC34M5O35S1:S36E:27500:201:301=rus:0:500:2101:112:21:2

The only difference is the RID field. The first channel is played well, but the second fails with the following error in the log:

VNSI-Error: cParser::AddPESPacket - max buffer size reached, pid: 201

FernetMenta commented 7 years ago

Not sure if this is related. "VNSI-Error: cParser::AddPESPacket - max buffer size reached, pid: 201" means that for some reason the parser does not find a packet. Can you pastebin the full section of the log? (debug level 3)

AndreyPavlenko commented 7 years ago

I've launched vdr with -l 3, but I don't see VNSI debug logs in the syslog. As I understand this code https://github.com/FernetMenta/vdr-plugin-vnsiserver/blob/master/config.h:

define DEBUGLOG(x...) (SysLogLevel > 3) ? dsyslog("VNSI-Debug: " x) : void

()

Debug logs are only enabled if the level is > 3, but vdr only accepts 1-3.

On Mon, Nov 7, 2016 at 9:22 PM, Rainer Hochecker notifications@github.com wrote:

Not sure if this is related. "VNSI-Error: cParser::AddPESPacket - max buffer size reached, pid: 201" means that for some reason the parser does not find a packet. Can you pastebin the full section of the log? (debug level 3)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FernetMenta/vdr-plugin-vnsiserver/issues/56#issuecomment-258918121, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBK6xi6Zawebk19YKZfCjnK9UN0ob_7ks5q72x4gaJpZM4I0SXW .

AndreyPavlenko commented 7 years ago

I've recompiled with the debug logs enabled. Here is the log:

Nov 10 16:40:39 htpc vdr: [11333] VNSI: allocated timeshift buffer with size: 500000000 Nov 10 16:40:39 htpc vdr: [11333] VNSI: Successfully found following device: 0x1c84b80 (1) for receiving, priority=0 Nov 10 16:40:39 htpc vdr: [11333] VNSI: Dummy receiver (0x7f2410003020) activated Nov 10 16:40:39 htpc vdr: [11333] VNSI: activate live receiver: 1 Nov 10 16:40:39 htpc vdr: [11333] VNSI-Debug: VDR active, sending stream start message Nov 10 16:40:39 htpc vdr: [11333] VNSI: Successfully switched to channel 2 - 2X2 (2) Nov 10 16:40:39 htpc vdr: [11333] VNSI: Started streaming of channel 2X2 (2) (timeout 10 seconds) Nov 10 16:40:39 htpc vdr: [11336] VNSI: Created stream for pid=201 and type=7 Nov 10 16:40:39 htpc vdr: [11336] VNSI: Created stream for pid=301 and type=2 Nov 10 16:40:40 htpc vdr: [11336] VNSI: Audio stream change, pid: 301, channels: 2, samplerate: 48000 Nov 10 16:40:42 htpc vdr: [10971] VNSI: Requesting clients to load epg Nov 10 16:40:42 htpc vdr: [10973] VNSI: Requesting clients to load epg Nov 10 16:40:43 htpc vdr: [11336] VNSI-Error: cParser::AddPESPacket - max buffer size reached, pid: 201 Nov 10 16:40:46 htpc vdr: [11336] VNSI-Error: cParser::AddPESPacket - max buffer size reached, pid: 201 Nov 10 16:40:47 htpc vdr: [10971] VNSI: Requesting clients to load epg Nov 10 16:40:47 htpc vdr: [10973] VNSI: Requesting clients to load epg Nov 10 16:40:49 htpc vdr: [11336] VNSI: Channel: no data 16 Nov 10 16:40:49 htpc vdr: [11336] VNSI-Error: cParser::AddPESPacket - max buffer size reached, pid: 201 Nov 10 16:40:52 htpc vdr: [11333] VNSI-Debug: Received chan=1, ser=2029, op=21, edl=0 Nov 10 16:40:52 htpc vdr: [11333] VNSI-Debug: Started to delete live streamer Nov 10 16:40:52 htpc vdr: [11336] VNSI: exit streamer thread Nov 10 16:40:52 htpc vdr: [11333] VNSI: LiveStreamer::Close - close

FernetMenta commented 7 years ago

Thanks, I may have an idea and will have a closer look this weekend.

FernetMenta commented 7 years ago

could you please pastebin a log that first shows the working channel, then stop playback, then the non-working channel?

AndreyPavlenko commented 7 years ago

Here it is - http://pastebin.com/BHj8etEw .

FernetMenta commented 7 years ago

your channels.conf seems to have an issue. VPID is supposed to be followed by type of video codec, see post no 1 of this thread

HD;HTB+:12207:vC34M5O35S1:S36.0E:27500:301=27:401=rus@4,421=eng@4:0:500:26001:112:9:0

"=27" means h264

your channel entries miss the type information and as a result the second channel tries to use mpeg2 as codec and fails.

AndreyPavlenko commented 7 years ago

Oh... Sorry, didn't notice this difference. Actually, the second entry I've created as an exact copy of the first one and changed the RID value from 0 to 2.

I did a simple test: removed the codec type from both entries:

2X2;HTB+:12092:vC34M5O35S1:S36.0E:27500:201:301=rus@4:0:500:2101:112:21:0 2X2 (2);HTB+:12092:vC34M5O35S1:S36.0E:27500:201:301=rus@4:0:500:2101:112:21:2

Started vdr, started/stopped playback, stopped vdr. The entries have been changed by vdr to the following:

2X2;HTB+:12092:vC34M5O35S1:S36.0E:27500:201=27:301=rus@4:0:500:2101:112:21:0 2X2 (2);HTB+:12092:vC34M5O35S1:S36.0E:27500:201=2:301=rus@4:0:500:2101:112:21:2

Is it a vdr issue?

AndreyPavlenko commented 7 years ago

And a few more tests:

Test1. Removed vnsi, only streamdev is installed. On VDR startup I see this message in the log: changing pids of channel 1 (2X2) from 201+201=2:301=rus@4:0:0 to 201+201=27:301=rus@4:0:0 Tested playback over streamdev - the first channel works, but the second doesn't. Stopped VDR - channels.conf not changed.

Test2 Installed vnsi and removed streamdev. On VDR startup I see this message in the log: changing pids of channel 1 (2X2) from 201+201=2:301=rus@4:0:0 to Tested playback over vnsi - the first channel works, but the second doesn't. Stopped VDR - channels.conf changed to the following:

2X2;HTB+:12092:vC34M5O35S1:S36.0E:27500:201=2:301=rus@4:0:500:2101:112:21:0 2X2 (2);HTB+:12092:vC34M5O35S1:S36.0E:27500:201=2:301=rus@4:0:500:2101:112:21:2

FernetMenta commented 7 years ago

In order to know what streams do belong to a given program and to know some type information about the streams, the receiver has to parse pat/pmt. When vdr attaches a receiver to a device it also attaches a parser for pat/pmt and updates the list of channels. It does not consider duplicate entries in channels.conf: https://projects.vdr-developer.org/git/vdr.git/tree/pat.c#n406

AndreyPavlenko commented 7 years ago

Thanks a lot for the clarification. The workaround - set the video codec manually. The following list works fine:

2X2;HTB+:12092:vC34M5O35S1:S36.0E:27500:201=27:301=rus@4:0:500:2101:112:21:0 2X2 (2);HTB+:12092:vC34M5O35S1:S36.0E:27500:201=27:301=rus@4:0:500:2101:112:21:2

FernetMenta commented 7 years ago

great to hear that it's working