• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Trouble with TVHeadEnd plugin

    Pages (2): 1 2 Next »

     
    • 0 Vote(s) - 0 Average

    Trouble with TVHeadEnd plugin

    Jellyfin's TVHeadEnd plugin not connecting right
    whimbrel
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Jan
    Reputation: 0
    #1
    2025-01-26, 12:03 AM (This post was last modified: 2025-01-26, 12:07 AM by whimbrel.)
    Hi everyone -

    I have an existing Jellyfin installation in a docker container on my NAS, which has been up for about a month and is working great.

    I just got a TV antenna connected to an HDHomeRun device, and set up TVHeadEnd in another docker image on the same NAS device. This setup seems to be working just fine - I have the TVHeadEnd plugin in Kodi and I can watch live TV and set recordings.

    Now I'm trying to get the Jellyfin plugin for TVHeadEnd working, and am running into problems I have followed this guide to set the jellyfin user in TVHeadEnd, triple checked that I used all the right settings. I have the TVHeadEnd plugin enabled in Jellyfin, with the server set to 127.0.0.1, and the right login info. But it doesn't work. It looks like Jellyfin is repeatedly failing to log into TVHeadEnd, the Jellyfin interface shows a spinning wheel every few seconds but the Live TV panel shows 0 shows/0 channels.

    The Jellyfin logs show these same two errors recurring every few seconds:

    Code:
    2025-01-25 15:58:24.826 -08:00] [ERR] [21] TVHeadEnd.HTSP.HTSConnectionAsync: [TVHclient] HTSConnectionAsync.open: exception caught
    System.Net.Sockets.SocketException (111): Connection refused [::1]:9982
      at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
      at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
      at TVHeadEnd.HTSP.HTSConnectionAsync.open(String hostname, Int32 port)
    [2025-01-25 15:58:25.086 -08:00] [ERR] [53] TVHeadEnd.HTSP.HTSConnectionAsync: [TVHclient] HTSConnectionAsync.open: exception caught
    System.Net.Sockets.SocketException (111): Connection refused [::1]:9982
      at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
      at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
      at TVHeadEnd.HTSP.HTSConnectionAsync.open(String hostname, Int32 port)

    So it can't connect to the HTSC service. I've double checked that my TVHeadEnd instance is using the default port (9982), and I know it's working because the TVH admin panel shows Kodi connected to HTSC. So, what's going on here?

    Jellyfin version: 10.10.3
    TVHeadEnd version: 4.3-2375~g653bd0400
    TVHeadEnd plugin version: 12.0.0.0

    One further test: to make sure the two docker containers can talk to each other, I logged into the jellyfin container and pinged the TVHeadEnd HSTC port by running curl 127.0.0.1:9982.

    When I do so, I see it pop up in the TVHeadEnd log:


    2025-01-25 16:03:23.123 htsp: Got connection from 127.0.0.1
    2025-01-25 16:03:23.123 htsp: 127.0.0.1: Disconnected


    So I'm convinced it's not just a networking problem. What's strange is that I am NOT seeing anything in the TVHeadEnd log when Jellyfin itself tries to connect. The pair of errors in my original post appear in the Jellyfin log about once a second, but I don't see anything appearing in the TVHeadEnd log.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2025-01-26, 05:56 PM
    Unless both containers are running with host networking, 127.0.0.1 wouldn't work. If either is running with bridge networking you'd need to use the actual IP of either the container or the host.

    Can you provide the docker compose for both Jellyfin and TVH?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    whimbrel
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Jan
    Reputation: 0
    #3
    2025-01-26, 08:52 PM
    Thanks TheDreadPirate! Both containers are using host networking.

    The TVH compose file is:
    Code:
    ---
    services:
      tvheadend:
        image: lscr.io/linuxserver/tvheadend:latest
        # ghcr.io/tvheadend/tvheadend:latest
        container_name: tvheadend
        #user: 1003:100
        group_add:
          - "100"
          - "1003"
        # We need host network to access hdhomerun
        network_mode: 'host'
        environment:
          # This is the tvheadend user I created
          - PUID=1003
          - PGID=100
          #- TZ=Etc/UTC
          - TZ=America/Los_Angeles
          - RUN_OPTS= #optional
        volumes:
          - ${TVHEADEND_CONFIG_DIR}:/config
          - CHANGE_TO_COMPOSE_DATA_PATH/tvheadend_recordings:/recordings
        restart: unless-stopped

    And the Jellyfin one is:

    Code:
    ---
    # https://hub.docker.com/r/linuxserver/jellyfin
    services:
      jellyfin:
        image: jellyfin/jellyfin
        container_name: jellyfin
        user: 1002:100
        network_mode: 'host'
        group_add:
          - "105"
        environment:
          - PUID=1002
          - PGID=100
          - TZ=America/Los_Angeles
        volumes:
          - ${JELLYFIN_CONFIG_DIR}/config/:/config
          - ${JELLYFIN_CONFIG_DIR}/cache/:/cache
          - CHANGE_TO_COMPOSE_DATA_PATH/Movies:/data/Movies
          - CHANGE_TO_COMPOSE_DATA_PATH/TV:/data/TV
          - CHANGE_TO_COMPOSE_DATA_PATH/jellyfin_library/:/data/library
        ports:
          - 8096:8096
          - 8920:8920 #optional
          - 7359:7359/udp #optional
          - 1900:1900/udp #optional
        devices:
          - /dev/dri:/dev/dri
        restart: unless-stopped

    The 1002 and 1003 user ids correspond to jellyfin and tvheadend, respectively.
    whimbrel
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Jan
    Reputation: 0
    #4
    2025-01-26, 09:21 PM
    Ope, I deleted the ports section in the jellyfin config and it seems to connect now! I guess that was overriding the host network setting.

    But I'm still having trouble: Jellyfin only shows TVH recordings and not live TV, and it can't even play the recordings. When I request to play a recording, it spins forever and does not seem to load the video.

    It clearly does *something*, I see the GPU I use for transcoding fire up, and Jellyfin's logs show an FFMpeg transcoding event where it generates a million tiny files in /cache/transcodes (all named stuff like 9ee4163b2f07756e744dd6d3d5d4ba2c441.mp4). The main Jellyfin log shows ffmpeg exits with code 0, so I'm not sure what the problem is.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #5
    2025-01-27, 01:57 AM
    Can you share your full jellyfin log via privatebin.net? And any ffmpeg logs it generated.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    whimbrel
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Jan
    Reputation: 0
    #6
    2025-01-27, 04:08 AM
    Absolutely

    Here is the transcode log when I play a recording: https://privatebin.net/?18f011e1b33af6ac...cbDzXTFWh7
    Here is the transcode log when I try to play live TV: https://privatebin.net/?0a1349a190d9f6df...7TXr7qcepo

    And here is the relevant portion of the jellyfin daily log: https://privatebin.net/?5d9f49938d7b7e9c...ZmQRRRjZey
    whimbrel
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Jan
    Reputation: 0
    #7
    2025-01-27, 04:17 AM
    I'll note that, when trying to play a recording, there is a huge spike in CPU usage from ffmpeg. So clearly it is doing a lot of work on some remuxing or transcoding. But even once that finishes, the jellyfin client just keeps spinning and spinning and it doesn't play. I'm currently testing with a client logged in through Firefox, but it's the same behavior with the Jellyfin client on an iPad.
    gnattu
    Offline

    Team Member

    Posts: 338
    Threads: 0
    Joined: 2024 Feb
    Reputation: 17
    #8
    2025-01-27, 04:34 AM
    I think it is yet another case where livetv does not work with hardware acceleration. Can you change the acceleration type to none to see if the stream plays in that case? (Note you'd better have a fast enough CPU
    )
    whimbrel
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Jan
    Reputation: 0
    #9
    2025-01-27, 05:11 AM
    Disabling hardware enconding doesn't seem to fix anything. It's definitely not using the GPU anymore, and it's not transcoding as fast (~2.5x speed instead of 8x speed). But in the client, I just see it spinning and spinning and the video never starts playing, even after the transcoding is complete.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #10
    2025-01-27, 01:35 PM
    I'm pretty sure you can configure TVH to pre-transcode before sending to Jellyfin. Give that a try?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Pages (2): 1 2 Next »

    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode