Project

General

Profile

Actions

Action Item #769

closed

Add Player only system

Added by Hammel over 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
Systems
Target version:
Start date:
28 Jun 2020
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

This would be a light-weight Media System that only does the playing on B/B+ systems, so it boots faster.

Actions #1

Updated by Hammel over 1 year ago

  • Priority changed from High to Immediate
  • Severity changed from 02 - High to 01 - Critical
Actions #2

Updated by Hammel over 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10
There are several ways to do this.
  1. Implement an autokiosk-type mode in videofe/opkg/Makefile. This requires a new mode in metabuild too.
  2. Implement a kiosk-type mode in videofe/opkg/Makefile. This requires a new mode in metabuild too.
  3. A new mode in Metabuld only, that just integrates videofe and perhaps one or two other apps.

The autokiosk mode would boot fastest probably but not by much. The metabuild-only mode is easiest to implement and would probably look the best.

Actions #3

Updated by Hammel over 1 year ago

The metabuild option is the one I'm going to implement. It will require some additional pieces.
  1. Ironman's www with just the imwww component to allow setting up a node's connection using a phone but without IoT setup.
    1. This is done and pushed. Use the HW=piplayer build option.
  2. A new app, pinet, is needed to manually enable and disable network configuration mode.
    1. This is currently in development - see src/ximba/pinet
    2. When launched this app starts the imwww app and spins, waiting on user exit.
      1. This needs to setup AP networking too. That requires Ironman's monitor S40network script.
    3. On exit the imwww app is stopped.
    4. An animated spinner should be displayed while the app is running.
      1. See Threaded animation with Cairo
  3. Launcher with just vfe, musicfe and pinet and no right side splash.
    1. This needs a mode option (./cross.sh -m player) to change the way the display is formatted in the code.
    2. Launcher will need new code to support this new mode.
  4. piboxd with IoT and Webcam disabled.
    1. This exists but needs a build option (./cross.sh -m player) to configure these options in package installation.
Actions #4

Updated by Hammel over 1 year ago

comment deleted

Actions #5

Updated by Hammel over 1 year ago

I messed up here - the last two updates to this issue were for RM #794. So I moved them there. I've updated the comments here accordingly.
The Player only system build is not related to RM #794.

Actions #6

Updated by Hammel about 1 year ago

Current status

Initial implementation of a player metabuild is ready for testing. See meta 2 sandbox.

Pinet source has been started but is not ready for testing. Only the project structure has been created. No new code has been written for it yet.

Launcher changes have not been started.

Piboxd changes have not been started.

Actions #7

Updated by Hammel about 1 year ago

Current status

Initial implementation of a player metabuild is ready for testing. See meta 2 sandbox.
  • Need to add pinet to metabuild
Pinet has a project in GitLab and the code compiles into an app that simply spins a Cairo-based animation of the MIOT logo.
  • Needs to generate random password for AP
    • Need to add password login to "imwww".
    • pw gets stored by pinet in web dir, loaded by imwww, then removed by pinet on exit.
    • Need to test with imwww changes.
    • Need to test with AP mode too (same pw).
  • Needs to call pinet-ap.sh to bring up to AP mode
  • Needs to start imwww-
  • Starts animation with IP and password
  • On exit
    • Stop imwww
    • Restart /etc/init.d/S40network in normal mode
    • Remove AP password
    • Remove web server password

Launcher changes have not been started.

Piboxd changes have not been started.

Actions #8

Updated by Hammel about 1 year ago

  • % Done changed from 10 to 50

This is done. The system can be built from the metabuild.

It now needs to be tested on hardware.

Actions #9

Updated by Hammel about 1 year ago

Tested on hardware today.

  1. pinet animation is very slow. It needs to use the EGL backend, but I don't know how to make that happen.
    1. Update: It might be easier with a newer version of Buildroot. I need to enable mesa3d and the Gallium driver for vc4, at a minimum. Then make sure I can enable EGL in the Cairo build, which requires BR2_PACKAGE_HAS_LIBGLES enabled somehow.
    2. Update: attempted to preallocate translated/rotated images but that doesn't speed anything up. It would seem I will need the GPU (re: EGL) to make this go faster.
    3. Update: I increased the timer interval so it wasn't running as often - about 15 frames a second. This looks much better without the overhead of EGL on an RPi2. That should cover the animation slowness issue.
  2. imwww doesn't need a login screen after all but does need to run in pair mode while not enabling the AP configuration.
    1. pinet needs to
      1. mkdir /etc/gpio
      2. touch /etc/gpio/pair
      3. remove /etc/gpio/pair
    2. imwww needs
      1. to remove pw updates - it's too complex to use with "imwww".
      2. Remove the sensor configuration section using a stamp file set by pinet.
      3. Add option to runserver.sh to disable the AP configuration.
  3. runserver -K does not stop the running process. This may caused by the wrong command line arg (used -k but should have used -K (uppercase)) which causes a secondary instance to start. This is a bug in runserver.sh It should look for a running instance and, if found, kill it (or at least attempt to kill it) before starting a new session. Alternatively it could just log that it can't start because an existing session is already running.
  4. pinet has the picam launcher icon - needs the network icon.
  5. launcher shows all images very large. I need to change this to fit the height to 1/3 the display size and the width proportional to that. This will mean alternative translations in the launcher as well.
    1. This requires appmgr to use a specific appmgr.cfg that runs with mini-icons: /usr/bin/launcher -m
Actions #10

Updated by Hammel about 1 year ago

  • % Done changed from 50 to 60

All changes are implemented. Next: test on rpi2 and rpi3 test platforms.

Things that may need changing:
  1. pinet may want to check which platform its on and adjust animation accordingly.
  2. pinet may need to test that wifi supports AP and post error if it doesn't.
  3. pinet may want to test for available wifi and error if missing (by design, does not work with wired eth).
  4. launcher -m (mini-icons) may want to adjust between 1/2 and 1/3 display size based on display size.
Actions #11

Updated by Hammel about 1 year ago

  • % Done changed from 60 to 70
Testing:
  1. pinet needs to be privileged since it needs to restart networking (add to appmgr.priv)
  2. pinet does not create /etc/gpio/pair anymore. Not sure why yet.
  3. Icons are definitely too small, but without -m they are oversized.

Note: these are all ready to test again.

Actions #12

Updated by Hammel about 1 year ago

  • % Done changed from 70 to 80

The g_timeout isn't updating the launcher on the rpi2 (it did on the rpi3). I don't know if the 100ms happens before the screen is displayed on the rpi2 or what.

Increase the timeout and see what happens.

Note that a keypress - even just "shift" - will cause the highlight to get displayed.

Actions #13

Updated by Hammel about 1 year ago

  • % Done changed from 80 to 90

Increased timeout fixed that problem.

Still need one more test of the wifi config capability.

Actions #14

Updated by Hammel 12 months ago

Pinet isn't giving me debug output for some reason. And I can't connect to the pinet server to configure networking. Need to debug this more.

Update: I think this may be because a reinstall from SD on a Pi3 with a wifi dongle gets two wifi interfaces. The first is the broadcom which doesn't (I don't think) support client + ap mode. So it has to be disabled.

Launcher is not reporting the correct touch point on the RPi touchscreen. I don't know why yet.

Actions #15

Updated by Hammel 11 months ago

Launcher touch problem was because launcher.cfg had "rotate=1" set. I need to find out how that got in there.

Update: Fixed in launcher project by editing data/launcher.cfg.player.

Actions #16

Updated by Hammel 11 months ago

Disabling of onboard wifi for RPi3 is done by adding the following line to config.txt:

dtoverlay=pi3-disable-wifi

This has been tested and works. I need to add it as a config package update for piplayer.

pinet is not launchering imwww because the path to the init script was broken by re-setting a variable to the script after the proper path was set. I've fixed this in the source and tested on hardware and while imwww is now being launched it doesn't load.

Now I need to enable debug on imwww. This will be easier to do on the laptop where I can use ssh and wget for testing.

Actions #17

Updated by Hammel 11 months ago

I found the problem. It has to do with where the pair stamp file is created.

pinet needs to create the following directories on install:

/home/httpd/imwww
/home/httpd/imwww/data
/home/httpd/imwww/data/log

When run, it needs to create the following

/home/httpd/imwww/data/pair - to enable the web UI
/home/httpd/imwww/data/debug - to enable debugging. This should be a cli option to pinet.
Actions #18

Updated by Hammel 11 months ago

Changes for pinet committed and pushed. I need to rebuild the packages and install from scratch to retest.

Actions #19

Updated by Hammel 11 months ago

I retested with latest updates but there was still one more problem: the web UI showed the sensor configuration options. To disable this pinet needs to touch /home/httpd/imwww/data/noap.

Actions #20

Updated by Hammel 11 months ago

I had to rewrite the code that created the directories and stamp files, moving from system() calls to the equivalent C functions. This fixed problems I was having with startup.

All code tested and working, committed and pushed.

I need one last test: make sure the player can connect to a Media System and actually play the videos and audio. I need to load the last media system on the RPi2 in my office and connect a speaker to the RPi3 touchscreen to verify that. I should also load the player on an RPi2 though I don't think I have one other than the one I'm using for the Media System.

Actions #21

Updated by Hammel 11 months ago

Live testing exposed more problems.
  1. saveIPV4() is called by settings-write.php in imwww. This causes an error to pop up on the browser because those options are not set in the UI. The fix is to only call saveIPV4() if noap is not set.
  2. Exiting pinet is very slow. You can force it by hitting exit twice (ESC on keyboard or upper right on touchscreen). Because of this the network is not properly restarted. I need to either print notice that the network is restarting before exiting and/or disallow multiple exit requests.
  3. The network didn't come up the first time after a reboot. Manually running network restart a couple times made it work. This is probably a device problem.
  4. There is no information on wifi connection status. I need a Status app, I guess. Or have the launcher display the network status. This could display the IP and MAC addresses.

The first is already fixed and pushed. I need to dig into the pinet.c code to fix the others. The network restart problem probably needs a fix in the init script that reschedules itself if the network doesn't come up. There should be a maximum retry count.

Update

  1. Fixed
  2. Fixed - required SIGINT to allow touchprocessor thread to exit.
  3. Kind of fixed but there is still something wrong here. piboxd is notified to restart the network but the network doesn't come back up. And the launcher gets stuck after that. No idea what's happening here. For now the way around it is to send an MT_SYS/MA_REBOOT instead of a MT_NET/MA_RESTART, but only if the configuration changed.
  4. TBD

Update

The restart is fixed, a bit, without having to switch to a reboot. The problem was that piboxd was using internal message types instead of libpibox's pmsg.h.

Another problem is that the data directory pinet creates to populate with files for imwww for some reason is not always there. That seems like a filesystem problem (overlayfs). Not sure what to do about that. It's intermittent.

Finally, either the web UI doesn't update the network config or pinet overwrites it when it exits. I need to check this. I'm guessing it's the latter.

Actions #22

Updated by Hammel 10 months ago

This is fully working now. The last thing to do is cleanup the javascript and HTML for the AP web page. I've done most of that but now need to remove the reboot button. It doesn't belong in the AP version of this (at least not in this version).

Actions #23

Updated by Hammel 10 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

All updates tested on hardware, committed and pushed.

piplayer build is now working.

Closing issue.

Actions

Also available in: Atom PDF