[needs-packaging] raspberrypi-userland

Bug #1883111 reported by Dave Jones
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu
Fix Released
Wishlist
Unassigned
Focal
Confirmed
Undecided
Unassigned
raspberrypi-userland (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Groovy
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

As part of our HWE efforts for the Raspberry Pi, we need the latest VC (GPU) and camera-related libraries (and utilities) on the Raspberry Pi for focal as well.

For groovy, we want to pull in the latest fixes/improvements, so that the focal backport has the package in its best state. For this purpose we'll be re-using this bug and the same test case.

[Test Case]

* Install libraspberrypi-bin package
* Add "start_x=1" and "gpu_mem=128" to /boot/firmware/config.txt (note: must be config.txt and not one of the included files like syscfg.txt)
* "sudo reboot" to load camera-enabled firmware and enable new udev rules
* Run "vcgencmd commands" as the normal user and ensure it outputs a list of commands
* Run "vcgencmd measure_temp" and ensure it outputs a valid temperature (e.g. typically in the region of 60C for an idle Pi4, lower for earlier models)
* Run "vcgencmd get_camera" as the normal user and ensure it outputs "supported=1 detected=0"
* If you have a camera module available, shut down the pi, install the camera module (see https://picamera.readthedocs.io/en/release-1.13/quickstart.html for details), then boot it again
* Run "vcgencmd get_camera" as the normal user and ensure it outputs "supported=1 detected=1"
* Run "raspivid -t 0" and check the camera's view is displayed on the screen (Ctrl-C to exit)

Repeat for both armhf and arm64.

[Regression Potential]

Can't think of anything really. It's a new package that currently will not be installed by default on any device. We plan to preinstall it at one point, but then additional testing will be done by certification. Right now it's just a set of libraries and utilities that should not be harmful in any way.

[Original Description]

Provides VC (GPU) and camera-related libraries (and utilities) on the Raspberry Pi.

URL: https://github.com/raspberrypi/userland
License: BSD-3-Clause
Notes:

Test builds of packages available from the following PPA: https://launchpad.net/~waveform/+archive/ubuntu/userland/+packages built from the "debian" branch of https://github.com/waveform80/userland

Upstream does not explicitly version their API (hence the lack of version suffixes on the shared objects). Furthermore, the Raspbian package isn't *precisely* the same as this one; it includes the closed-source vcdbg utility (which for obvious reasons we cannot include here).

The intention is to include this package by default in the Raspberry Pi images (and thus in main), and to SRU to Focal; please review accordingly.

Dave Jones (waveform)
description: updated
tags: added: needs-packaging
Revision history for this message
Brian Murray (brian-murray) wrote :

*** This is an automated message ***

This bug is tagged needs-packaging which identifies it as a request for a new package in Ubuntu. As a part of the managing needs-packaging bug reports specification, https://wiki.ubuntu.com/QATeam/Specs/NeedsPackagingBugs, all needs-packaging bug reports have Wishlist importance. Subsequently, I'm setting this bug's status to Wishlist.

Changed in ubuntu:
importance: Undecided → Wishlist
tags: added: id-5ee23768a092115ab5119c7f
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Doing a NEW review of the patch. So far it looks good, some minor concerns to address in the future:

 * fix-format-overflow.patch looks like something that could potentially be forwarded upstream, but I see no Forwarded: clause in the header.
 * I am a bit worried that we're packaging something that we don't know what it does. I would like someone to spend time and try figuring out what the container binaries are meant for - and if we don't need them, simply drop them from the package (not install them).
 * There is no debian/watch file, but I guess it's understandable as upstream did not release any official version *yet*. Worth remembering: once they do, we need to add a debian/watch file for the github upstream repo.

But since otherwise it's good, let me accept it. Though I'd like the above issues resolved ASAP.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

This builds libEGL.so and libGLESv2.so on armhf, which is most likely wrong and causes file conflicts with libegl-dev (src:libglvnd). Please fix.

Revision history for this message
Dave Jones (waveform) wrote :

@sil2100 I did forward fix-format-overflow.patch but they ultimately decided that chunk of code had never been used and they'd rather just excise it (https://github.com/raspberrypi/userland/pull/644). Would "Forwarded:" be "not-needed" there or "yes"?

@tjaalton Hmm, that's definitely my fault. That came up during testing, and I thought I'd patched it out ... <checks git history> ... oh, that was GL/EGL *headers* being installed and was on arm64 instead. Urgh. Anyway, thanks for the notification - I'll get on it.

Revision history for this message
Dave Jones (waveform) wrote :
Dave Jones (waveform)
Changed in ubuntu:
status: New → Fix Released
Changed in raspberrypi-userland (Ubuntu):
status: New → Fix Released
description: updated
Dave Jones (waveform)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in raspberrypi-userland (Ubuntu Focal):
status: New → Confirmed
Revision history for this message
andrum99 (andrum99) wrote :

Might want to look at permissions and ownership on /dev/vchiq. On a Pi running Raspberry Pi OS, this is as follows:

crw-rw---- 1 root video 243, 0 Aug 25 13:06 vchiq

However, on a Pi 4B running ubuntu focal arm64 I get:

crw------- 1 root root 236, 0 Apr 1 17:23 vchiq

The result is that the default user, ubuntu, cannot run vcgencmd without using sudo. On a Pi running Pi OS, the default user, pi, doesn't need sudo, thanks to the difference in group permissions on /dev/vchiq, plus group ownership being video instead of root. (ubuntu is also in the video group).

I couldn't find where in Pi OS this was defined, but the following will set permission and ownership to match Raspberry Pi OS:

$ echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' | sudo tee /etc/udev/rules.d/99-vchiq.rules

Revision history for this message
Dave Jones (waveform) wrote :

regarding the permissions of /dev/vchiq, we do include the necessary udev rules to correct the permissions (in /lib/udev/rules.d/10-local-rpi.rules which is installed as part of libraspberrypi0) but after installing the package a reboot will be necessary for these rules to take effect. In Raspbian, as the package is installed by default the rules are always in effect.

Revision history for this message
andrum99 (andrum99) wrote :

My mistake - didn't realise a reboot was necessary.

Revision history for this message
andrum99 (andrum99) wrote :

Armhf binaries for the closed-source vcdbg and edidparser are available with a compatible license in the upstream package. There are currently no arm64 versions of these binaries.

(They are closed source per Broadcom, the original author).

Revision history for this message
Dave Jones (waveform) wrote :

> Armhf binaries for the closed-source vcdbg and edidparser are available with a compatible license in the upstream package. There are currently no arm64 versions of these binaries.

> (They are closed source per Broadcom, the original author).

Yes, I've deliberately excluded those from our userland package partly because the userland package has to have a common source for both armhf and arm64 in Ubuntu, but mostly because I knew that would complicate the MIR (closed-source stuff generally can't go into main so at that point we'd have a package which would wind up in restricted because of two minor binaries when the other 20+ were all open).

Once everything else we need for the new seeds (rpi-eeprom, userland, pi-bluetooth, linux-firmware-raspi2 into main, + some gadget work) is done I can look at getting the closed source bits into another package, but I rather doubt it'll make it into groovy at this time.

Revision history for this message
andrum99 (andrum99) wrote :

I see. As you say, the two closed-source binaries are pretty minor, and in the case of edidparser, is no longer the recommended tool for parsing EDIDs, according to a Pi forum thread I read. There's something about the Pi 4 EDID output that it doesn't handle quite right.

Both tools only get used if there is a problem, is which case the usual port of call is the official Raspberry Pi forums, and the first thing they tell you to do is use Raspberry Pi OS anyway.

description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Dave, or anyone else affected,

Accepted raspberrypi-userland into groovy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/raspberrypi-userland/0~20200520+git2fe4ca3-0ubuntu3~20.10 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-groovy to verification-done-groovy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-groovy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in raspberrypi-userland (Ubuntu Groovy):
status: New → Fix Committed
tags: added: verification-needed verification-needed-groovy
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Dave, or anyone else affected,

Accepted raspberrypi-userland into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/raspberrypi-userland/0~20200520+git2fe4ca3-0ubuntu3~20.04 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in raspberrypi-userland (Ubuntu Focal):
status: Confirmed → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
andrum99 (andrum99) wrote :

Tested on focal server using ubuntu-20.04.1-preinstalled-server-arm64+raspi.img.xz as follows:

  Operating System: Ubuntu 20.04.1 LTS
            Kernel: Linux 5.4.0-1015-raspi
      Architecture: arm64

Tested package versions:
libraspberrypi-bin:arm64 (0~20200520+git2fe4ca3-0ubuntu3~20.04),
libraspberrypi0:arm64 (0~20200520+git2fe4ca3-0ubuntu3~20.04, automatic)

sudo apt install libraspberrypi-bin
rebooted

Tested:

ubuntu@pi4b-ubuntu-focal:~$ vcgencmd commands
commands="vcos, ap_output_control, ap_output_post_processing, vchi_test_init, vchi_test_exit, pm_set_policy, pm_get_status, pm_show_stats, pm_start_logging, pm_stop_logging, version, commands, set_vll_dir, set_backlight, set_logging, get_lcd_info, arbiter, cache_flush, otp_dump, test_result, codec_enabled, get_camera, get_mem, measure_clock, measure_volts, enable_clock, scaling_kernel, scaling_sharpness, get_hvs_asserts, get_throttled, measure_temp, get_config, hdmi_ntsc_freqs, hdmi_adjust_clock, hdmi_status_show, hvs_update_fields, pwm_speedup, force_audio, hdmi_stream_channels, hdmi_channel_map, display_power, read_ring_osc, memtest, dispmanx_list, get_rsts, schmoo, render_bar, disk_notify, inuse_notify, sus_suspend, sus_status, sus_is_enabled, sus_stop_test_thread, egl_platform_switch, mem_validate, mem_oom, mem_reloc_stats, hdmi_cvt, hdmi_timings, readmr, pmicrd, pmicwr, bootloader_version, bootloader_config, file, vctest_memmap, vctest_start, vctest_stop, vctest_set, vctest_get"

ubuntu@pi4b-ubuntu-focal:~$ vcgencmd measure_temp
temp=34.0'C
ubuntu@pi4b-ubuntu-focal:~$ vcgencmd measure_temp pmic
temp=28.8'C
ubuntu@pi4b-ubuntu-focal:~$ vcgencmd bootloader_config
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0

ubuntu@pi4b-ubuntu-focal:~$ tvservice -s
Error getting current display state
ubuntu@pi4b-ubuntu-focal:~$ sudo tvservice -s
vchi_msg_dequeue -> -1(90)
vchi_msg_dequeue -> -1(90)
state 0x1 [TV is off]

So the vcgencmd interface is working, but tvservice is not.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package raspberrypi-userland - 0~20200520+git2fe4ca3-0ubuntu3~20.10

---------------
raspberrypi-userland (0~20200520+git2fe4ca3-0ubuntu3~20.10) groovy; urgency=medium

  * Backport to groovy (LP: #1883111)
  * d/copyright audit
  * Added d/p/no-specific-libgps.patch to use whatever libgps the system
    provides
  * Excluded the various /usr/bin/containers_* test binaries from
    libraspberrypi-bin
  * Added d/librasperrypi0.symbols file
  * Fixed pkgconfig paths in d/p/fix-multiarch-dir.patch

 -- Dave Jones <email address hidden> Mon, 19 Oct 2020 20:36:07 +0100

Changed in raspberrypi-userland (Ubuntu Groovy):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package raspberrypi-userland - 0~20200520+git2fe4ca3-0ubuntu3~20.04

---------------
raspberrypi-userland (0~20200520+git2fe4ca3-0ubuntu3~20.04) focal; urgency=medium

  * Backport to focal (LP: #1883111)
  * d/copyright audit
  * Added d/p/no-specific-libgps.patch to use whatever libgps the system
    provides
  * Excluded the various /usr/bin/containers_* test binaries from
    libraspberrypi-bin
  * Added d/librasperrypi0.symbols file
  * Fixed pkgconfig paths in d/p/fix-multiarch-dir.patch

 -- Dave Jones <email address hidden> Mon, 19 Oct 2020 20:36:07 +0100

Changed in raspberrypi-userland (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Dave Jones (waveform) wrote :

@andrum99 many thanks for testing! At the moment, the tvservice interface is not expected to work on arm64 (or at least most bits of it - the last time I tested it, it could detect an HDMI screen was attached but that was about it).

It should (mostly) work on armv7l but the userland package here is deliberately out of date as immediately after this, arm64 support was removed upstream (to be re-added later once a full 64-bit Raspberry Pi OS becomes available). Hence, we have a choice between an up to date userland with nothing on arm64 (not a great option, as vcgencmd is a dependency of rpi-eeprom for extracting the bootloader configuration), or having an out of date userland which (mostly, at least camera-wise) works on both archs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.