Closed bowlingbeeg closed 2 weeks ago
Hmm. This sounds like a specific fix for a specific device. I haven't had any reports yet around this issue.
Unless this is reproducible on other systems I'd rather have a specific implementation for a specific device, instead of changing something that works for everyone else. Together with a bug report for that device's maintainer.
In this case I'd like a device specific whitelist in util.py with a list of system identifiers that get checked, resulting in a flag that gets used by seekdialog.py.
Hmm I'm seeing something similar to this issue on the latest firetv kodinerds omega build. (that was network related) Can you pinpoint a version when this starts happening?
This might be a kodi issue that's just been introduced.
I'm on the CoreElec Kodi Omega nightly drivers for the ugoos am6b+. I believe those are the only ones that are supported with that device. In my debugging I did try and go back to previous PM4K versions but it was present all the way back to 0.7.0.
I was talking about the kodi/coreelec version.
In any case, this is a device-specific fix. Please implement it that way (you should be able to detect which device kodi is running on, from code).
Can you point me at some code that does this? I've been searching through the code and I can only find places where it knows the platform(Linux, Android, etc). I know Kodi has the info because it prints it in the log but I don't think the addon has access to the g_sysinfo object that has that data.
Probably one of those:
xbmc.getInfoLabel('System.BuildVersion')
xbmc.getInfoLabel('System.FriendlyName')
xbmc.getInfoLabel('System.OSVersionInfo')
Or you can try this: https://stackoverflow.com/questions/110362/how-can-i-find-the-current-os-in-python
But those only give the Linux OS values. You want me to do this for every Linux device?
No I want you to try and identify the ugoos device and only enable the fix for that one.
I have no ugoos or coreelec device, so I can't test those labels for you.
Yes, I understand what you want but I don't know how to get it. None of those options you gave will give that info. That just gives the information on the Kodi level or the OS level, which in this case is just Linux. There is no option that I can find that will give device/model information.
Can you paste the log entry where it prints the necessary info? I'm currently hunting for the code (it might be https://github.com/xbmc/xbmc/blob/3d14ee659bc0a9f431ee094487a781d8ef0ad892/xbmc/utils/SystemInfo.cpp#L744, so we could try os.system("lsb_release")
if it's that)
Or it's /etc/os-release
can you try cat'ing that? (Found in https://github.com/xbmc/xbmc/blob/3d14ee659bc0a9f431ee094487a781d8ef0ad892/xbmc/utils/SystemInfo.cpp#L141)
This will get the device model number. I see it printing Ugoos am6b+ and on my zidoo it's Zidoo Z9X.
Although I have to say I'm not sure it's worth all of this hassle. The Seek interface I'm calling is still a kodi provided seek interface. Why not just check it into a beta and see if other people have problems with it?
since you asked ... but again that would then affect all coreelec users, not just the ones using Ugoos Am6b+. Of course it could be a coreelec bug and this would then work but without more user input we have no idea what devices are affected.
cat /etc/os-release NAME="CoreELEC" VERSION="21.1-Omega_nightly_20240605" ID="coreelec" VERSION_ID="21.1" PRETTY_NAME="CoreELEC (official): 21.1-Omega_nightly_20240605" HOME_URL="https://coreelec.org" BUG_REPORT_URL="https://github.com/CoreELEC/CoreELEC" BUILD_ID="5fc8d64514fbd313eb7c01e7a3ab977447274f79" LIBREELEC_ARCH="Amlogic-ng.arm" LIBREELEC_BUILD="official" LIBREELEC_PROJECT="Amlogic-ce" COREELEC_ARCH="Amlogic-ng.arm" COREELEC_BUILD="official" COREELEC_PROJECT="Amlogic-ce" COREELEC_DEVICE="Amlogic-ng" BUILDER_NAME="TheCoolest"
Hmm, they use m_cpuHardware for this, can you try cat'ing /sys/bus/soc/devices/soc0/machine
?
Edit: Or one of these: "/sys/class/hwmon/hwmon" + std::to_string(i) + "/name"
Kodi doesn't do any magic here, we should be able to get the exact same info as they do, using Python.
Neither of those seem to work. They don't exist.
cat /sys/bus/soc/devices/soc0/machine cat: can't open '/sys/bus/soc/devices/soc0/machine': No such file or directory
ls -a /sys/class/hwmon/ . ..
This one does ... I'm not sure what will happen on other devices though.
cat /proc/cpuinfo . . . Serial : 290b4000011a0f0000023236394e4e50 model name : Amlogic S922X rev b Hardware : UGOOS AM6B
Great, /proc/cpuinfo is almost always available, we could also utilize something like https://github.com/workhorsy/py-cpuinfo, but that might be overkill just for that issue.
I'd just try/except wrap around catting /proc/cpuinfo and grepping for the Hardware you want, and add a special case then. Otherwise ignore the output.
Can you try this out on your devices and see if it causes any problems?
I'll check, thank you! I'd check for whether the OS is Linux, though, to avoid unnecessary calls on all other platforms.
No issues over here on Windows.
ugh .. the Ugoos return RaspberryPi for the platform
That's fine, then just add both - then we're at least skipping the call for Android Windows etc.
oh shoot, didn't see your response before I uploaded ... since for now we only want the ugoos just having the raspberrypi check works.
The latest push looks weird:
# of devices.
def getDeviceModel():
try:
stdout = subprocess.check_output('cat /proc/cpuinfo', shell=True).decode()
hardwareRegex = re.compile(r'Hardware\s*:\s*(.*)')
match = hardwareRegex.search(stdout)
deviceModel = "Unknown"
if match:
deviceModel = match.group(1)
return deviceModel
except:
return "Unknown"
deviceModel = getDeviceModel()
# There are lots of different devices and different ways to get the device model. This way is known
# to work with the Ugoos am6b+ device but probably doesn't work for others.
def getDeviceModel():
try:
deviceModel = "Unknown"
if(getPlatform() == "RaspberryPi"):
stdout = subprocess.check_output('cat /proc/cpuinfo', shell=True).decode()
hardwareRegex = re.compile(r'Hardware\s*:\s*(.*)')
match = hardwareRegex.search(stdout)
deviceModel = "Unknown"
if match:
deviceModel = match.group(1)
return deviceModel
except:
return "Unknown"
deviceModel = getDeviceModel()
Also please use the PEP standard for line spacing (I've added comments before) before/after functions
Never heard of PEP standard and I did add two lines before/after functions.
Yeah after duplicating the code somehow :D (What I pasted above is what I get when I pull your latest branch)
Ah no, sorry, I had a bad merge because I missed that you force pushed.
if(getPlatform() == "RaspberryPi"):
has redundant parentheses, but doesn't matter, I'll merge this and fix it in post.
Thank you for fixing this!
Agh, sorry ... Python is not my normal language. Too much c++ in me :)
GHI (If applicable): #
Description:
On the Ugoos am6b+ after seeking it can take 2-15 seconds for audio to start while the video is playing. Playing the same file using the default kodi player does not exhibit this issue. Changing to use the executebuiltin(Seek) solves this issue. Hopefully this doesn't break other things because the player.seekTime is doing something else in the background that the executebuiltin doesn't.
Checklist: