Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Test and fix the Kernel 4.9 features

Moderators: mdrjr, odroid

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby DarkBahamut » Sun Mar 12, 2017 7:50 am

I thought the XU3 lite used a different revision of the SoC? Samsung sources do account for a different bin running at the lite's clockspeeds, and that comes with a different voltage curve (more voltage is required).

The only concern would be stability however, so if it's stable then I wouldn't worry about it. The 4.9 kernel is already running high voltages so that's probably going to allow the vast majority of XU3 lite's to run just fine, at the cost of performance on XU3/4 boards.
DarkBahamut
 
Posts: 229
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby rooted » Sun Mar 12, 2017 10:22 am

I have both devices but no time to test currently.
User avatar
rooted
 
Posts: 3652
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1
C1+
C2
XU3 Lite
XU4
VU7+
HiFi Shield 2
Smart Power (original)

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby memeka » Sun Mar 12, 2017 10:43 am

DarkBahamut is correct. XU3-Lite is either not working or not stable at 2GHz
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby DarkBahamut » Sun Mar 12, 2017 12:11 pm

Currently all boards are using the same opp tables. I suppose if we make a new opp table for the lite then just use a define we can setup the boards with the correct cpu freq and voltages to ensure stability.

I don't have an XU3 lite to test myself, but I quickly put this together which should work I think. It sets 1.8/1.3Ghz for the lite using the Samsung ASV0 voltages from 3.10 and non lite boards should use 2.0/1.4 (previously the HK 4.9 was only going to 1.3 on the A7's) again using the Samsung ASV0 3.10 voltages.

Code: Select all
From 12a482e5e045bebe1a1e789c46bec656fb95dd15 Mon Sep 17 00:00:00 2001
From: DarkBahamut <darkbahamut@gmail.com>
Date: Sun, 12 Mar 2017 03:02:18 +0000
Subject: [PATCH] arm: dts: odroid: Enable correct cpu freq for XU3 lite and
 non lite boards

The XU3 and XU4 use A15 2.0GHz and A7 1.4GHz, but the XU3 lite uses a lowered binned soc that only runs A15 1.8GHz and A7 1.3GHz while also using slightly higher voltages. This implements correct clockspeeds and voltages for each soc type.
---
 arch/arm/boot/dts/exynos5422-cpus.dtsi          | 111 ++++++++++++++++++++
 arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts |   1 +
 arch/arm/boot/dts/exynos5800.dtsi               | 132 +++++++++++++++++++++++-
 3 files changed, 240 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5422-cpus.dtsi b/arch/arm/boot/dts/exynos5422-cpus.dtsi
index 9ef72fe..76fd650 100644
--- a/arch/arm/boot/dts/exynos5422-cpus.dtsi
+++ b/arch/arm/boot/dts/exynos5422-cpus.dtsi
@@ -19,6 +19,8 @@
  * published by the Free Software Foundation.
  */
 
+#ifdef EXYNOS5422_BIN2 /* odroid xu3 lite */
+
 / {
    cpus {
       #address-cells = <1>;
@@ -78,6 +80,113 @@
          compatible = "arm,cortex-a15";
          clocks = <&clock CLK_ARM_CLK>;
          reg = <0x0>;
+         clock-frequency = <1800000000>;
+         cci-control-port = <&cci_control1>;
+         operating-points-v2 = <&cluster_a15_opp_table>;
+         cooling-min-level = <0>;
+         cooling-max-level = <16>;
+         #cooling-cells = <2>; /* min followed by max */
+      };
+
+      cpu5: cpu@1 {
+         device_type = "cpu";
+         compatible = "arm,cortex-a15";
+         reg = <0x1>;
+         clock-frequency = <1800000000>;
+         cci-control-port = <&cci_control1>;
+         operating-points-v2 = <&cluster_a15_opp_table>;
+         cooling-min-level = <0>;
+         cooling-max-level = <16>;
+         #cooling-cells = <2>; /* min followed by max */
+      };
+
+      cpu6: cpu@2 {
+         device_type = "cpu";
+         compatible = "arm,cortex-a15";
+         reg = <0x2>;
+         clock-frequency = <1800000000>;
+         cci-control-port = <&cci_control1>;
+         operating-points-v2 = <&cluster_a15_opp_table>;
+         cooling-min-level = <0>;
+         cooling-max-level = <16>;
+         #cooling-cells = <2>; /* min followed by max */
+      };
+
+      cpu7: cpu@3 {
+         device_type = "cpu";
+         compatible = "arm,cortex-a15";
+         reg = <0x3>;
+         clock-frequency = <1800000000>;
+         cci-control-port = <&cci_control1>;
+         operating-points-v2 = <&cluster_a15_opp_table>;
+         cooling-min-level = <0>;
+         cooling-max-level = <16>;
+         #cooling-cells = <2>; /* min followed by max */
+      };
+   };
+};
+
+#else
+
+/ {
+   cpus {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      cpu0: cpu@100 {
+         device_type = "cpu";
+         compatible = "arm,cortex-a7";
+         reg = <0x100>;
+         clocks = <&clock CLK_KFC_CLK>;
+         clock-frequency = <1400000000>;
+         cci-control-port = <&cci_control0>;
+         operating-points-v2 = <&cluster_a7_opp_table>;
+         cooling-min-level = <0>;
+         cooling-max-level = <12>;
+         #cooling-cells = <2>; /* min followed by max */
+      };
+
+      cpu1: cpu@101 {
+         device_type = "cpu";
+         compatible = "arm,cortex-a7";
+         reg = <0x101>;
+         clock-frequency = <1400000000>;
+         cci-control-port = <&cci_control0>;
+         operating-points-v2 = <&cluster_a7_opp_table>;
+         cooling-min-level = <0>;
+         cooling-max-level = <12>;
+         #cooling-cells = <2>; /* min followed by max */
+      };
+
+      cpu2: cpu@102 {
+         device_type = "cpu";
+         compatible = "arm,cortex-a7";
+         reg = <0x102>;
+         clock-frequency = <1400000000>;
+         cci-control-port = <&cci_control0>;
+         operating-points-v2 = <&cluster_a7_opp_table>;
+         cooling-min-level = <0>;
+         cooling-max-level = <12>;
+         #cooling-cells = <2>; /* min followed by max */
+      };
+
+      cpu3: cpu@103 {
+         device_type = "cpu";
+         compatible = "arm,cortex-a7";
+         reg = <0x103>;
+         clock-frequency = <1400000000>;
+         cci-control-port = <&cci_control0>;
+         operating-points-v2 = <&cluster_a7_opp_table>;
+         cooling-min-level = <0>;
+         cooling-max-level = <12>;
+         #cooling-cells = <2>; /* min followed by max */
+      };
+
+      cpu4: cpu@0 {
+         device_type = "cpu";
+         compatible = "arm,cortex-a15";
+         clocks = <&clock CLK_ARM_CLK>;
+         reg = <0x0>;
          clock-frequency = <2000000000>;
          cci-control-port = <&cci_control1>;
          operating-points-v2 = <&cluster_a15_opp_table>;
@@ -123,3 +232,5 @@
       };
    };
 };
