GNOME Bugzilla – Bug 789472
vaapih264enc bitrate target not respected in low-power mode
Last modified: 2017-12-06 18:31:22 UTC
Trying to generate a 8 Mbits/s file, but the resulting one is 20 Mbits/s. gst-launch-1.0 videotestsrc num-buffers=1000 ! "video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive" ! vaapih264enc bitrate=8000 keyframe-period=30 tune=low-power ! mp4mux ! filesink location=test.mp4 Also, specifying CBR fails: gst-launch-1.0 videotestsrc num-buffers=1000 ! "video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive" ! vaapih264enc bitrate=8000 keyframe-period=30 tune=low-power rate-control=cbr ! mp4mux ! filesink location=test.mp4 0:00:00.064459811 2165 0x55eb91cce230 ERROR vaapi gstvaapicontext.c:274:config_create: unsupported CBR rate control So my guess is that it's doing cqp ? What can i do to control the target bitrate in low power mode ?
Hi; is the bitrate property ignored ? How/is it possible to specify a constant bitrate with low-power tune ?
Is this is only happening in low-power mode?
Yes; but CBR is explicitly not supported with low power (and the pipeline fails if i select CBR), so is the bitrate property simply ignored ? Is implementing CBR the only option here (and if so, it it planned)? This is problematic to me since my application targets 30 fps, and i am not reaching it if do not use tune=low-power.
Ok. I debugged it. 1\ Constant QP (CQP), the default rate control, doesn't support the setting of a bit rate. 2\ vaapi-intel-driver, low-power mode, only support CQP: https://github.com/01org/intel-vaapi-driver/blob/master/src/i965_device_info.c#L378 Perhaps you would like to open an issue in the driver to ask for it.
Alright, thanks. So basically setting the bitrate property has no effect, many thanks for investigating. I will open an issue
Here is the response from the driver people; i believe it indicates it is doing CBR. https://github.com/01org/intel-vaapi-driver/blob/master/src/i965_device_info.c#L1052
All SKL+ platforms support CBR in low-power mode, only thing is that you need huc firmware support in your kernel. Make sure your kernel correctly loaded the HuC firmware.
I do see this, but seems unrelated: # dmesg | grep i915 | grep loading [ 2.316605] [drm] Finished loading i915/skl_dmc_ver1_26.bin (v1.26) I'm running 4.9.66-1-lts, is that even supported ? I tried this: # cat /etc/modprobe.d/i915.conf enable_guc_loading=1 enable_guc_submission=1 I do have a recent linux-firmware: 20171123.90436ce-1 # pacman -Ql linux-firmware | grep skl linux-firmware /usr/lib/firmware/i915/skl_dmc_ver1.bin linux-firmware /usr/lib/firmware/i915/skl_dmc_ver1_23.bin linux-firmware /usr/lib/firmware/i915/skl_dmc_ver1_26.bin linux-firmware /usr/lib/firmware/i915/skl_guc_ver1.bin linux-firmware /usr/lib/firmware/i915/skl_guc_ver4.bin linux-firmware /usr/lib/firmware/i915/skl_guc_ver6.bin linux-firmware /usr/lib/firmware/i915/skl_guc_ver6_1.bin linux-firmware /usr/lib/firmware/i915/skl_guc_ver9_33.bin linux-firmware /usr/lib/firmware/i915/skl_huc_ver01_07_1398.bin But no joy: # cat /sys/kernel/debug/dri/0/i915_huc_load_status cat: /sys/kernel/debug/dri/0/i915_huc_load_status: No such file or directory # cat /sys/kernel/debug/dri/0/i915_guc_load_status GuC firmware status: path: i915/skl_guc_ver6_1.bin fetch: NONE load: NONE version wanted: 6.1 version found: 0.0 header: offset is 0; size = 0 uCode: offset is 0; size = 0 RSA: offset is 0; size = 0 GuC status 0x00000001: Bootrom status = 0x0 uKernel status = 0x0 MIA Core status = 0x0 Scratch registers: 0: 0x0 1: 0x0 2: 0x0 3: 0x0 4: 0x0 5: 0x0 6: 0x0 7: 0x0 8: 0x0 9: 0x0 10: 0x0 11: 0x0 12: 0x0 13: 0x0 14: 0x0 15: 0x0 Looks like a very recent kernel is necessary. What happens if i don't have the updated HuC firmware loaded ? What is the rate control then ?
Seems like you have no huc firmware. Just install the firmwares for your platform from https://01.org/linuxgraphics/downloads/firmware Without huc, CQP will be the only BRC mode.
Many thanks.
For the record, the related ticket on the va driver: https://github.com/01org/intel-vaapi-driver/issues/312