Experimenting with ACEPC T5

11-06-2018 - 10 minutes, 30 seconds -

Introduction
I have been successfully using an N3700, mini-ITX based computer as an HTPC to drive my living room TV. However, very soon in the future I will have multiple TVs, so I will need a cheaper device to drive them. After browsing on Amazon, I spotted ACEPC T5 which appears to be a knockoff of Intel's Compute Stick. It comes in a small form factor and has Wifi/Bluetooth, HDMI, and eMMC storage at a little over $100 so on paper it fits my requirements. Unfortunately, I encountered yet another case of "you do get what you pay for".

Booting up
The first thing out of the gate that I encountered was BSOD bootloop. I could have just packed everything up and returned it, but I decided to press on. The first thing I did was backup the Windows serial key:

sudo cat /sys/firmware/acpi/tables/MSDM

Next, I installed vanilla Ubuntu 18.04 (64 bit) minimal. Here is what I saw when I poked around the device:

sbobovyc@tv1:~$ cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 76
model name  : Intel(R) Atom(TM) x5-Z8350  CPU @ 1.44GHz
stepping    : 4
microcode   : 0x40a
cpu MHz     : 488.221
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 4
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb pti tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat
bugs        : cpu_meltdown spectre_v1 spectre_v2
bogomips    : 2880.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:
sbobovyc@tv1:~$ lscpu 
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               76
Model name:          Intel(R) Atom(TM) x5-Z8350  CPU @ 1.44GHz
Stepping:            4
CPU MHz:             641.752
CPU max MHz:         1920.0000
CPU min MHz:         480.0000
BogoMIPS:            2880.00
Virtualization:      VT-x
L1d cache:           24K
L1i cache:           32K
L2 cache:            1024K
NUMA node0 CPU(s):   0-3
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb pti tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat
sbobovyc@tv1:~$ lspci 
00:00.0 Host bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SoC Transaction Register (rev 36)
00:02.0 VGA compatible controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Configuration Registers (rev 36)
00:03.0 Multimedia controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Imaging Unit (rev 36)
00:0b.0 Signal processing controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Power Management Controller (rev 36)
00:14.0 USB controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series USB xHCI Controller (rev 36)
00:1a.0 Encryption controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Trusted Execution Engine (rev 36)
00:1f.0 ISA bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCU (rev 36)
sbobovyc@tv1:~$ lsusb 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
sbobovyc@tv1:~$ lsblk 
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0          7:0    0 86.6M  1 loop /snap/core/4486
loop1          7:1    0  140M  1 loop /snap/gnome-3-26-1604/59
loop2          7:2    0  1.6M  1 loop /snap/gnome-calculator/154
loop3          7:3    0 12.2M  1 loop /snap/gnome-characters/69
loop4          7:4    0   21M  1 loop /snap/gnome-logs/25
loop5          7:5    0  3.3M  1 loop /snap/gnome-system-monitor/36
mmcblk0      179:0    0 29.1G  0 disk 
├─mmcblk0p1  179:1    0  512M  0 part /boot/efi
└─mmcblk0p2  179:2    0 28.6G  0 part /
mmcblk0boot0 179:8    0    4M  1 disk 
mmcblk0boot1 179:16   0    4M  1 disk 
sbobovyc@tv1:~$ sudo lshw 
tv1                         
    description: Tablet
    product: To be filled by O.E.M. (T8)
    vendor: To be filled by O.E.M.
    version: Default string
    serial: Default string
    width: 64 bits
    capabilities: smbios-3.0 dmi-3.0 smp vsyscall32
    configuration: boot=normal chassis=tablet family=To be filled by O.E.M. sku=T8 uuid=00020003-0004-0005-0006-000700080009
  *-core
       description: Motherboard
       product: To be filled by O.E.M.
       vendor: To be filled by O.E.M.
       physical id: 0
       version: 1.0
       serial: Default string
       slot: Default string
     *-firmware
          description: BIOS
          vendor: American Megatrends Inc.
          physical id: 0
          version: 1.000
          date: 09/01/2017
          size: 64KiB
          capacity: 4032KiB
          capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int14serial int17printer acpi usb biosbootspecification uefi
     *-memory
          description: System Memory
          physical id: 28
          slot: System board or motherboard
          size: 2GiB
          capabilities: ecc
          configuration: errordetection=multi-bit-ecc
        *-bank:0
             description: DIMM DDR3 1066 MHz (0.9 ns)
             product: 00000000
             vendor: Hynix Semiconductor
             physical id: 0
             serial: 00000000
             slot: A1_DIMM0
             size: 2GiB
             width: 8 bits
             clock: 1066MHz (0.9ns)
        *-bank:1
             description: DIMM [empty]
             product: 00000000
             vendor: Hynix Semiconductor
             physical id: 1
             serial: 00000000
             slot: A1_DIMM1
     *-cache:0
          description: L1 cache
          physical id: 32
          slot: CPU Internal L1
          size: 224KiB
          capacity: 224KiB
          capabilities: internal write-back
          configuration: level=1
     *-cache:1
          description: L2 cache
          physical id: 33
          slot: CPU Internal L2
          size: 2MiB
          capacity: 2MiB
          capabilities: internal write-back unified
          configuration: level=2
     *-cpu
          description: CPU
          product: Intel(R) Atom(TM) x5-Z8350  CPU @ 1.44GHz
          vendor: Intel Corp.
          physical id: 34
          bus info: cpu@0
          version: Intel(R) Atom(TM) x5-Z8350 CPU @ 1.44GHz
          slot: SOCKET 0
          size: 664MHz
          capacity: 2400MHz
          width: 64 bits
          clock: 80MHz
          capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb pti tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat cpufreq
          configuration: cores=4 enabledcores=4 threads=4
     *-pci
          description: Host bridge
          product: Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SoC Transaction Register
          vendor: Intel Corporation
          physical id: 100
          bus info: pci@0000:00:00.0
          version: 36
          width: 32 bits
          clock: 33MHz
          configuration: driver=iosf_mbi_pci
          resources: irq:0
        *-display
             description: VGA compatible controller
             product: Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Configuration Registers
             vendor: Intel Corporation
             physical id: 2
             bus info: pci@0000:00:02.0
             version: 36
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi vga_controller bus_master cap_list rom
             configuration: driver=i915 latency=0
             resources: irq:118 memory:90000000-90ffffff memory:80000000-8fffffff ioport:f000(size=64) memory:c0000-dffff
        *-multimedia UNCLAIMED
             description: Multimedia controller
             product: Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Imaging Unit
             vendor: Intel Corporation
             physical id: 3
             bus info: pci@0000:00:03.0
             version: 36
             width: 32 bits
             clock: 33MHz
             capabilities: pm msi cap_list
             configuration: latency=0
             resources: memory:91000000-913fffff
        *-generic:0
             description: Signal processing controller
             product: Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Power Management Controller
             vendor: Intel Corporation
             physical id: b
             bus info: pci@0000:00:0b.0
             version: 36
             width: 64 bits
             clock: 33MHz
             capabilities: msi pm cap_list
             configuration: driver=proc_thermal latency=0
             resources: irq:122 memory:9183b000-9183bfff
        *-usb
             description: USB controller
             product: Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series USB xHCI Controller
             vendor: Intel Corporation
             physical id: 14
             bus info: pci@0000:00:14.0
             version: 36
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi xhci bus_master cap_list
             configuration: driver=xhci_hcd latency=0
             resources: irq:116 memory:91800000-9180ffff
           *-usbhost:0
                product: xHCI Host Controller
                vendor: Linux 4.15.0-23-generic xhci-hcd
                physical id: 0
                bus info: usb@1
                logical name: usb1
                version: 4.15
                capabilities: usb-2.00
                configuration: driver=hub slots=7 speed=480Mbit/s
              *-usb
                   description: Keyboard
                   product: Multimedia Air Mouse Keyboard
                   physical id: 4
                   bus info: usb@1:4
                   version: 3.01
                   capabilities: usb-2.00
                   configuration: driver=snd-usb-audio maxpower=160mA speed=12Mbit/s
           *-usbhost:1
                product: xHCI Host Controller
                vendor: Linux 4.15.0-23-generic xhci-hcd
                physical id: 1
                bus info: usb@2
                logical name: usb2
                version: 4.15
                capabilities: usb-3.00
                configuration: driver=hub slots=6 speed=5000Mbit/s
        *-generic:1
             description: Encryption controller
             product: Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Trusted Execution Engine
             vendor: Intel Corporation
             physical id: 1a
             bus info: pci@0000:00:1a.0
             version: 36
             width: 32 bits
             clock: 33MHz
             capabilities: pm msi bus_master cap_list
             configuration: driver=mei_txe latency=0
             resources: irq:120 memory:91700000-917fffff memory:91600000-916fffff
        *-isa
             description: ISA bridge
             product: Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCU
             vendor: Intel Corporation
             physical id: 1f
             bus info: pci@0000:00:1f.0
             version: 36
             width: 32 bits
             clock: 33MHz
             capabilities: isa bus_master cap_list
             configuration: driver=lpc_ich latency=0
             resources: irq:0
  *-network
       description: Wireless interface
       physical id: 1
       logical name: wlan0
       serial: 38:a2:8c:XX:XX:XX
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rtl8723bs ip=192.168.0.103 multicast=yes wireless=IEEE 802.11bgn

Everything was functional except for sound:

sbobovyc@tv1:~$ cat /proc/asound/cards 
 0 [Audio          ]: HdmiLpeAudio - Intel HDMI/DP LPE Audio
                      Intel HDMI/DP LPE Audio
 2 [bytchtes8316   ]: bytcht-es8316 - bytcht-es8316
                      TobefilledbyO.E.M.-TobefilledbyO.E.M.-Defaultstring-TobefilledbyO.E.M.

I followed this guide to make sound work: https://linuxiumcomau.blogspot.com/2017/10/fixing-broken-hdmi-audio.html

In short, applying this patch to the pulse configuration will hardcode the sink device instead of letting it be detected dynamically.

sbobovyc@tv1:~$ diff -C 5 default.pa.bak /etc/pulse/default.pa 
*** default.pa.bak  2018-06-11 23:27:44.876118054 -0400
--- /etc/pulse/default.pa   2018-06-11 23:28:35.047393611 -0400
***************
*** 39,61 ****

  ### Load audio drivers statically
  ### (it's probably better to not load these drivers manually, but instead
  ### use module-udev-detect -- see below -- for doing this automatically)
  #load-module module-alsa-sink
  #load-module module-alsa-source device=hw:1,0
  #load-module module-oss device="/dev/dsp" sink_name=output source_name=input
  #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
  #load-module module-null-sink
  #load-module module-pipe-sink

