2020-05-24, 19:06
(2020-05-24, 17:24)bmberni Wrote: Hi,
thanks for this addon!
I've got a problem when running it on LibreELEC (official): 9.0.2 (RPi2.arm).
When I start the stream over LMS or even the plugin, the stream stops after 2 seconds.
In kodi.log i've got this:
code:
2020-05-24 17:15:06.804 T:1609253744 NOTICE: plugin.audio.squeezebox --> play started by lms server
2020-05-24 17:15:06.999 T:1155478384 ERROR: Init: Error creating demuxer
2020-05-24 17:15:07.161 T:1155478384 NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder pcm_s16le
2020-05-24 17:15:08.071 T:1609253744 NOTICE: plugin.audio.squeezebox --> playlist changed on lms server
2020-05-24 17:15:08.243 T:1609253744 NOTICE: plugin.audio.squeezebox --> clearing playlist...
2020-05-24 17:15:08.428 T:1084146544 ERROR: CFileCache:rocess - Error 0 seeking. Seek returned -1
2020-05-24 17:15:08.429 T:1163871088 ERROR: Init: Error creating demuxer
2020-05-24 17:15:08.532 T:1163871088 NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder pcm_s16le
2020-05-24 17:15:09.730 T:1609253744 NOTICE: plugin.audio.squeezebox --> playback stopped
it seems that libreelec cannot play the empty pcm stream which is produced by the plugin.
I already found the right section to change that in httpproxy.py but I don't know much about the parameters to set for an e.g. MP3 stream.
can someone help me with this parameters (header, chuck etc). it should send out an mp3 stream.python:
# always add 2 seconds of additional duration to solve crossfade issues
duration += 2
numsamples = 44100 * duration
channels = 2
samplerate = 44100
bitspersample = 16
# Generate format chunk
format_chunk_spec = "<4sLHHLLHH"
format_chunk = struct.pack(
format_chunk_spec,
"fmt ", # Chunk id
16, # Size of this chunk (excluding chunk id and this field)
1, # Audio format, 1 for PCM
channels, # Number of channels
samplerate, # Samplerate, 44100, 48000, etc.
samplerate * channels * (bitspersample / 8), # Byterate
channels * (bitspersample / 8), # Blockalign
bitspersample, # 16 bits for two byte samples, etc.
)
# Generate data chunk
data_chunk_spec = "<4sL"
datasize = numsamples * channels * (bitspersample / 8)
data_chunk = struct.pack(
data_chunk_spec,
"data", # Chunk id
int(datasize), # Chunk size (excluding chunk id and this field)
)
sum_items = [
#"WAVE" string following size field
4,
#"fmt " + chunk size field + chunk size
struct.calcsize(format_chunk_spec),
# Size of data chunk spec + data size
struct.calcsize(data_chunk_spec) + datasize
]
# Generate main header
all_cunks_size = int(sum(sum_items))
main_header_spec = "<4sL4s"
main_header = struct.pack(
main_header_spec,
"RIFF",
all_cunks_size,
"WAVE"
)
Thanks
Börny
I get a lot of demuxer errors too and it still works for me. I'm not really sure what's cause them but it doesn't seem to break the plugin.
It sounds like you may be running into the "onPlayBackStopped" issue, have you tried that fix?
Quote:Just for future reference -
I do not know what is actually causing the issue nor have I really looked or tracked Kodi's messaging, but commenting out:
python:
def onPlayBackStopped(self):
'''Kodi event fired when playback is stopped'''
if self.is_playing:
self.lmsserver.stop()
log_msg("playback stopped")
self.is_playing = False
from the plugin's player_monitor.py corrected my afore mentioned issue of the playback being forced stopped.