Skip to content

Missing audio streams when not available at initial HTSP subscription #689

@spdfrk

Description

@spdfrk

Hi,

I'm running into an issue where sometimes the audio streams are not available yet on subscription (HTSP). This seams to be specifically HTSP as HTTP mode works but not really an option. The issue can happen randomly for any stream, restarting the stream most of the time fixes it. The streams are DASH streams piped through ffmpeg.

On Tvheadend side I can see below warnings when the audio is missing:
tsfix: The timediff for AC3 is big (.....), using current dts
tsfix: The timediff for AAC is big (.....), using current dts

Alternatively sometimes only AC3 is missing.

Kodi log when working ok:

2024-11-02 15:55:45.262 T:160885   debug <general>: AddOnLog: pvr.hts: demux subscription start
2024-11-02 15:55:45.262 T:160885   debug <general>: AddOnLog: pvr.hts:   id: 1001, type H264, codec: 27
2024-11-02 15:55:45.262 T:160885   debug <general>: AddOnLog: pvr.hts:   id: 1002, type AAC, codec: 86018
2024-11-02 15:55:45.262 T:160885   debug <general>: AddOnLog: pvr.hts:   id: 1003, type AC3, codec: 86019
2024-11-02 15:55:45.262 T:160885   debug <general>: AddOnLog: pvr.hts: demux stream change
2024-11-02 15:55:45.262 T:163081   debug <general>: CDVDDemuxClient::RequestStream(): added/updated stream 1001 with codec_id 27
2024-11-02 15:55:45.262 T:163081   debug <general>: CDVDDemuxClient::RequestStream(): added/updated stream 1002 with codec_id 86018
2024-11-02 15:55:45.262 T:163081   debug <general>: CDVDDemuxClient::RequestStream(): added/updated stream 1003 with codec_id 86019
2024-11-02 15:55:45.262 T:163081    info <general>: Opening stream: 1001 source: 256
2024-11-02 15:55:45.262 T:163081   error <general>: OpenStream: Codec id 27 require extradata.
2024-11-02 15:55:45.262 T:163081 warning <general>: OpenStream - Unsupported stream 1001. Stream disabled.
2024-11-02 15:55:45.262 T:163081    info <general>: Opening stream: 1003 source: 256
2024-11-02 15:55:45.262 T:163081    info <general>: Finding audio codec for: 86019
2024-11-02 15:55:45.263 T:163081    info <general>: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder ac3

Not ok:

2024-11-02 15:57:47.036 T:160885   debug <general>: AddOnLog: pvr.hts: demux subscription start
2024-11-02 15:57:47.036 T:160885   debug <general>: AddOnLog: pvr.hts:   id: 1001, type H264, codec: 27
2024-11-02 15:57:47.037 T:160885   debug <general>: AddOnLog: pvr.hts: demux stream change
2024-11-02 15:57:47.037 T:163081   debug <general>: CDVDDemuxClient::RequestStream(): added/updated stream 1001 with codec_id 27
2024-11-02 15:57:47.037 T:163081    info <general>: Opening stream: 1001 source: 256
2024-11-02 15:57:47.037 T:163081   error <general>: OpenStream: Codec id 27 require extradata.
2024-11-02 15:57:47.037 T:163081 warning <general>: OpenStream - Unsupported stream 1001. Stream disabled.
2024-11-02 15:57:47.040 T:163081   debug <general>: GetPacketExtradata: fetching extradata, extradata_size(49)
2024-11-02 15:57:47.040 T:163081   debug <general>: CDVDDemuxClient::ParsePacket - split extradata

Now the log spam from Kodi starts with:

AddOnLog: pvr.hts: Dropped packet with unknown stream index 1002
AddOnLog: pvr.hts: Dropped packet with unknown stream index 1003

As a quick fix I just reset the stream like this. Although I think somehow adding the streams would be a lot better.
https://github.com/kodi-pvr/pvr.hts/blob/Piers/src/tvheadend/HTSPDemuxer.cpp#L547

Logger::Log(LogLevel::LEVEL_DEBUG, "Dropped packet with unknown stream index %i", idx);
m_lastPkt = 0;
m_conn.Disconnect();
m_demuxPktHdl.AllocateDemuxPacket(0);
return;

Do you think this is something that can be fixed on the plugin side? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions