BtbN / vlc-htsp-plugin

Plugin for VLC to access TVHeadend via HTSP.
GNU Lesser General Public License v2.1
58 stars 32 forks source link

Cant populate the channel list #2

Closed pvagner closed 11 years ago

pvagner commented 11 years ago

Hello, I am unable to get the vlc playlist populated with channels retrieved from tvheadend.

Steps to reproduce:

Expected results: The vlc playlist should get populated with the list of channels retrieved from tvheadend.

Actual results: The playlist is remaing empty all the time.

Notes: I have tried with self compiled module as well as with the module downloaded from your jenkins. hts protocol connection is working because I can recognize something like this in the vlc log output htsp debug: Got Message with method channelUpdate While trying to open another service discovery services for example upnp I am getting this in the output main debug: adding services_discovery upnp{longname="Universal Plug'n'Play"}... I am unable to see an entry like this for htsp access module.

Version info and other details:

pvagner@pv-pc:~$ uname -a Linux pv-pc 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux pvagner@pv-pc:~$ cat ~/.config/vlc/vlcrc | grep hts [htsp] # TVHeadend HTSP Protocol

htsp-port=9982

htsp-host=127.0.0.1

htsp-user=

htsp-pass=

pvagner@pv-pc:~$ vlc --version VLC media player 2.0.5 Twoflower (revision 2.0.5-0-g1661b7d) pvagner@pv-pc:~$ ~/src/tvheadend/build.linux/tvheadend --version /home/pvagner/src/tvheadend/build.linux/tvheadend: version 3.5.50~g271165a pvagner@pv-pc:~$ locale LANG=sk_SK.UTF-8 LANGUAGE= LC_CTYPE="sk_SK.UTF-8" LC_NUMERIC="sk_SK.UTF-8" LC_TIME="sk_SK.UTF-8" LC_COLLATE="sk_SK.UTF-8" LC_MONETARY="sk_SK.UTF-8" LC_MESSAGES="sk_SK.UTF-8" LC_PAPER="sk_SK.UTF-8" LC_NAME="sk_SK.UTF-8" LC_ADDRESS="sk_SK.UTF-8" LC_TELEPHONE="sk_SK.UTF-8" LC_MEASUREMENT="sk_SK.UTF-8" LC_IDENTIFICATION="sk_SK.UTF-8" LC_ALL=

BtbN commented 11 years ago

Did you configure your HTSP server details in the VLC Settings? Just search for HTSP in advanced settings. And make sure you didn't just miss to expand the "Channels" item.

pvagner commented 11 years ago

Hello, I am unable to find the settings you are reffering to. I have opened Tools -> Preferences then changed simple to all and wrote htsp into the filter box. I can only find settings you can see in my .vlcrc .

Greetings

Peter

BtbN commented 11 years ago

Then someting with your plugin installation is broken, or you're using a very old version. There are settings for "HTSP Server Port", "HTSP Server Address", "HTSP Username" and "HTSP Password". I'm able to find them exactly the way you described.

pvagner commented 11 years ago

I cann see these settings. I assumed there are some more settings regarding channels. I have no username and password set. going to the Media -> Add network stream... I can enter for example htsp://127.0.0.1:9982/1 and it works fine. However what I am looking for is seeing the channel list and if possible even with some basic epg info. I have my plugin in a folder /usr/lib/vlc/plugins/access/

BtbN commented 11 years ago

The way VLC works only allows to add EPG for the currently running channel, not for all available channels, and it also only works while playing a channel. But the Settings are exactly for the service discovery mode. The access mode doesn't care for them, as it gets its settings from the url. Channel Listing works great for me with the latest build from Jenkins. It does NOT add them to the main Playlist. It lists them on LAN->Tvheadend HTSP

pvagner commented 11 years ago

hmm. I cant figure it out. Here is how my playlist window looks like. Do you have an idea? Obrazovka z 2013-03-10 17:13:24

BtbN commented 11 years ago

Check the debug log from VLC and tvh. Service Discovery definitly works with the latest tvh git master

pvagner commented 11 years ago

Here is vlc output while trying to do service discovery main debug: looking for services probe module: 11 candidates main debug: no services probe module matching "any" could be loaded main debug: TIMER module_need() : 4.144 ms - Total 4.144 ms / 1 intvls (Avg 4.144 ms) qt4 debug: Sorting by column -1, order 0 qt4 debug: Sorting by column -1, order 0 qt4 debug: Normal PL/ML or SD qt4 debug: Normal PL/ML or SD main debug: adding services_discovery htsp{longname="Tvheadend HTSP"}... main debug: rebuilding array of current - root Playlist main debug: rebuild done - 0 items, index -1 main debug: looking for services_discovery module: 1 candidate main warning: option longname is unknown main debug: using services_discovery module "htsp" main debug: TIMER module_need() : 0.153 ms - Total 0.153 ms / 1 intvls (Avg 0.153 ms) qt4 debug: Normal PL/ML or SD main debug: net: connecting to 127.0.0.1 port 9982 main debug: connection succeeded (socket = 27) htsp info: Connected to HTSP Server HTS Tvheadend, version , protocol 7 htsp info: Authenticating as 'vlc' with a password htsp info: Successfully authenticated! htsp info: Finished getting initial metadata sync

Here is tvh output for the same connection mar 10 17:58:27 [INFO]:htsp: Got connection from 127.0.0.1 mar 10 17:58:27 [INFO]:htsp: 127.0.0.1: Welcomed client software: VLC media player (HTSPv8) mar 10 17:58:27 [INFO]:htsp: 127.0.0.1 [ VLC media player ]: Identified as user vlc mar 10 17:58:28 [DEBUG]:dvb: "11,675,000 kHz Horizontal (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Faint signal mar 10 17:58:30 [DEBUG]:dvb: "11,675,000 kHz Horizontal (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Bad signal mar 10 17:58:31 [DEBUG]:dvb: "11,675,000 kHz Horizontal (No satconf)" on adapter "ST STV0299 DVB-S", status changed to No signal mar 10 17:58:32 [DEBUG]:dvb: "11,675,000 kHz Horizontal (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Bad signal mar 10 17:58:34 [DEBUG]:dvb: "11,675,000 kHz Horizontal (No satconf)" on adapter "ST STV0299 DVB-S", status changed to No signal mar 10 17:58:36 [DEBUG]:dvb: "11,675,000 kHz Horizontal (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Bad signal mar 10 17:58:38 [DEBUG]:dvb: "11,675,000 kHz Horizontal (No satconf)" on adapter "ST STV0299 DVB-S", status changed to No signal mar 10 17:58:38 [DEBUG]:dvb: "/dev/dvb/adapter0" tuning via s2api to ": 12,728,500 kHz Vertical (No satconf)" (2128500, 22000000 Baud, 5/6, SYS_DVBS, QPSK) for Initial autoscan mar 10 17:58:38 [DEBUG]:viasat_baltic: install table handlers mar 10 17:58:38 [DEBUG]:uk_freesat: install table handlers mar 10 17:58:38 [DEBUG]:eit: install table handlers mar 10 17:58:43 [DEBUG]:dvb: ": 12,728,500 kHz Vertical (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Bad signal mar 10 17:58:49 [DEBUG]:dvb: ": 12,728,500 kHz Vertical (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Faint signal mar 10 17:58:51 [DEBUG]:dvb: ": 12,728,500 kHz Vertical (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Bad signal mar 10 17:58:52 [DEBUG]:dvb: ": 12,728,500 kHz Vertical (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Faint signal mar 10 17:58:54 [DEBUG]:dvb: ": 12,728,500 kHz Vertical (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Bad signal mar 10 17:58:58 [DEBUG]:dvb: ": 12,728,500 kHz Vertical (No satconf)" on adapter "ST STV0299 DVB-S", status changed to Faint signal

I know it looks really weird however by trying to play a channel it works main debug: adding item 52' ( htsp://localhost:9982/52 ) qt4 debug: Adding a new MRL to recent ones: htsp://localhost:9982/52 main debug: rebuilding array of current - root Playlist main debug: rebuild done - 1 items, index -1 main debug: processing request item: 52, node: null, skip: 0 main debug: resyncing on 52 main debug: 52 is at 0 main debug: starting playback of the new playlist item main debug: resyncing on 52 main debug: 52 is at 0 main debug: creating new input thread main debug: Creating an input for '52' main debug: Creating an input for '52' main debug: no fetch required for (null) (art currently (null)) main debug: using timeshift granularity of 50 MiB, in path '/tmp' main debug:htsp://localhost:9982/52' gives access htsp' demux' path localhost:9982/52' main debug: creating demux: access='htsp' demux='' location='localhost:9982/52' file='(null)' main debug: looking for access_demux module: 1 candidate htsp info: HTSP plugin loading... main debug: net: connecting to localhost port 9982 main debug: connection succeeded (socket = 29) htsp info: Connected to HTSP Server HTS Tvheadend, version , protocol 7 htsp info: Successfully subscribed to channel 52 main debug: using access_demux module "htsp" main debug: TIMER module_need() : 4.845 ms - Total 4.845 ms / 1 intvls (Avg 4.845 ms) main debug: looking for meta reader module: 2 candidates lua debug: Trying Lua scripts in /home/pvagner/.local/share/vlc/lua/meta/reader lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader main debug: no meta reader module matching "any" could be loaded main debug: TIMER module_need() : 0.399 ms - Total 0.399 ms / 1 intvls (Avg 0.399 ms) main debug:htsp://localhost:9982/52' successfully opened qt4 debug: IM: Setting an input main debug: EsOutProgramMeta: number=52 main debug: selecting program id=52 main debug: EsOutProgramEpg: number=52 name=Markiza [Program 52] htsp debug: Found 10 elementary streams main debug: looking for decoder module: 30 candidates avcodec debug: libavcodec initialized (interface 0x352300) avcodec debug: trying to use direct rendering avcodec debug: allowing 1 thread(s) for decoding avcodec debug: ffmpeg codec (MPEG-1/2 Video) started main debug: using decoder module "avcodec" main debug: TIMER module_need() : 49.164 ms - Total 49.164 ms / 1 intvls (Avg 49.164 ms) htsp debug: Found elementary stream id 1, type MPEG2VIDEO main debug: looking for decoder module: 30 candidates main debug: using decoder module "mpeg_audio" main debug: TIMER module_need() : 0.138 ms - Total 0.138 ms / 1 intvls (Avg 0.138 ms) htsp debug: Found elementary stream id 2, type MPEG2AUDIO htsp debug: Found elementary stream id 3, type MPEG2AUDIO htsp debug: Found elementary stream id 4, type TELETEXT htsp debug: HTS Subscription Status: subscriptionId: 1, status: main debug: looking for text renderer module: 2 candidates freetype debug: Building font databases. freetype debug: Took 0 microseconds freetype debug: Using Serif Bold as font from file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf freetype debug: using fontsize: 2 main debug: using text renderer module "freetype" main debug: TIMER module_need() : 1.517 ms - Total 1.517 ms / 1 intvls (Avg 1.517 ms) main debug: looking for video filter2 module: 18 candidates swscale debug: 32x32 chroma: YUVA -> 16x16 chroma: RGBA with scaling using Bicubic (good quality) main debug: using video filter2 module "swscale" main debug: TIMER module_need() : 7.690 ms - Total 7.690 ms / 1 intvls (Avg 7.690 ms) main debug: looking for video filter2 module: 18 candidates yuvp debug: YUVP to YUVA converter main debug: using video filter2 module "yuvp" main debug: TIMER module_need() : 1.079 ms - Total 1.079 ms / 1 intvls (Avg 1.079 ms) main debug: Deinterlacing available main debug: deinterlace 0, mode blend, is_needed 0 main debug: Opening vout display wrapper main debug: looking for vout display module: 6 candidates main debug: looking for vout window xid module: 4 candidates qt4 debug: requesting video... qt4 debug: Video was requested 0, 0 main debug: using vout window xid module "qt4" main debug: TIMER module_need() : 18.399 ms - Total 18.399 ms / 1 intvls (Avg 18.399 ms) main debug: looking for inhibit module: 2 candidates main debug: using inhibit module "xdg_screensaver" main debug: TIMER module_need() : 0.718 ms - Total 0.718 ms / 1 intvls (Avg 0.718 ms) xcb_xv debug: connected to X11.0 server xdg_screensaver debug: started xdg-screensaver (PID = 3508) xcb_xv debug: vendor : The X.Org Foundation xcb_xv debug: version: 11103000 xcb_xv debug: using screen 0xbb xcb_xv debug: using XVideo extension v2.2 xcb_xv debug: using adaptor Intel(R) Textured Video xcb_xv debug: using port 89 xcb_xv debug: using image format 0x30323449 xcb_xv debug: using X11 visual ID 0x21 (depth: 24) xcb_xv debug: using X11 window 0x04a00000 xcb_xv debug: using X11 graphic context 0x04a00002 main debug: VoutDisplayEvent 'fullscreen' 0 main debug: VoutDisplayEvent 'resize' 640x480 window main debug: using vout display module "xcb_xv"

And here is tvh output from the same connection mar 10 18:06:46 [INFO]:htsp: Got connection from 127.0.0.1 mar 10 18:06:46 [INFO]:htsp: 127.0.0.1: Welcomed client software: VLC media player (HTSPv8) mar 10 18:06:46 [DEBUG]:Service: Subscription "127.0.0.1 [ VLC media player ]": Adding adapter "_dev_dvb_adapter0_ST_STV0299_DVB_S11836000_H" for service "ST STV0299 DVB-S/Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)/Markiza" mar 10 18:06:46 [DEBUG]:Service: Subscription "127.0.0.1 [ VLC media player ]": Probing adapter "_dev_dvb_adapter0_ST_STV0299_DVB_S11836000_H" without stealing for service "ST STV0299 DVB-S/Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)/Markiza" mar 10 18:06:46 [DEBUG]:dvb: "/dev/dvb/adapter0" tuning via s2api to "Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)" (1236500, 27500000 Baud, 5/6, SYS_DVBS, QPSK) for Transport start mar 10 18:06:46 [DEBUG]:viasat_baltic: install table handlers mar 10 18:06:46 [DEBUG]:uk_freesat: install table handlers mar 10 18:06:46 [DEBUG]:eit: install table handlers mar 10 18:06:46 [DEBUG]:cwc: ST STV0299 DVB-S/Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)/Markiza using CWC 127.0.0.1:10000 mar 10 18:06:46 [INFO]:subscription: "127.0.0.1 [ VLC media player ]" subscribing on "Markiza", weight: 150, adapter: "ST STV0299 DVB-S", network: "Towercom, a.s.", mux: "Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)", provider: "Towercom", service: "Markiza", quality: 100 mar 10 18:06:46 [DEBUG]:Service: ST STV0299 DVB-S/Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)/Markiza: Status changed to [Hardware input] mar 10 18:06:46 [WARNING]:TS: ST STV0299 DVB-S/Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)/Markiza: Transport error indicator mar 10 18:06:46 [DEBUG]:Service: ST STV0299 DVB-S/Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)/Markiza: Status changed to [Hardware input] [Input on service] mar 10 18:06:46 [DEBUG]:eit: begin processing mar 10 18:06:46 [DEBUG]:Service: ST STV0299 DVB-S/Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)/Markiza: Status changed to [Hardware input] [Input on service] [Demuxed packets] mar 10 18:06:46 [DEBUG]:cwc: Insert new ECM channel 1133 mar 10 18:06:46 [DEBUG]:cwc: Insert new ECM channel 1113 mar 10 18:06:46 [DEBUG]:cwc: Insert new ECM channel 1123 mar 10 18:06:46 [DEBUG]:cwc: Insert new ECM channel 1163 mar 10 18:06:46 [DEBUG]:cwc: Insert new ECM channel 1143 mar 10 18:06:46 [DEBUG]:cwc: Sending ECM (channel 1143) section=0/0, for service Markiza (seqno: 23) PID 1143 mar 10 18:06:46 [DEBUG]:cwc: Insert new ECM channel 1173 mar 10 18:06:47 [DEBUG]:cwc: es->es_nok 0 t->tht_prefcapid 0 mar 10 18:06:47 [DEBUG]:cwc: Received ECM reply (channel 1143) for service "Markiza" even: 64.96.d2.cc.7f.f4.d7.4a odd: ad.04.81.32.a4.ad.20.71 (seqno: 23 Req delay: 432 ms) mar 10 18:06:47 [INFO]:cwc: Obtained key for service "Markiza" in 432 ms, from 127.0.0.1:10000 mar 10 18:06:47 [WARNING]:cwc: Delete ECMpid 1173 mar 10 18:06:47 [WARNING]:cwc: Delete ECMpid 1163 mar 10 18:06:47 [WARNING]:cwc: Delete ECMpid 1123 mar 10 18:06:47 [WARNING]:cwc: Delete ECMpid 1113 mar 10 18:06:47 [WARNING]:cwc: Delete ECMpid 1133 mar 10 18:06:47 [DEBUG]:Service: ST STV0299 DVB-S/Towercom, a.s.: 11,836,500 kHz Horizontal (No satconf)/Markiza: Status changed to [Hardware input] [Input on service] [Demuxed packets] [Reassembled packets] mar 10 18:06:56 [DEBUG]:cwc: Sending ECM (channel 1143) section=0/0, for service Markiza (seqno: 24) PID 1143 mar 10 18:06:57 [DEBUG]:cwc: es->es_nok 0 t->tht_prefcapid 1143 mar 10 18:06:57 [DEBUG]:cwc: Received ECM reply (channel 1143) for service "Markiza" even: f4.17.14.1f.f1.5e.c1.10 odd: ad.04.81.32.a4.ad.20.71 (seqno: 24 Req delay: 1928 ms) mar 10 18:07:06 [DEBUG]:cwc: Sending ECM (channel 1143) section=0/0, for service Markiza (seqno: 25) PID 1143 mar 10 18:07:07 [DEBUG]:cwc: es->es_nok 0 t->tht_prefcapid 1143 mar 10 18:07:07 [DEBUG]:cwc: Received ECM reply (channel 1143) for service "Markiza" even: f4.17.14.1f.f1.5e.c1.10 odd: 03.82.a1.26.7d.7f.3d.39 (seqno: 25 Req delay: 1944 ms) mar 10 18:07:10 [INFO]:htsp: 127.0.0.1 [ VLC media player ]: Disconnected mar 10 18:07:10 [INFO]:subscription: "127.0.0.1 [ VLC media player ]" unsubscribing from "Markiza" mar 10 18:07:10 [INFO]:htsp: 127.0.0.1 [ VLC media player ]: Write error -- Broken pipe

This is all with tvheadend transcoding branch by John tormblon. The same can be seen with master branch.

BtbN commented 11 years ago

Are you sure you are using the latest git? Cause current HTSP version is 9, and the plugin reports tvh htsp version 7. I have not tested this with any other version than the latest git.

pvagner commented 11 years ago

Now I have updated to the latest tvheadend master branch. It stilll does not do service discovery for me. I will try to recreate the config and I will see.

BtbN commented 11 years ago

Just make sure you configured it propperly. Can't realy tell what's wrong, as its working perfectly fine for me.

ridams commented 11 years ago

I had this in the past but deleting all tvheadend config then reconfiguring will work ; just

sudo rm -rf /home/hts rm -rf /home/youruser/.hts

then sudo dpkg-reconfigure tvheadend

and spécify user and pwd for the web interface, the add your channels, or for best restart tvheadend after dpkg-reconfigure;

good luck.

pvagner commented 11 years ago

I have finally figured it out by reading the source code. The problem is that your access module expects to have channels numberred. I am not sure if that has changed in current git master branch but I think by default all channels had a number 0 and that has not been working well. I think the code should be updated to deal with ids instead of numbers and only use numbers for sorting.

While we are at it. Would it be doable to add channel tags into the tree? Now there is a root node called channels and all the channels are dumped inside.

Greetings

Peter

pvagner commented 11 years ago

I have simply commented out the condition where you are checking for channel number because all the channels do have it however by default it is set to 0 and this condition will succeed thus failing to add the channels if they are not numberred.

diff --git a/discovery.cpp b/discovery.cpp index b9d2dc1..97faf0b 100644 --- a/discovery.cpp +++ b/discovery.cpp @@ -170,8 +170,8 @@ bool GetChannels(services_discovery_t *sd) if(cname.empty()) continue;

BtbN commented 11 years ago

Latest commits should fix this.

pvagner commented 11 years ago

Yeah avesome! I have seen the commits. You have even implemented my feature request regarding channel tags.

Should I report such requests as a seperate github issues?

For example another crazy one just popped up on my mind. Would it be possible to fake the input stream title so it will also contain the channel name and also the current EPG event? Or might this cause conflicts and you would rather avoid this?

Greetings

Peter

BtbN commented 11 years ago

VLC has an internal api to populate the items with epg info. But as i tested it, adding the EPG info just did nothing, VLC did not display it in any way. The access module already has full EPG support for the current channel. Just play a channel and open Tools->Program Guide