+
+#endif
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts
index 7720a18..d38f5ac 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts
@@ -12,6 +12,7 @@
 */
 
 /dts-v1/;
+#define EXYNOS5422_BIN2
 #include "exynos5422-odroidxu3-common.dtsi"
 #include "exynos5422-odroidxu3-audio.dtsi"
 #include "exynos54xx-odroidxu-leds.dtsi"
diff --git a/arch/arm/boot/dts/exynos5800.dtsi b/arch/arm/boot/dts/exynos5800.dtsi
index e15ca28..cc1d111 100644
--- a/arch/arm/boot/dts/exynos5800.dtsi
+++ b/arch/arm/boot/dts/exynos5800.dtsi
@@ -23,6 +23,123 @@
    compatible = "samsung,exynos5800-clock";
 };
 
+#ifdef EXYNOS5422_BIN2 /* odroid xu3 lite */
+
+&cluster_a15_opp_table {
+   opp@1800000000 {
+      opp-microvolt = <1237500>;
+   };
+   opp@1700000000 {
+      opp-microvolt = <1200000>;
+   };
+   opp@1600000000 {
+      opp-microvolt = <1162500>;
+   };
+   opp@1500000000 {
+      opp-microvolt = <1125000>;
+   };
+   opp@1400000000 {
+      opp-microvolt = <1100000>;
+   };
+   opp@1300000000 {
+      opp-microvolt = <1087500>;
+   };
+   opp@1200000000 {
+      opp-microvolt = <1062500>;
+   };
+   opp@1100000000 {
+      opp-microvolt = <1037500>;
+   };
+   opp@1000000000 {
+      opp-microvolt = <1012500>;
+   };
+   opp@900000000 {
+      opp-microvolt = <987500>;
+   };
+   opp@800000000 {
+      opp-microvolt = <962500>;
+   };
+   opp@700000000 {
+      opp-microvolt = <937500>;
+   };
+   opp@600000000 {
+      opp-hz = /bits/ 64 <600000000>;
+      opp-microvolt = <900000>;
+      clock-latency-ns = <140000>;
+   };
+   opp@500000000 {
+      opp-hz = /bits/ 64 <500000000>;
+      opp-microvolt = <900000>;
+      clock-latency-ns = <140000>;
+   };
+   opp@400000000 {
+      opp-hz = /bits/ 64 <400000000>;
+      opp-microvolt = <900000>;
+      clock-latency-ns = <140000>;
+   };
+   opp@300000000 {
+      opp-hz = /bits/ 64 <300000000>;
+      opp-microvolt = <900000>;
+      clock-latency-ns = <140000>;
+   };
+   opp@200000000 {
+      opp-hz = /bits/ 64 <200000000>;
+      opp-microvolt = <900000>;
+      clock-latency-ns = <140000>;
+   };
+};
+
+&cluster_a7_opp_table {
+   opp@1300000000 {
+      opp-hz = /bits/ 64 <1300000000>;
+      opp-microvolt = <1250000>;
+      clock-latency-ns = <140000>;
+   };
+   opp@1200000000 {
+      opp-microvolt = <1200000>;
+   };
+   opp@1100000000 {
+      opp-microvolt = <1162500>;
+   };
+   opp@1000000000 {
+      opp-microvolt = <1125000>;
+   };
+   opp@900000000 {
+      opp-microvolt = <1087500>;
+   };
+   opp@800000000 {
+      opp-microvolt = <1050000>;
+   };
+   opp@700000000 {
+      opp-microvolt = <1012500>;
+   };
+   opp@600000000 {
+      opp-microvolt = <975000>;
+   };
+   opp@500000000 {
+      opp-hz = /bits/ 64 <500000000>;
+      opp-microvolt = <937500>;
+      clock-latency-ns = <140000>;
+   };
+   opp@400000000 {
+      opp-hz = /bits/ 64 <400000000>;
+      opp-microvolt = <925000>;
+      clock-latency-ns = <140000>;
+   };
+   opp@300000000 {
+      opp-hz = /bits/ 64 <300000000>;
+      opp-microvolt = <900000>;
+      clock-latency-ns = <140000>;
+   };
+   opp@200000000 {
+      opp-hz = /bits/ 64 <200000000>;
+      opp-microvolt = <900000>;
+      clock-latency-ns = <140000>;
+   };
+};
+
+#else
+
 &cluster_a15_opp_table {
    opp@2000000000 {
       opp-hz = /bits/ 64 <2000000000>;
@@ -35,13 +152,13 @@
       clock-latency-ns = <140000>;
    };
    opp@1800000000 {
-      opp-microvolt = <1312500>;
+      opp-microvolt = <1200000>;
    };
    opp@1700000000 {
-      opp-microvolt = <1312500>;
+      opp-microvolt = <1162500>;
    };
    opp@1600000000 {
-      opp-microvolt = <1312500>;
+      opp-microvolt = <1125000>;
    };
    opp@1500000000 {
       opp-microvolt = <1087500>;
@@ -53,7 +170,7 @@
       opp-microvolt = <1050000>;
    };
    opp@1200000000 {
-      opp-microvolt = <1050000>;
+      opp-microvolt = <1025000>;
    };
    opp@1100000000 {
       opp-microvolt = <1000000>;
@@ -98,6 +215,11 @@
 };
 
 &cluster_a7_opp_table {
+   opp@1400000000 {
+      opp-hz = /bits/ 64 <1400000000>;
+      opp-microvolt = <1275000>;
+      clock-latency-ns = <140000>;
+   };
    opp@1300000000 {
       opp-hz = /bits/ 64 <1300000000>;
       opp-microvolt = <1225000>;
@@ -146,6 +268,8 @@
    };
 };
 
+#endif
+
 &mfc {
    compatible = "samsung,mfc-v8";
 };
--
2.7.4

DarkBahamut
 
Posts: 229
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby Aeronaut » Sun Mar 12, 2017 8:32 pm

Some feedback:
SMB Performance ~80MB/s from USB3 HDD (ext4 formated) - Superb!

Please activate module:
snd-usb-audio

Thx!
Aeronaut
 
Posts: 11
Joined: Mon Aug 31, 2015 6:38 pm
languages_spoken: english, german
ODROIDs: ODROID-XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby elatllat » Mon Mar 13, 2017 12:14 am

Linux 4.9.14 has a conflicting change in drivers/usb/host/xhci-plat.c so maybe the new (currently reverted) method can be made to work... have not really looked at it.
elatllat
 
Posts: 494
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby Aeronaut » Mon Mar 13, 2017 5:35 am

Ehm I built the snd-usb-audio Module from kernel source...
But after modprobe dmesg logs:

Code: Select all
[31743.860333] snd_usbmidi_lib: Unknown symbol snd_rawmidi_receive (err 0)
[31743.860345] snd_usbmidi_lib: Unknown symbol snd_rawmidi_transmit_empty (err 0)
[31743.860354] snd_usbmidi_lib: Unknown symbol snd_rawmidi_transmit (err 0)
[31743.860389] snd_usbmidi_lib: Unknown symbol snd_rawmidi_transmit_ack (err 0)
[31743.860408] snd_usbmidi_lib: Unknown symbol snd_rawmidi_transmit_peek (err 0)
[31743.860429] snd_usbmidi_lib: Unknown symbol snd_rawmidi_new (err 0)
[31743.860436] snd_usbmidi_lib: Unknown symbol snd_rawmidi_set_ops (err 0)


Is it currently brocken, or is it my mistake?

I'm not that experienced with Kernel building and Modules and how they work together... I built the module this way:
wget & unzip kernel source from https://github.com/hardkernel/linux/tre ... dxu4-4.9.y
$ make menuconfig
selected Device Drivers ---> Sound card support ---> Advanced Linux Sound Architecture ---> USB sound devices ---> <M> USB Audio/MIDI driver
$ vi Makefile -> EXTRAVERSION = -16
$ make modules
$ mkdir /lib/modules/4.9.13-16/kernel/sound/usb && cp sound/usb/*.ko /lib/modules/4.9.13-16/kernel/sound/usb
$ depmod -a
$ modprobe snd-usb-audio
modprobe: ERROR: could not insert 'snd_usb_audio': Unknown symbol in module, or unknown parameter (see dmesg)

So the Kernel from apt repository is used and just the new builded modules copied... Isn't that correct?
Aeronaut
 
Posts: 11
Joined: Mon Aug 31, 2015 6:38 pm
languages_spoken: english, german
ODROIDs: ODROID-XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby DarkBahamut » Mon Mar 13, 2017 5:35 am

elatllat wrote:Linux 4.9.14 has a conflicting change in drivers/usb/host/xhci-plat.c so maybe the new (currently reverted) method can be made to work... have not really looked at it.


I guess this is conflicting: https://git.kernel.org/pub/scm/linux/ke ... 684fe0a63e

Sound like it's trying to do a similar thing that we previously patched, though by moving a different portion of code. I'll test it and see if that method works for us, and if not what will work.

Edit:

I've tested it and this commit fails to merge for a few reasons, mainly because the xchi-plat file contains some Samsung custom patches to enable the USB3 to work correctly on the XU4/Exynos 5422. The above commit does work if you manually merge it (and revert our fix), however it's purpose is to just fix something we've already fixed ourselves, albeit by moving a slightly different piece of code. On that basis that this only fixes something we've already fixed, and that anything touching this code will always fail to merge anyway due to the presence of other changes/patches it likely makes most sense to just skip it :)
DarkBahamut
 
Posts: 229
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby joaofl » Tue Mar 14, 2017 2:03 am

meveric wrote:@johnvick
you need to alter /etc/fstab
change the entry for /dev/mmcblk0p1 to UUID=96C3-9298. (hopefully the UUID wasn't modified by Fourdee :))

@mdrjr
Could you change the Hardware identifier of the CPU please?
/proc/cpuinfo is currently saying something like Hardware : SAMSUNG EXYNOS (Flattened devicetree) or something similar.
Could you change this back to Hardware : ODROID-XU3 please? This is used in some scripts to identify the board.


@meveric

I've downloaded you latest compile of the kernel 4.9.13 (dating 2017-03-08). The correct cpuinfo was already there. So I installed it (dpkg -i). and changed the boot partition to the UUID you mentioned.
Rebooted it remotely, but its now refusing any connection (SSH, HTTP, etc...). So, since it is refusing, I guess the ethernet is actually working, but It seems that it did not boot properly.

Is there any way I can figure out why, and debug/fix it?

Thanks!

@all

for those experiencing overheating issues, I strongly suggest this good and cheap heatsink. It fits the XU4 with no problem, and cool it down to 35 Celsius when the fan switches on (in the rare cases that it actually does).

https://www.aliexpress.com/item/1-Piece ... 0.0.zXNNZ9
joaofl
 
Posts: 17
Joined: Sat Feb 27, 2016 2:29 am
Location: Portugal, Brasil
languages_spoken: english, portuguese, spanish
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby rooted » Tue Mar 14, 2017 2:33 am

You probably need to change the DTB entry in boot.ini

First try a cold boot (pull the power).
User avatar
rooted
 
Posts: 3652
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1
C1+
C2
XU3 Lite
XU4
VU7+
HiFi Shield 2
Smart Power (original)

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby joaofl » Tue Mar 14, 2017 4:57 am

The issue was actually due to wrong UUID. Update to the correct one, and worked.

However, when i type uname -a, I get:
Linux DietPi 3.10.104+ #1 SMP PREEMPT Tue Feb 21 14:20:54 CET 2017 armv7l GNU/Linux
Does it mean it did not update?

@rooted:
I changed the the DTB entry in boot.ini after, and it seems to work the same. Should I observe any difference?

@meveric
I'm only getting at most 30MB/s ethernet, like before. What should be done so one can get the gigabit performance mentioned by some users in this thread?

Sorry for dummies questions.
joaofl
 
Posts: 17
Joined: Sat Feb 27, 2016 2:29 am
Location: Portugal, Brasil
languages_spoken: english, portuguese, spanish
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby meveric » Tue Mar 14, 2017 7:16 am

well glad you figured out that DietPi uses a different UUID.
I don't know about the network issue..
about the uname -a
go to /boot/ and check the file sizes.
Especially zImage and vzlinuz-4.9.13 if they do not match.. copy vzlinuz-4.9.13 and rename it to zImage.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7416
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby phaseshifter » Tue Mar 14, 2017 5:37 pm

i would like the "spi" and "fbtft" for the l.c.d on the cloud shell..
please excuse me if i am not 100% certain of the correct kernel mods here..thanks phase...here is the dmesg of the boot up

[ 5.667381] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 5.685837] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[ 5.690692] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 5.712866] spi spi1.0: spidev spi1.0 1000kHz 8 bits mode=0x00
[ 5.720598] spi spi1.1: ads7846 spi1.1 1000kHz 8 bits mode=0x00
[ 5.721227] spi spi1.0: Deleting spi1.0
[ 5.721675] spi spi1.0: Failed to get /CS gpio [190]: -16
[ 5.721695] s3c64xx-spi 12d30000.spi:: can't setup spi1.0, status -16
[ 5.721727] spi_master spi1: spi_new_device() returned NULL
[ 5.721733] fbtft_device: failed to register SPI device
phaseshifter
 
Posts: 2089
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: opp sys.. ubuntu .kernel 4.9.xx.xx.c1+ ..c-2..xu3 lite,xu4...vu7,vu8,c-shell -II..c-shel-II,uart,hi-fi ,,hi-fi2,,show,w-board,6x16GB emmc`s 3.5 inch touch...other odroid acc`s as well

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby Aeronaut » Wed Mar 15, 2017 4:50 am

Ok, if somebody is interessted in getting USB Soundcards to work... It works now the way I did but you have to
make modules_install
instead of copying manually...
Aeronaut
 
Posts: 11
Joined: Mon Aug 31, 2015 6:38 pm
languages_spoken: english, german
ODROIDs: ODROID-XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby elatllat » Thu Mar 16, 2017 9:25 pm

Linux 4.9.15 is out, works well for me, please merge it.

Getting SMART data from UAS looks painful.
elatllat
 
Posts: 494
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby allanm84 » Fri Mar 17, 2017 8:52 am

My apologies for the noob question, but could someone post an example gstreamer pipeline(s) that shows h.264 encode/decode via MFC working with this release?
allanm84
 
Posts: 5
Joined: Tue Aug 09, 2016 5:43 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby memeka » Fri Mar 17, 2017 9:21 am

allanm84 wrote:My apologies for the noob question, but could someone post an example gstreamer pipeline(s) that shows h.264 encode/decode via MFC working with this release?


Hi, gstreamer does not have encoder support in official ubuntu package. Read viewtopic.php?f=146&t=24366 for details and patches about adding encoding support.

Gstreamer 1.6 and 1.8 have v4l2 (mfc decoding) not configured by default by debian or ubuntu (probably overlooked in packaging). So you also need to recompile for decoder support with the flags "--enable-v4l2-probe --disable-libv4l2". In Gstreamer 1.4 and 1.10, v4l2 is enabled by default, but you still need to recompile with "--disable-libv4l2" for MFC to be accessed directly - using libv4l2 does not work well with MFC sometimes.
I am not sure the HK image has recompiled gstreamer with these options. Better check with: gst-inspect-1.0 | grep v4l2 and see if there is any v4l2 "-dec" component.

Nevertheless, here's are some pipelines:

decode:
Code: Select all
gst-launch-1.0 filesrc location=file.mp4 ! qtdemux ! h264parse ! v4l2video10dec ! fakesink

replace fakesink with the actual output you want to display the movie on (e.g. glimagesink or clutterautovideosink for opengl-accelerated display, or ximagesink for non-accelerated low-fps x11 window).

encode:
Code: Select all
gst-launch-1.0 filesrc location=file.mp4 ! qtdemux ! h264parse ! v4l2video10dec ! v4l2video11h264enc extra-controls="encode,h264_level=11,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=4097152" ! h264parse ! matroskamux ! filesink location=file.mkv

decodes file.mp4 using MFC, then re-encodes it with 4M bitrate, h264 High@L4.0 into file.mkv
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby mientus » Fri Mar 17, 2017 3:42 pm

Apologies for another noob question but how do I change Gstreamer version after compilation?
By default my Odroid XU4 has Gstreamer 1.8.2 installed. What I did was to clone the newest Gstreamer repositories, compile it but after "make install" only gst-inspect-1.0 and gst-launch-1.0 are in 1.11.2 version but Gstreamer and all its plugins are still at 1.8.2...
I tried also to unsinstall Gstreamer 1.8.2 but I probably did something wrong because after reboot Ubuntu Mate didn't start but instead Kodi.
Please help good people :)
mientus
 
Posts: 3
Joined: Fri Mar 03, 2017 6:16 pm
languages_spoken: english, polish
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby memeka » Fri Mar 17, 2017 5:26 pm

As you installed gstreamer from git, you need to install gst-plugins-base -good and -bad.
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby bhlc » Mon Mar 20, 2017 4:52 am

Hey team,

Thanks for making this image!

I use a program called Exagear to run i386 applications like Spotify on my Odroid XU4. I noticed that since the kernel upgrade I'm no longer able to do much in the Exagear guest environment. It seems to be partially related to BINFMT_MISC not existing or not configured correctly. Is this a kernel module that was excluded? If so, am I able to install through apt-get? In the old images with kernel 3.x it worked quite well.

Thanks!
bhlc
 
Posts: 5
Joined: Mon Mar 20, 2017 4:47 am
languages_spoken: english
ODROIDs: ODROID XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby Hossie » Tue Mar 21, 2017 2:08 am

Hossie
 
Posts: 3
Joined: Tue Feb 28, 2017 1:10 am
languages_spoken: english, german
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby bhlc » Tue Mar 21, 2017 5:39 am



Is there a reason it was changed from the 3.x kernel? Should I aim to compile the kernel myself with it enabled or could this be set in the next image?
bhlc
 
Posts: 5
Joined: Mon Mar 20, 2017 4:47 am
languages_spoken: english
ODROIDs: ODROID XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby mdrjr » Tue Mar 21, 2017 6:37 am

It will be present on the next kernel update :)
mdrjr
Site Admin
 
Posts: 11620
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby bhlc » Tue Mar 21, 2017 9:39 am

mdrjr wrote:It will be present on the next kernel update :)


Thank you very much!
bhlc
 
Posts: 5
Joined: Mon Mar 20, 2017 4:47 am
languages_spoken: english
ODROIDs: ODROID XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby joaofl » Wed Mar 22, 2017 8:51 am

DarkBahamut wrote:Just a word on XU4 NAS performance with a lightly tweaked 4.9.11 kernel.

It's bonkers :shock:

990 Mbps / 115MB/s. I don't think there's much left in that gigabit network link :lol:

Ok, it is an eMMC read, but it's still ever so slightly faster than I can get 3.10 to go, and I'm only stock clocks (1.4/2.0). The XU4 really excels for this use.



What do you mean by "lightly tweaked"? Can you specify what to tweak? I can only get 65Mb/s for USB3 and 92MB/s ethernet, and I'm absolutely sure It can do much better.
joaofl
 
Posts: 17
Joined: Sat Feb 27, 2016 2:29 am
Location: Portugal, Brasil
languages_spoken: english, portuguese, spanish
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby elatllat » Thu Mar 23, 2017 12:55 am

joaofl wrote:...I can only get ... 92MB/s ethernet...


The kernel I'm using is just the one from HK with debug & touch screens disabled, a few bugs fixed, and the latest from kernel.org merged in.
With that I get 937 Mb/s (117 MB/s), Obviously iperf depends on your network switch/router and the server you test from, nigher of mine are anything special.

Code: Select all
> iperf -c 192.168.0.113
------------------------------------------------------------
Client connecting to 192.168.0.113, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.110 port 37848 connected with 192.168.0.113 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.08 GBytes   937 Mbits/sec

> uname -r
4.9.17-00232-g99d8f52
elatllat
 
Posts: 494
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby rooted » Thu Mar 23, 2017 5:26 am

elatllat wrote:
joaofl wrote:...I can only get ... 92MB/s ethernet...


The kernel I'm using is just the one from HK with debug & touch screens disabled, a few bugs fixed, and the latest from kernel.org merged in.
With that I get 937 Mb/s (117 MB/s), Obviously iperf depends on your network switch/router and the server you test from, nigher of mine are anything special.

Code: Select all
> iperf -c 192.168.0.113
------------------------------------------------------------
Client connecting to 192.168.0.113, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.110 port 37848 connected with 192.168.0.113 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.08 GBytes   937 Mbits/sec

> uname -r
4.9.17-00232-g99d8f52

I can't see it being any better, that's right about good as gigabit gets and impressive for the device.
User avatar
rooted
 
Posts: 3652
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1
C1+
C2
XU3 Lite
XU4
VU7+
HiFi Shield 2
Smart Power (original)

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby tmihai20 » Thu Mar 23, 2017 5:25 pm

How close is HK to releasing an Ubuntu 16.04 image with 4.9 kernel officially? Or better said, how can we upgrade to an official release once it will be available? I started being more and more unhappy with my OMV installation (I just upgraded to OMV 3.x). I will give DietPi a spin before installing this image. I am getting mixed network transfer speeds, but what bothers me the most is that my XU4 is getting hotter and hotter at very low CPU usage (20-30%). Maybe I have to install OMV 3.x from scratch.

TL:DR How close is HK to releasing an official Ubuntu 16.04 image with 4.9 kernel or how easy will it be to upgrade from this test Ubuntu image to the official one?
Riddle me this, riddle me that
Who is afraid of the big, black bat?
I write (in Romanian mostly) on a blog (see my profile)
tmihai20
 
Posts: 49
Joined: Mon Nov 07, 2016 10:56 pm
Location: Romania
languages_spoken: english, french, italian, romanian
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby elatllat » Thu Mar 23, 2017 7:01 pm

tmihai20 wrote:how easy will it be to upgrade from this test Ubuntu image to the official one?

Just
Code: Select all
apt upgrade
likely (might require a power off is USB changes significantly).

tmihai20 wrote:... OMV 3.x ... my XU4 is getting hotter and hotter at very low CPU usage (20-30%)...

AFAIK OMV is just a web UI for some common Linux packages, and 3.x is unstable.
While Ubuntu 16.04.2 and Linux 4.9 are quite stable your heat issue might be unavoidable if you chose to use bloated software ontop of it.
So grab a spare sdcard and try it out, if the issue persists report what is chewing up 30% of your CPU.
elatllat
 
Posts: 494
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby tmihai20 » Thu Mar 23, 2017 7:20 pm

elatllat wrote:AFAIK OMV is just a web UI for some common Linux packages, and 3.x is unstable.
While Ubuntu 16.04.2 and Linux 4.9 are quite stable your heat issue might be unavoidable if you chose to use bloated software ontop of it.
So grab a spare sdcard and try it out, if the issue persists report what is chewing up 30% of your CPU.


I have only manually installed deluge from Debian repos and activated Fail2Ban, miniDLNA as plugins for OMV. My XU4 was kinda hot with 2.x as well (around 50 degress Celsius with the same CPU usage) and I had even less packages installed there (deluge was still present). And the average CPU usage is around 20 percent because I have connected an external HDD formatted as NTFS (for Windows compatibility). I intend to change the stock heatsink+fan as soon as possible, but this part is a little offtopic.

By update I meant updating the kernel to a stable version when available.
Riddle me this, riddle me that
Who is afraid of the big, black bat?
I write (in Romanian mostly) on a blog (see my profile)
tmihai20
 
Posts: 49
Joined: Mon Nov 07, 2016 10:56 pm
Location: Romania
languages_spoken: english, french, italian, romanian
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby mad_ady » Thu Mar 23, 2017 7:57 pm

50-60C are normal temperatures. I get them on my XU4 with the blue heatsink and a noctua fan with an ambient temperature of ~28C.
Regarding kernel updates - I'm sure it will be easy in any HK distro (they will either change linux-kernel-xu3 to 4.9, or introduce an alternative package and support both kernels)
User avatar
mad_ady
 
Posts: 2062
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby memeka » Thu Mar 23, 2017 8:04 pm

While @Oversun posted his patch to fix kodi slowness in the kernel, for those that didn't update the kernel yet (and can build kodi), can you please try this patch:
http://paste.debian.net/923662/
and let me know the results.
If this works, maybe the kernel doesn't need to be patched :)
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby elatllat » Fri Mar 24, 2017 10:47 am

Better description of the smartctl+UAS issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1334569
Need to find a x86 with usb3 and test on the latest fedora and debian to see if it's an upstream bug...
elatllat
 
Posts: 494
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby Snk » Sat Mar 25, 2017 1:14 am

memeka wrote:While @Oversun posted his patch to fix kodi slowness in the kernel, for those that didn't update the kernel yet (and can build kodi), can you please try this patch:
http://paste.debian.net/923662/
and let me know the results.
If this works, maybe the kernel doesn't need to be patched :)


Hello friend, is the fix for slowness in kodi already included in the update?
User avatar
Snk
 
Posts: 195
Joined: Sun Jul 31, 2016 6:43 am
languages_spoken: Portuguese
ODROIDs: XU4 + eMMC 32GB + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby memeka » Sat Mar 25, 2017 2:37 am

Snk wrote:
memeka wrote:While @Oversun posted his patch to fix kodi slowness in the kernel, for those that didn't update the kernel yet (and can build kodi), can you please try this patch:
http://paste.debian.net/923662/
and let me know the results.
If this works, maybe the kernel doesn't need to be patched :)


Hello friend, is the fix for slowness in kodi already included in the update?


It should be fixed already just update the kernel
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby derko » Sat Mar 25, 2017 4:54 am

Hi. Can somebody post the instructions to build kodi again, please ?

I want to compile it with CEC support, this is, for me, the last thing missing. Apart from that, the whole system works super stable since 2 weeks now.

EDIT: Just found it viewtopic.php?f=99&t=26300. Thx

EDIT2: Could you enable the modules needed to use CEC ? (/dev/CEC) is missing for me.
derko
 
Posts: 52
Joined: Tue Jul 14, 2015 2:16 am
languages_spoken: englisch, german
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby elatllat » Sat Mar 25, 2017 7:12 am

derko wrote:... modules needed to use CEC ?...

Code: Select all
CONFIG_MEDIA_CEC_EDID=y
CONFIG_EXYNOS_HDMI_CEC=y
# CONFIG_MEDIA_CEC is not set

looks like 2/3 are enabled maybe there is another interface ...
elatllat
 
Posts: 494
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby odroid » Sat Mar 25, 2017 7:26 am

As far as I remember, the CEC function worked on Kernel 4.9.
You might need to change the CEC option in boot.ini file.
setenv cecenable "true"
User avatar
odroid
Site Admin
 
Posts: 23714
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby Snk » Sat Mar 25, 2017 10:32 am

memeka wrote:
Snk wrote:
memeka wrote:While @Oversun posted his patch to fix kodi slowness in the kernel, for those that didn't update the kernel yet (and can build kodi), can you please try this patch:
http://paste.debian.net/923662/
and let me know the results.
If this works, maybe the kernel doesn't need to be patched :)


Hello friend, is the fix for slowness in kodi already included in the update?


It should be fixed already just update the kernel


I updated the kernel, but now kodi closes when opening any apps (Twitch or Youtube)
Will HK update to Kodi 17.1?
User avatar
Snk
 
Posts: 195
Joined: Sun Jul 31, 2016 6:43 am
languages_spoken: Portuguese
ODROIDs: XU4 + eMMC 32GB + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby crashoverride » Sun Mar 26, 2017 5:53 am

memeka wrote:If this works, maybe the kernel doesn't need to be patched

Is there any reason why Kodi has not been patched instead? The kernel patch alters the behavior of V4L for everything and would require far more extensive testing to ensure it does not break capture, camera, DVB, ATSC tuner (current/future) drivers.

The problem description is here:
http://forum.odroid.com/viewtopic.php?f=146&t=26099#p181278
The patch being discussed is here:
https://github.com/hardkernel/linux/commit/38ab74ee2dc01a698353bbcc585f90c2afd4e1e8

TL;DR = Kodi uses the seconds/microseconds (timestamp) to store data (PTS).
crashoverride
 
Posts: 2974
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby OverSun » Sun Mar 26, 2017 6:09 am

the reason was that it provided better results without any drawbacks
User avatar
OverSun
 
Posts: 1238
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby crashoverride » Sun Mar 26, 2017 6:31 am

OverSun wrote:without any drawbacks

The immediate drawback that I can think of is that it will prevent Kodi use with the V4L media_build tree (since it replaces/updates V4L).

https://www.linuxtv.org/wiki/index.php/Media_build
Media_build is a build system for media drivers. It can be used to add the latest drivers for your system without actually updating the kernel.
crashoverride
 
Posts: 2974
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby OverSun » Sun Mar 26, 2017 6:53 am

does it use very often?
User avatar
OverSun
 
Posts: 1238
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby crashoverride » Sun Mar 26, 2017 7:11 am

OverSun wrote:does it use very often?

Its important to anyone using TV tuners. Considering all the Exynos codecs are also contained in it, it will likely be increasingly important to XU3/4 as time progresses.
crashoverride
 
Posts: 2974
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby OverSun » Sun Mar 26, 2017 7:56 am

Does it actually being done because they have their own patches in it the vanilla kernel doesn't? It's just a question whose patches are more tasty.
You guys seems so don't like the idea of packing and unpacking bits without even touching them and eager so much to do the precision loosing math with doubles tossing them around, that I've received the same question over and over - why kernel and not kodi.
Well, the kernel works for me right aways without any side effects, while the math doesn't at first, and even when it does I see how things could go wrong in corner cases.
I'm not really insisting on anything on that topic, I'm just saying that this patched worked for me flawlessly.
You can do whatever you want to be doing with the code.
User avatar
OverSun
 
Posts: 1238
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby memeka » Sun Mar 26, 2017 8:25 am

The reason why I am keeping a separate kernel tree and didn't apply Oversun' patch on it (or other HK patches I deemed useless) is that I want to keep as close mainline as possible.
Right now I can rebase the 4.11 kernel with only a few modifications, which is not the case for HKs kernel. So my objection is not for 4.9 necessarily, but for the future.
Also I have a tuner I wanna use. This is why I bothered doing the kodi patch.
Obviously using the conversion there might be precision loss that's why my kodi patch needs more testing :)
But so far nobody else tested it but me :)
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby crashoverride » Sun Mar 26, 2017 9:11 am

memeka wrote:Obviously using the conversion there might be precision loss

There are 32bits (signed) to represent seconds:
0x7fffffff = 2147483647 seconds = 68.09625973491 years

The PTS value represents a time. The most logical course is to convert it to/from seconds:

Code: Select all
double time = PTS / (double)PTS_PER_SECONDS;
int seconds = (int)floor(time);
uint microseconds = (uint)((time - seconds) * 1000000);

Code: Select all
uint64_t pts = (seconds + (microseconds / 1000000.0)) * PTS_PER_SECOND;


(Note: fake code above intended to illustrate the process, not compile)

[edit]
I checked the kernel code and the seconds is actually un-signed:
0xffffffff = 4294967295 seconds = 136.1925195015 years
Last edited by crashoverride on Sun Mar 26, 2017 10:09 am, edited 1 time in total.
crashoverride
 
Posts: 2974
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby memeka » Sun Mar 26, 2017 10:07 am

Which is what I've done :)
Non fake code here https://github.com/mihailescu2m/xbmc/co ... 8930d9db8d
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby crashoverride » Sun Mar 26, 2017 10:41 am

memeka wrote:Non fake code here https://github.com/mihailescu2m/xbmc/co ... 8930d9db8d

It looks like PTS is already a "double" so that makes conversion very simple.

Code: Select all
+      m_Buffer->timeStamp.tv_sec = ((int64_t)(pts*1.0)) / INT64_C(1000000);

That should probably use the "floor" function to avoid integer rounding. If PTS is a "double" and measures seconds (1.0 = 1 second), dividing it by 1,000,000 will cause a massive loss in precision.

For PTS that measure seconds, it should be:
Code: Select all
+      m_Buffer->timeStamp.tv_sec = (uint32_t)floor(pts);
+      m_Buffer->timeStamp.tv_usec = (uint32_t)((pts - floor(pts)) * 1000000); // Integer rounding here is insignificant

(more fake code above)
crashoverride
 
Posts: 2974
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Ubuntu 16.04.2 trial image to play with 4.9.x LTS Kernel

Unread postby memeka » Sun Mar 26, 2017 11:21 am

crashoverride wrote:
memeka wrote:Non fake code here https://github.com/mihailescu2m/xbmc/co ... 8930d9db8d

It looks like PTS is already a "double" so that makes conversion very simple.

Code: Select all
+      m_Buffer->timeStamp.tv_sec = ((int64_t)(pts*1.0)) / INT64_C(1000000);

That should probably use the "floor" function to avoid integer rounding. If PTS is a "double" and measures seconds (1.0 = 1 second), dividing it by 1,000,000 will cause a massive loss in precision.

For PTS that measure seconds, it should be:
Code: Select all
+      m_Buffer->timeStamp.tv_sec = (uint32_t)floor(pts);
+      m_Buffer->timeStamp.tv_usec = (uint32_t)((pts - floor(pts)) * 1000000); // Integer rounding here is insignificant

(more fake code above)


you realize for positive number the integer conversion is the same as floor() :)
also i made that patch a few days ago and all tests i've done until now (and movies i've seen) have been good :)
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

PreviousNext

Return to Linux Kernel 4.9 Debugging Party

Who is online

Users browsing this forum: No registered users and 2 guests