Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] OpenFM HLS stream no sound. Unable to Init Codec while loading file #1752

Open
Lantash77 opened this issue Jan 6, 2025 · 3 comments
Open
Labels
Resolution: Fixed issue was resolved by a code change

Comments

@Lantash77
Copy link

Describe the problem

Working on rewriting openFM addon as been moved from direct streams to hls. OpenFM
As figured out API and streams url quite well, stomp on bump when tried to play using ISA as no sound.

Tried on K21 - Win11 and Libreelec platform.
Installed additional codecs for Win11 didn't improve.

Possible fix

Unknown

Steps to reproduce

Part of code:

def playitem():
	url = params['url']
	manifest_url = 'https://stream-cdn-1.open.fm/OFM2/ngrp:standard/playlist.m3u8?t=cf320e8569836263b7c8cb12fb04a13acaac5b44b2d70d9986d165cf788669afcae59afb28cc303d846e69c2002df620c0c2e18762b357277f0c9febaaa46f0a58262488ca372285de29334c3db8abbd5daf14ad894f16d102be92b8daaf8c92f04c37165082e28e9c233ddacfac9dec9106fa16b2b0ae8fb78c8ab9c967cab71313a17da1fd485f742c6f2210666560e3089b354d7c5fb8134af0b55bcf9f224155a4ea5e8ab6cc3d55fb9eb5ac45ed76a6d91471d98287b9a7b7af95d18d5c88ba39740b082a53bd1093e778a30335dfb5d6aceef752331c20065c19f468f1c80d2e9d4a1d1f57b3fd55b98635ecc1919f2d70c1bb8a3d38'
	print(f"openFM station name {params['name']}")
	print(f'openFM url - {url}')
	print(f'openFM playlist - {manifest_url}')
	last_part_url = manifest_url.split('/')[-1]
	manifest_parse = requests.get(manifest_url)
	playlist = re.search(r'chunklist[^\s]*', manifest_parse.text)
	chunklist = playlist.group(0)
	streamurl = manifest_url.replace(last_part_url, chunklist)	
	liz = xbmcgui.ListItem(params['name'], path=streamurl)
	
	liz.setMimeType('application/vnd.apple.mpegurl')
	liz.setContentLookup(False)
	liz.setProperty('inputstream', 'inputstream.adaptive')
	liz.setProperty("IsPlayable", "true")
	
	xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

Not playing:
Noticed in log unable to Init codec:

2025-01-06 13:34:30.389 T:7432     info <general>: AddOnLog: inputstream.adaptive: PosTime (1)
2025-01-06 13:34:30.389 T:7432    debug <general>: AddOnLog: inputstream.adaptive: GetStreamIds()
2025-01-06 13:34:30.389 T:7432    debug <general>: AddOnLog: inputstream.adaptive: GetStream(1001)
2025-01-06 13:34:30.389 T:7432    debug <general>: AddOnLog: inputstream.adaptive: GetStream(1002)
2025-01-06 13:34:30.389 T:7432    debug <general>: CDVDDemuxClient::RequestStream(): added/updated stream 1001 with codec_id 27
2025-01-06 13:34:30.389 T:7432    debug <general>: CDVDDemuxClient::RequestStream(): added/updated stream 1002 with codec_id 86018
2025-01-06 13:34:30.389 T:7432    error <general>: CAudioDecoder: Unable to Init Codec while loading file https://stream-cdn-1.open.fm/OFM2/ngrp:standard/chunklist_b192000.m3u8?t=5b7c89e2fe54e12fd02138b0f57d6995e78c41de7adfb7e6bb96e96379d9aed262dfadb78938eb587ac4a69cb168851bdec678524a186cbcdb2bf2312b4f95f5cbf27e6769cce24b5c3f104d3aa5f3d1305e3e0fd49ca1f24348a6d926171045447254617044a6b9094ad23fca3e719860a62f1df5735d2af16ddf7a2377ac9a29d36ce9ae3518d59c229cc4eba966a3bc5e
2025-01-06 13:34:30.389 T:7432    debug <general>: AddOnLog: inputstream.adaptive: Close()
2025-01-06 13:34:30.389 T:7432    debug <general>: AddOnLog: inputstream.adaptive: CSession::~CSession()
2025-01-06 13:34:30.390 T:7432    debug <general>: AddOnLog: inputstream.adaptive: CSession::DeleteStreams()
2025-01-06 13:34:30.390 T:7432    debug <general>: SECTION:UnloadDll(D:\Kodi21\portable_data\addons\inputstream.adaptive\inputstream.adaptive.dll)
2025-01-06 13:34:30.390 T:7432     info <general>: ADDON: Dll Destroyed - InputStream Adaptive
2025-01-06 13:34:30.390 T:7432  warning <general>: PAPlayer::QueueNextFileEx - Failed to create the decoder
2025-01-06 13:34:30.390 T:7432    debug <general>: CApplicationPlayerCallback::OnAVStarted: CApplication::OnAVStarted
2025-01-06 13:34:30.390 T:7432    debug <general>: CApplicationPlayerCallback::OnQueueNextItem: CApplication::OnQueueNextItem
2025-01-06 13:34:30.401 T:17844   debug <general>: CApplicationPlayerCallback::OnPlayBackEnded: CApplicationPlayerCallback::OnPlayBackEnded
2025-01-06 13:34:30.401 T:17844   debug <general>: Thread PAPlayer 17844 terminating
2025-01-06 13:34:30.407 T:576     debug <general>: ------ Window Deinit (DialogBusy.xml) ------

Tried so far:
Put playlist.m3u8 url as stream url as found its playable on VLC.
Without liz.setMimeType('application/vnd.apple.mpegurl') line.

Debug log

https://paste.kodi.tv/erafuvovun.kodi

Stream manifest file(s)

Example stream url.
playlist.m3u8

#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=192000,CODECS="mp4a.40.2"
chunklist_b192000.m3u8?t=cf320e8569836263b7c8cb12fb04a13acaac5b44b2d70d9986d165cf788669afcae59afb28cc303d846e69c2002df620c0c2e18762b357277f0c9febaaa46f0a58262488ca372285de29334c3db8abbd5daf14ad894f16d102be92b8daaf8c92f04c37165082e28e9c233ddacfac9dec9106fa16b2b0ae8fb78c8ab9c967cab71313a17da1fd485f742c6f2210666560e3089b354d7c5fb8134af0b55bcf9f224155a4ea5e8ab6cc3d55fb9eb5ac45ed76a6d91471d98287b9a7b7af95d18d5c88ba39740b082a53bd1093e778a30335dfb5d6aceef752331c20065c19f468f1c80d2e9d4a1d1f57b3fd55b98635ecc1919f2d70c1bb8a3d38

chunklist_b192000.m3u8

#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:19035101
#EXT-X-DISCONTINUITY-SEQUENCE:0
#EXTINF:5.056,
media-aa7e5becc_b192000_19035101.ts
#EXTINF:4.992,
media-1aba5879e_b192000_19035102.ts
#EXTINF:4.992,
media-703d8f7c7_b192000_19035103.ts
#EXTINF:4.992,
media-d1d4e1d1a_b192000_19035104.ts
#EXTINF:4.992,
media-743d87418_b192000_19035105.ts

Both links available to play via VLC

Additional info

Possible when required

Operating system(s)

Windows, Other (specify below)

Operating system version(s)

Windows 11, Libreelec 12.0.1

InputStream Adaptive version(s)

21.5.7

Kodi version(s)

21.1

@Lantash77 Lantash77 added the Triage: Needed (managed by bot) issue that was just created and needs someone looking at it label Jan 6, 2025
@lavish440
Copy link

You can just use your manifestUrl. I tried putting that in a playlist and it works on Kodi 22 on Linux.

@Lantash77
Copy link
Author

Glad you managed to play. Did pre-release addon with sending manifestUrl to ISA, sent addon for testing.
Got feedback that having same issue. As for now K21 on Win11.
Is there anything wrong with Codec Init process - Unable to Init Codec while loading file https:/...
Tried myself on linux but using K21 as wel as Libreelec on Rpi. It tits up on same place.

@CastagnaIT
Copy link
Collaborator

You can just use your manifestUrl. I tried putting that in a playlist and it works on Kodi 22 on Linux.

more likely one of many ISA improvements on kodi 22
no backports will be done

@CastagnaIT CastagnaIT added Resolution: Fixed issue was resolved by a code change and removed Triage: Needed (managed by bot) issue that was just created and needs someone looking at it labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Fixed issue was resolved by a code change
Projects
None yet
Development

No branches or pull requests

3 participants