! ### Automatically load driver modules depending on the hardware available
! .ifexists module-udev-detect.so
! load-module module-udev-detect
! .else
! ### Use the static hardware detection module (for systems that lack udev support)
! load-module module-detect
! .endif

  ### Automatically connect sink and source if JACK server is present
  .ifexists module-jackdbus-detect.so
  .nofail
  load-module module-jackdbus-detect channels=2
--- 39,62 ----

  ### Load audio drivers statically
  ### (it's probably better to not load these drivers manually, but instead
  ### use module-udev-detect -- see below -- for doing this automatically)
  #load-module module-alsa-sink
+ load-module module-alsa-sink device=hw:0,2
  #load-module module-alsa-source device=hw:1,0
  #load-module module-oss device="/dev/dsp" sink_name=output source_name=input
  #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
  #load-module module-null-sink
  #load-module module-pipe-sink

! #### Automatically load driver modules depending on the hardware available
! #.ifexists module-udev-detect.so
! #load-module module-udev-detect
! #.else
! #### Use the static hardware detection module (for systems that lack udev support)
! #load-module module-detect
! #.endif

  ### Automatically connect sink and source if JACK server is present
  .ifexists module-jackdbus-detect.so
  .nofail
  load-module module-jackdbus-detect channels=2

Since this is supposed to be a media device, I tested several services I use. Youtube at 1080p60 using vp9 was stuttering, so I used h264ify to force h265 codec and 30 fps to attain acceptable video quality. https://chrome.google.com/webstore/detail/h264ify/aleakchihdccplidncghkekgioiakgal?hl=en-US

I also encountered stuttering with Netflix but could not fix it.

This post provided interesting information on vainfo and vdpauinfo: https://blog.kylemanna.com/media/video-acceleration-with-vp9-and-h265/

sbobovyc@tv1:~$ cat vainfo.txt 
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD

I decided to try a few light weight desktop environments since Gnome was taking up almost 1.5 GB. Using Enlightenment desktop E21 brought memory usage down to 530 MB, but video playback did not improve and I did not like the interface. Using LUbuntu, memory usage was only 376 MB, but again video playback did not improve. Fundametally, video decode acceleration on Linux is not enabled in Chrome and requires a CPU that is more powerful than what this thing has to provide a good experience.

I decided to try Windows since Chrome does support hardware video decode on that OS. I installed Windows 10 from Microsoft ISO since the recovery ISO provided by ACEPC has the BSOD issue. Windows booted up but had many missing drivers that were not found in Windows Update. I dumped the recovery iso, found the driver cache, and pointed Windows driver installer to install drivers from there. Unfortunately, the wifi driver kept on crashing, making the thing useless. I found a driver on Realtek's website but installing that caused the BSOD bootloop. I dumped the recovery iso and found the driver cache, and pointed Windows driver installer to install drivers from there. Unfortunately, the wifi driver kept on crashing making the thing useless. I found a driver on Realtek's website, but installing that caused the BSOD bootloop.

Conclusion
Using a USB wifi adapter and Windows, I did manage to get acceptable video playback thanks to hardware accelerated decoding, in the end this thing is a piece of junk and I returned it.