Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmemless: Adding constant and custom periodic effects. Upload before play. #1

Merged
merged 1 commit into from Mar 3, 2022

Conversation

b100dian
Copy link
Contributor

There are two changes in this PR for this ffmemless driver: https://github.com/b100dian/Xiaomi_Kernel_OpenSource/blob/tucana-q-oss/drivers/input/misc/drv260x_input.c#L1143

First, it only supports Constant effect or periodic effect with Custom waveform (see the link above, where the if/else is).
So this implements support for that.

Second, the upload itself is mutating global state on the driver (see the link above) so you have to always update before play.
This is implemented as a hardcoded define, but I can migrate it to a config setting.

Here's an example configuration with constant and custom periodic effect: https://github.com/sailfishos-on-tucana/droid-config-tucana/blob/master/sparse/usr/share/ngfd/plugins.d/51-ffmemless.ini#L57

@@ -67,10 +67,9 @@ int ffmemless_erase_effect(int effect_id, int device_file)
}
}

int ffmemless_evdev_file_open(const char *file_name)
int ffmemless_evdev_file_open(const char *file_name, unsigned long features[4])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

features are now tested in plugin.c

copy->iface = iface;
copy->request = request;
copy->playback_time = data->playback_time;
memcpy(copy, data, sizeof(struct ffm_effect_data));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also needed for the whole cached effect to be copied

int result = TRUE;

if (play) {
data->cached_effect.id = -1;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we reset the initial upload Id and re-upload it

result = FALSE;

if (!play) {
if (ffmemless_erase_effect(data->cached_effect.id, ffm.dev_file))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very important to erase the effect at stop, since the device then runs out of 'space'

// drivers which use FF_PERIODIC only with FF_CUSTOM waveform..
// https://github.com/torvalds/linux/blob/master/drivers/input/ff-core.c#L350
if (ffmemless_has_feature(FF_CONSTANT, ffm.features)) {
N_DEBUG (LOG_CAT "Using constant default effect, rumble is %d",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just to see if rumble is enabled too, in logs

src/ngf/main.c Outdated
@@ -179,7 +179,7 @@ main (int argc, char *argv[])
AppData app;

memset (&app, 0, sizeof (app));
app.default_loglevel = N_LOG_LEVEL_ERROR;
app.default_loglevel = N_LOG_LEVEL_DEBUG;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not change the default log level.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, changed. Let me know if you have suggestions for improvement for the other changes too. For example, flag in the config file for caching the effects, or detection of the rumble effect maybe should be fixed in my kernel etc.

@Thaodan
Copy link
Contributor

Thaodan commented Oct 9, 2021

Hey I tried your PR rebased on Xperia I (Sony-Kumano) with qti-haptics driver.
Most effects don't work except the fingerprint sensor vibrarion.
They result in this message from the ngfd side:

[5.18446744073709551059] DEBUG: dbus: sending reply for request 'unlock_device' (event.id=1) with code 2
[5.18446744073709551059] DEBUG: ffmemless: play
[5.18446744073709551059] DEBUG: ffmemless: play id 7, repeat 1 times, iface 0x0, req 0x0 data 0x18111b50
[5.18446744073709551059] DEBUG: ffmemless: setting up completion timer
[5.18446744073709551059] DEBUG: ffmemless: Starting playback
Vibra upload effect: Invalid argument
[5.18446744073709551059] DEBUG: ffmemless: 7 effect re-load failed

The driver complains about this then:

 qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 26144 is NOT supported

Check my ngfd log here:
ngfd.log

My rebase of this PR against master:
https://github.com/Thaodan/ngfd/tree/constant_thao

qt-haptics:
https://github.com/mer-hybris/android_kernel_sony_msm/blob/hybris-sony-aosp/LA.UM.7.1.r1/drivers/input/misc/qti-haptics.c

@b100dian
Copy link
Contributor Author

b100dian commented Oct 9, 2021

Good to see one more person able to test this @Thaodan, thanks!

old incorrect analysis So you got a `data` with three `s16`: `effect`, `timeout_sec`, `timeout_msec`. This PR seems to only support two `s16` because `sizeof(int)` is still 32 on aarch. I need to add a different representation for CUSTOM_DATA, maybe a string that is interpreted as hex => so you also get the len as 'input'.

It is still worth trying with this version (though it will read 1 more int outside the custom data buffer).
Or you can just replace the sizeof(int)/sizeof(__s16) with 4 (or sizeof(long int)/sizeof(__s16)) so you will at least allocate that extra 32-bit int, even if it is always 0 - it is milliseconds.

Meanwhile, I see that these may be the effects: https://github.com/mer-hybris/android_kernel_sony_msm/blob/hybris-sony-aosp/LA.UM.7.1.r1/arch/arm64/boot/dts/qcom/pm8150b.dtsi#L501

Since you need to pass something like 196610 for effect 2, timeout 3. See this quick example: https://onlinegdb.com/quCtHIrzg

Let me know if that works and how do you feel about adding _CUSTOM="000200030000" support next

Later edit: I just noticed that 1. you haven't actually passed 26144 as _CUSTOM (just opened the whole logs). And that sec and msec are not INPUT params. This may be something else

@b100dian
Copy link
Contributor Author

b100dian commented Oct 9, 2021

Hi @Thaodan , I've made two changes: custom-data is now 8 bytes to match the 6 required, and it's allocated on heap. One of these was the reason for what seemed to be like memory corruption that you revealed. You can just cherry-pick this last commit.

@Thaodan
Copy link
Contributor

Thaodan commented Oct 10, 2021

Hey I've tested your changes. After this change it works better except that after a time I hit;
[51.054] DEBUG: dbus: reply error: org.freedesktop.DBus.Error.LimitsExceeded (Too many simultaneous requests.)
ngfd.log

@Thaodan
Copy link
Contributor

Thaodan commented Oct 10, 2021

[4.691] DEBUG: core: request 'unlock_device' resolved to event 'unlock_device'
[4.691] DEBUG: core: firing hook 'new_request'
[4.691] DEBUG: transform: transforming request keys for request 'unlock_device'
[4.691] DEBUG: transform: + allowing value 'dbus.event.client'
[4.691] DEBUG: core: firing hook 'transform_properties'
[4.691] DEBUG: profile: transforming profile values for request 'unlock_device'
[4.691] DEBUG: profile: new properties:
[4.691] DEBUG: proplist: dbus.event.client = 0x0xe7e3ab0 (pointer)
[4.691] DEBUG: proplist: haptic.type = event (string)
[4.691] DEBUG: proplist: haptic.effect = strong (string)
[4.691] DEBUG: haptic: can handle unlock_device?
[4.691] DEBUG: core: firing hook 'filter_sinks'
[4.691] DEBUG: resource: filter sinks for request 'unlock_device'
[4.691] DEBUG: resource: resource type 'audio' enabled
[4.691] DEBUG: resource: resource type 'vibra' enabled
[4.691] DEBUG: resource: resource type 'leds' enabled
[4.691] DEBUG: ffmemless: prepare
[4.691] DEBUG: ffmemless: prep effect strong, repeat 1 times, duration of 240 ms
[4.691] DEBUG: core: sink 'ffmemless' synchronized for request 'unlock_device'
[4.691] DEBUG: core: all sinks have been synchronized
[4.691] DEBUG: dbus: sending reply for request 'unlock_device' (event.id=1) with code 2
[4.691] DEBUG: ffmemless: play
[4.691] DEBUG: ffmemless: play id 11, repeat 1 times, iface 0x0, req 0x0 data 0xe978670
[4.691] DEBUG: ffmemless: setting up completion timer
[4.691] DEBUG: ffmemless: Starting playback

@Thaodan
Copy link
Contributor

Thaodan commented Oct 10, 2021

ngfd.1.log

@b100dian
Copy link
Contributor Author

@Thaodan I've found the dbus reply regression, let me know if this last commit works better for you

@Thaodan
Copy link
Contributor

Thaodan commented Oct 18, 2021

As already said: the PR works much better now except sometimes an effect gets erased twice, resulting in invallid argument of the second erase. Also the vibration effect is quite weak
Without defining CACHE_EFFECTS all this is gone.

@b100dian
Copy link
Contributor Author

Thanks @Thaodan, here's my list of improvement incoming for this PR:

  • use custom_data on stack on every upload/play(/erase). For this I will move the custom data int read from the config files to the ffm_effect_data structure.
  • store the playback time determined from the first custom_data upload to the same ffm_effect_data. This would allow to set a timeout correctly as tested on my temp branch.
  • finally: about the CACHE_EFFECTS define: I think I will remove that flag and only apply the re-upload of the effects for FF_PERIODIC + FF_CUSTOM effects (or FF_CONSTANT too). This means that the price of caching / re-uploading will only be payed for clients actually using these types of effects.

All in all, this will also set in stone the FF_CUSTOM behaviour to the one observed in our two implementations - which was not clear to me when I made the PR (I only had one data point).

Also the vibration effect is quite weak

Have you played with different magnitudes? On my device there's a setlist like https://github.com/b100dian/Xiaomi_Kernel_OpenSource/blob/tucana-q-oss/drivers/input/misc/drv260x_input.c#L760, maybe this applies to yours (at least the parameter, not the list of values)?

@Thaodan
Copy link
Contributor

Thaodan commented Oct 18, 2021

Have you played with different magnitudes? On my device there's a setlist like https://github.com/b100dian/Xiaomi_Kernel_OpenSource/blob/tucana-q-oss/drivers/input/misc/drv260x_input.c#L760, maybe this applies to yours (at least the parameter, not the list of values)?

If CACHE_EFFECTS is used.

@@ -585,7 +687,9 @@ static int ffm_sink_prepare(NSinkInterface *iface, NRequest *request)
* keep repeating them until timer runs out and effect ends.
*/
copy->repeat = INT32_MAX; /* repeat to "infinity" */
copy->playback_time = playback_time;
if (!copy->playback_time && playback_time) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was resetting playback time to zero on CONSTANT effects, which was not nice.

@b100dian
Copy link
Contributor Author

b100dian commented Oct 30, 2021

I've re-worked the PR per the above 2 of the three points.
I cannot test without CACHE_EFFECTS on my device since then only the last uploaded effect from settings is taken into account.. (global state ftw..)
Hopefully doubly erasing an effect is fixed for you @Thaodan. And maybe without cached effects, you get the magnitude set by the last uploaded effect too?

@voidanix
Copy link

Great work, thanks @b100dian :)

I tested this on my Xperia 5 (another kumano) and for the most part it works great without CACHE_EFFECTS.

One thing I noticed is that when using Waydroid and triggering some vibration from there, once back to SFOS the vibration "doesn't work" as if the vibrator gets "stolen" by the Android container (it's incredibly weak in SFOS as @Thaodan said in #1 (comment) and the weakness also happens when CACHE_EFFECTS is defined, I'm not even sure if this is just the speaker playing sounds at this point).

In the logs this is what I find yet don't know if the following is even related:

Xperia5 ngfd[6245]: [0.231] ERROR: tonegen-ausrv: ausrv: server connection failure: Access denied
Xperia5 ngfd[6245]: [10.232] ERROR: tonegen-ausrv: ausrv: server connection failure: Connection refused
Xperia5 ngfd[6245]: [20.233] ERROR: tonegen-ausrv: ausrv: server connection failure: Connection refused
Xperia5 ngfd[9672]: libprofile: session bus connection requested while blocked
Xperia5 invoker[6593]: WARNING: Could not play effect

The vendor.qti.hardware.vibrator@1.2-service service is also running and is not disabled.

Any idea as to what might be going on?

@b100dian
Copy link
Contributor Author

Thanks @voidanix,
Happy to see more devices using this branch - I wish there wasn't the need but..:)

Regarding Waydroid - I do not experience this on Mi Note 101
I do remember that there was a problem with the vibrator on Sony tama devices, but that was probably because the service you're referencing was disabled - if you have telegram, scroll up a bit this thread https://t.me/WayDroid/27612 from when Lal first ran it on tama.

Maybe in your case vibrator service and its access from Waydroid could just be disabled?

Sorry if CACHE_EFFECTS doesn't make a difference (actually looks like you have the better driver;D)

Maybe you can strace what the permission denied is about. I don't know what ausrv is, but you can get the PID of ngfd and strace -p $it -o $outfile..

Footnotes

  1. I do have a hunch that ngfd blocking for 5 mins and getting killed is related to waydroid, but have no proof. I never experienced this without waydroid, but it was also another ngfd version. I get DEBUG: haptic: can handle vibra? then 5 mins of ngfd stuck 100% on a core + systemd PID change when starting)

@voidanix
Copy link

Sorry for replying late here :P

Maybe in your case vibrator service and its access from Waydroid could just be disabled?

As mentioned above, vendor.qti.hardware.vibrator@1.2-service is running and is enabled (this device does not use the android.hardware.vibrator@1.0-service HAL as it is newer).

Sorry if CACHE_EFFECTS doesn't make a difference (actually looks like you have the better driver;D)

Oops, I meant that the vibrator is weak when either:

  • Vibration is triggered from Waydroid and I get back to Sailfish (will remain so until a systemctl --user restart ngfd)
  • CACHE_EFFECTS is defined

I have not yet tried using both Waydroid and ngfd compiled with CACHE_EFFECTS but I doubt the result changes.

Maybe you can strace what the permission denied is about. I don't know what ausrv is, but you can get the PID of ngfd and strace -p $it -o $outfile..

The strace does not seem to give anything obvious:

strace content
read(3, "\3\0\0\0\0\0\0\0", 16)         = 8
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, NULL, NULL, 0) = 1 ([{fd=6, revents=POLLIN}])
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\4\1\1\37\0\0\0\240\2\0\0\211\0\0\0\1\1o\0\25\0\0\0/org/fre"..., iov_len=2048}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 191
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, {msg_namelen=0}, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, {tv_sec=0, tv_nsec=0}, NULL, 0) = 1 ([{fd=3, revents=POLLIN}], left {tv_sec=0, tv_nsec=0})
read(3, "\3\0\0\0\0\0\0\0", 16)         = 8
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, NULL, NULL, 0) = 1 ([{fd=6, revents=POLLIN}])
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\4\1\1\35\0\0\0\241\2\0\0\211\0\0\0\1\1o\0\25\0\0\0/org/fre"..., iov_len=2048}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 189
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, {msg_namelen=0}, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, {tv_sec=0, tv_nsec=0}, NULL, 0) = 1 ([{fd=3, revents=POLLIN}], left {tv_sec=0, tv_nsec=0})
read(3, "\3\0\0\0\0\0\0\0", 16)         = 8
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, NULL, NULL, 0) = 1 ([{fd=6, revents=POLLIN}])
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\1\0\1 \0\0\0\r\1\0\0\257\0\0\0\1\1o\0\36\0\0\0/com/nok"..., iov_len=2048}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 224
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, {msg_namelen=0}, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, {tv_sec=0, tv_nsec=0}, NULL, 0) = 1 ([{fd=3, revents=POLLIN}], left {tv_sec=0, tv_nsec=0})
read(3, "\3\0\0\0\0\0\0\0", 16)         = 8
sendmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\2\1\1\4\0\0\0\356\0\0\0\37\0\0\0\6\1s\0\6\0\0\0:1.117\0\0"..., iov_len=48}, {iov_base="I\0\0\0", iov_len=4}], msg_iovlen=2, msg_controllen=0, msg_flags=0}, 0) = 52
sendmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\4\1\1\10\0\0\0\357\0\0\0h\0\0\0\1\1o\0\36\0\0\0/com/nok"..., iov_len=120}, {iov_base="I\0\0\0\2\0\0\0", iov_len=8}], msg_iovlen=2, msg_controllen=0, msg_flags=0}, 0) = 128
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, {tv_sec=0, tv_nsec=0}, NULL, 0) = 0 (Timeout)
write(16, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\25\0\10\0\1\0\0\0", 24) = 24
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, {tv_sec=0, tv_nsec=46000000}, NULL, 0) = 0 (Timeout)
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, {tv_sec=0, tv_nsec=0}, NULL, 0) = 0 (Timeout)
write(16, "\0\0\0\0\0\0\0\0\200\200\200\0\0\0\0\0\25\0\10\0\0\0\0\0", 24) = 24
sendmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\4\1\1\10\0\0\0\360\0\0\0h\0\0\0\1\1o\0\36\0\0\0/com/nok"..., iov_len=120}, {iov_base="I\0\0\0\1\0\0\0", iov_len=8}], msg_iovlen=2, msg_controllen=0, msg_flags=0}, 0) = 128
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, NULL, NULL, 0) = 1 ([{fd=6, revents=POLLIN}])
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\4\1\1\4\0\0\0?\0\0\0v\0\0\0\1\1o\0\v\0\0\0/devicel"..., iov_len=2048}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 140
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, {msg_namelen=0}, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, {tv_sec=0, tv_nsec=0}, NULL, 0) = 1 ([{fd=3, revents=POLLIN}], left {tv_sec=0, tv_nsec=0})
read(3, "\3\0\0\0\0\0\0\0", 16)         = 8
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, NULL, NULL, 0

Looking at the thread you have given, modifying the host's /vendor/etc/vintf/manifest.xml to make it not find the vibrator HAL "works" but vibration will (of course) no longer work inside the container.

I think this pretty much resolves to Waydroid not supporting the QTI haptics HAL here in use: its vibrator HAL points to nonexistent sysfs nodes and the host HAL uses /dev/input/event2 (in this case) for haptics, which is not passed through the container.

Hope I didn't hijack this PR with useless stuff and thanks again :)

@voidanix
Copy link

BTW, I just wanted to add that with CACHE_EFFECTS indeed the vibration does not work because it fails at either uploading or erasing the effect:

In dmesg when unlocking and moving a pulley up/down:

qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2416 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2560 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2704 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2848 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2992 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 3136 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 3280 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 3424 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 3568 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 3568 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 3424 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 3280 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 3136 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2992 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2848 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2704 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect 2560 is NOT supported
journalctl
ngfd[18324]: [10.18446744073709550743] DEBUG: transform: + allowing value 'dbus.event.client'
ngfd[18324]: [10.18446744073709550744] DEBUG: core: firing hook 'transform_properties'
ngfd[18324]: [10.18446744073709550744] DEBUG: profile: transforming profile values for request 'unlock_device'
ngfd[18324]: [10.18446744073709550744] DEBUG: profile: new properties:
ngfd[18324]: [10.18446744073709550744] DEBUG: proplist: dbus.event.client = 0x0x368d14d0 (pointer)
ngfd[18324]: [10.18446744073709550744] DEBUG: proplist: haptic.type = event (string)
ngfd[18324]: [10.18446744073709550744] DEBUG: proplist: haptic.effect = strong (string)
ngfd[18324]: [10.18446744073709550744] DEBUG: haptic: can handle unlock_device?
ngfd[18324]: [10.18446744073709550744] DEBUG: core: firing hook 'filter_sinks'
ngfd[18324]: [10.18446744073709550744] DEBUG: resource: filter sinks for request 'unlock_device'
ngfd[18324]: [10.18446744073709550744] DEBUG: resource: resource type 'audio' enabled
ngfd[18324]: [10.18446744073709550744] DEBUG: resource: resource type 'vibra' enabled
ngfd[18324]: [10.18446744073709550744] DEBUG: resource: resource type 'leds' enabled
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: prepare
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: prep effect strong, repeat 1 times, duration of 26 ms
ngfd[18324]: [10.18446744073709550744] DEBUG: core: sink 'ffmemless' synchronized for request 'unlock_device'
ngfd[18324]: [10.18446744073709550744] DEBUG: core: all sinks have been synchronized
ngfd[18324]: [10.18446744073709550744] DEBUG: dbus: sending reply for request 'unlock_device' (event.id=12) with code 2
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: play
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: play id 11, repeat 1 times, iface 0x368db3f0, req 0x36910cd0 data 0x36b21a00
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: setting up completion timer
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: Starting playback 11
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: 11 effect re-load failed
ngfd[18324]: [10.18446744073709550744] WARNING: core: sink 'ffmemless' failed play request 'unlock_device'
ngfd[18324]: [10.18446744073709550744] WARNING: core: sink 'ffmemless' failed request 'unlock_device'
ngfd[18324]: [10.18446744073709550744] DEBUG: core: stopping all sinks for request 'unlock_device'
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: stop
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: Effect id 11 completed
ngfd[18324]: [10.18446744073709550744] DEBUG: ffmemless: Stopping playback 11
ngfd[18324]: [10.18446744073709550744] DEBUG: dbus: error occurred for request 'unlock_device': no fallbacks!
ngfd[18324]: [10.18446744073709550744] DEBUG: dbus: sending reply for request 'unlock_device' (event.id=12) with code 0
ngfd[18324]: [10.18446744073709550744] DEBUG: core: request 'unlock_device' done
ngfd[18324]: [29.18446744073709551478] DEBUG: dbus: >> new client (:1.251)
ngfd[18324]: [29.18446744073709551478] INFO: dbus: >> play received for event 'pulldown_highlight' with id '13' (client :1.251 : 1 active request(s))
ngfd[18324]: [29.18446744073709551479] DEBUG: core: evaluating events for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551479] DEBUG: event-list: consider event 'pulldown_highlight' (priority 0)
ngfd[18324]: [29.18446744073709551479] DEBUG: event-list: -> (cached) context@'call_state.mode'-> true
ngfd[18324]: [29.18446744073709551479] DEBUG: core: evaluated to 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551479] DEBUG: core: + context@'call_state.mode' == 'none (string)'
ngfd[18324]: [29.18446744073709551479] DEBUG: core: request 'pulldown_highlight' resolved to event 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551479] DEBUG: core: firing hook 'new_request'
ngfd[18324]: [29.18446744073709551479] DEBUG: transform: transforming request keys for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551479] DEBUG: transform: + allowing value 'dbus.event.client'
ngfd[18324]: [29.18446744073709551479] DEBUG: core: firing hook 'transform_properties'
ngfd[18324]: [29.18446744073709551479] DEBUG: profile: transforming profile values for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551479] DEBUG: profile: + transforming profile key 'touchscreen.sound.level' to target 'sound.volume'
ngfd[18324]: [29.18446744073709551479] DEBUG: profile: new properties:
ngfd[18324]: [29.18446744073709551479] DEBUG: proplist: sound.stream.module-stream-restore.id = x-feedback-sound-level (string)
ngfd[18324]: [29.18446744073709551479] DEBUG: proplist: sound.stream.media.name = feedback-event (string)
ngfd[18324]: Vibra upload effect: Invalid argument
ngfd[18324]: Vibra erase effect: Invalid argument
ngfd[18324]: [29.18446744073709551479] DEBUG: proplist: canberra.filename = pulldown_highlight (string)
ngfd[18324]: [29.18446744073709551479] DEBUG: proplist: sound.volume.profile = touchscreen.sound.level => sound.volume (string)
ngfd[18324]: [29.18446744073709551479] DEBUG: proplist: haptic.effect = short (string)
ngfd[18324]: [29.18446744073709551479] DEBUG: proplist: dbus.event.client = 0x0x368da8d0 (pointer)
ngfd[18324]: [29.18446744073709551479] DEBUG: proplist: sound.volume = 0 (int)
ngfd[18324]: [29.18446744073709551479] DEBUG: proplist: haptic.type = touch (string)
ngfd[18324]: [29.18446744073709551479] DEBUG: canberra: request has a sound.filename, we can handle this.
ngfd[18324]: [29.18446744073709551479] DEBUG: haptic: can handle pulldown_highlight?
ngfd[18324]: [29.18446744073709551479] DEBUG: core: firing hook 'filter_sinks'
ngfd[18324]: [29.18446744073709551479] DEBUG: resource: filter sinks for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551479] DEBUG: resource: resource type 'audio' enabled
ngfd[18324]: [29.18446744073709551479] DEBUG: resource: resource type 'vibra' enabled
ngfd[18324]: [29.18446744073709551479] DEBUG: resource: resource type 'leds' enabled
ngfd[18324]: [29.18446744073709551479] DEBUG: canberra: sink prepare
ngfd[18324]: [29.18446744073709551479] DEBUG: core: sink 'canberra' synchronized for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551479] DEBUG: ffmemless: prepare
ngfd[18324]: [29.18446744073709551479] DEBUG: ffmemless: prep effect short, repeat 1 times, duration of 26 ms
ngfd[18324]: [29.18446744073709551479] DEBUG: core: sink 'ffmemless' synchronized for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551479] DEBUG: core: all sinks have been synchronized
ngfd[18324]: [29.18446744073709551480] DEBUG: dbus: sending reply for request 'pulldown_highlight' (event.id=13) with code 2
ngfd[18324]: [29.18446744073709551486] DEBUG: canberra: sink play
ngfd[18324]: [29.18446744073709551486] DEBUG: ffmemless: play
ngfd[18324]: [29.18446744073709551486] DEBUG: ffmemless: play id 9, repeat 1 times, iface 0x368db3f0, req 0x36910c40 data 0x36b21a00
ngfd[18324]: [29.18446744073709551486] DEBUG: ffmemless: setting up completion timer
ngfd[18324]: [29.18446744073709551486] DEBUG: ffmemless: Starting playback 9
ngfd[18324]: [29.18446744073709551487] DEBUG: ffmemless: 9 effect re-load failed
ngfd[18324]: [29.18446744073709551487] WARNING: core: sink 'ffmemless' failed play request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551487] WARNING: core: sink 'ffmemless' failed request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551487] DEBUG: core: stopping all sinks for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551487] DEBUG: canberra: sink stop
ngfd[18324]: [29.18446744073709551487] DEBUG: ffmemless: stop
ngfd[18324]: [29.18446744073709551487] DEBUG: ffmemless: Effect id 9 completed
ngfd[18324]: [29.18446744073709551487] DEBUG: core: sink 'ffmemless' completed request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551487] DEBUG: ffmemless: Stopping playback 9
ngfd[18324]: [29.18446744073709551487] DEBUG: dbus: error occurred for request 'pulldown_highlight': no fallbacks!
ngfd[18324]: [29.18446744073709551487] DEBUG: dbus: sending reply for request 'pulldown_highlight' (event.id=13) with code 0
ngfd[18324]: [29.18446744073709551488] DEBUG: core: request 'pulldown_highlight' done
ngfd[18324]: [29.18446744073709551613] INFO: dbus: >> play received for event 'pulldown_highlight' with id '14' (client :1.251 : 1 active request(s))
ngfd[18324]: [29.18446744073709551614] DEBUG: core: evaluating events for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: event-list: consider event 'pulldown_highlight' (priority 0)
ngfd[18324]: [29.18446744073709551614] DEBUG: event-list: -> (cached) context@'call_state.mode'-> true
ngfd[18324]: [29.18446744073709551614] DEBUG: core: evaluated to 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: core: + context@'call_state.mode' == 'none (string)'
ngfd[18324]: [29.18446744073709551614] DEBUG: core: request 'pulldown_highlight' resolved to event 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: core: firing hook 'new_request'
ngfd[18324]: [29.18446744073709551614] DEBUG: transform: transforming request keys for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: transform: + allowing value 'dbus.event.client'
ngfd[18324]: [29.18446744073709551614] DEBUG: core: firing hook 'transform_properties'
ngfd[18324]: [29.18446744073709551614] DEBUG: profile: transforming profile values for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: prVibra upload effect: Invalid argument
ngfd[18324]: Vibra erase effect: Invalid argument
ngfd[18324]: ofile: + transforming profile key 'touchscreen.sound.level' to target 'sound.volume'
ngfd[18324]: [29.18446744073709551614] DEBUG: profile: new properties:
ngfd[18324]: [29.18446744073709551614] DEBUG: proplist: sound.stream.module-stream-restore.id = x-feedback-sound-level (string)
ngfd[18324]: [29.18446744073709551614] DEBUG: proplist: sound.stream.media.name = feedback-event (string)
ngfd[18324]: [29.18446744073709551614] DEBUG: proplist: canberra.filename = pulldown_highlight (string)
ngfd[18324]: [29.18446744073709551614] DEBUG: proplist: sound.volume.profile = touchscreen.sound.level => sound.volume (string)
ngfd[18324]: [29.18446744073709551614] DEBUG: proplist: haptic.effect = short (string)
ngfd[18324]: [29.18446744073709551614] DEBUG: proplist: dbus.event.client = 0x0x368da8d0 (pointer)
ngfd[18324]: [29.18446744073709551614] DEBUG: proplist: sound.volume = 0 (int)
ngfd[18324]: [29.18446744073709551614] DEBUG: proplist: haptic.type = touch (string)
ngfd[18324]: [29.18446744073709551614] DEBUG: canberra: request has a sound.filename, we can handle this.
ngfd[18324]: [29.18446744073709551614] DEBUG: haptic: can handle pulldown_highlight?
ngfd[18324]: [29.18446744073709551614] DEBUG: core: firing hook 'filter_sinks'
ngfd[18324]: [29.18446744073709551614] DEBUG: resource: filter sinks for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: resource: resource type 'audio' enabled
ngfd[18324]: [29.18446744073709551614] DEBUG: resource: resource type 'vibra' enabled
ngfd[18324]: [29.18446744073709551614] DEBUG: resource: resource type 'leds' enabled
ngfd[18324]: [29.18446744073709551614] DEBUG: canberra: sink prepare
ngfd[18324]: [29.18446744073709551614] DEBUG: core: sink 'canberra' synchronized for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: prepare
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: prep effect short, repeat 1 times, duration of 26 ms
ngfd[18324]: [29.18446744073709551614] DEBUG: core: sink 'ffmemless' synchronized for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: core: all sinks have been synchronized
ngfd[18324]: [29.18446744073709551614] DEBUG: dbus: sending reply for request 'pulldown_highlight' (event.id=14) with code 2
ngfd[18324]: [29.18446744073709551614] DEBUG: canberra: sink play
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: play
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: play id 9, repeat 1 times, iface 0x368db3f0, req 0x36910bb0 data 0x36b21a00
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: setting up completion timer
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: Starting playback 9
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: 9 effect re-load failed
ngfd[18324]: [29.18446744073709551614] WARNING: core: sink 'ffmemless' failed play request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] WARNING: core: sink 'ffmemless' failed request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: core: stopping all sinks for request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551614] DEBUG: canberra: sink stop
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: stop
ngfd[18324]: [29.18446744073709551614] DEBUG: ffmemless: Effect id 9 completed
ngfd[18324]: [29.18446744073709551615] DEBUG: core: sink 'ffmemless' completed request 'pulldown_highlight'
ngfd[18324]: [29.18446744073709551615] DEBUG: ffmemless: Stopping playback 9
ngfd[18324]: [29.18446744073709551615] DEBUG: dbus: error occurred for request 'pulldown_highlight': no fallbacks!
ngfd[18324]: [29.18446744073709551615] DEBUG: dbus: sending reply for request 'pulldown_highlight' (event.id=14) with code 0
ngfd[18324]: [29.18446744073709551615] DEBUG: core: request 'pulldown_highlight' done
ngfd[18324]: [30.18446744073709550861] INFO: dbus: >> play received for event 'pulldown_lock' with id '15' (client :1.251 : 1 active request(s))
ngfd[18324]: [30.18446744073709550861] DEBUG: core: evaluating events for request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550861] DEBUG: event-list: consider event 'pulldown_lock' (priority 0)
ngfd[18324]: [30.18446744073709550861] DEBUG: event-list: -> (cached) context@'call_state.mode'-> true
ngfd[18324]: [30.18446744073709550861] DEBUG: core: evaluated to 'pulldown_lock'
ngfd[18324]: [30.18446744073709550861] DEBUG: core: + context@'call_state.mode' == 'none (string)'
ngfd[18324]: [30.18446744073709550861] DEBUG: core: request 'pulldown_lock' resolved to event 'pulldown_lock'
ngfd[18324]: [30.18446744073709550861] DEBUG: core: firing hook 'new_request'
ngfd[18324]: [30.18446744073709550861] DEBUG: transform: transforming request keys for rVibra upload effect: Invalid argument
ngfd[18324]: Vibra erase effect: Invalid argument
ngfd[18324]: equest 'pulldown_lock'
ngfd[18324]: [30.18446744073709550861] DEBUG: transform: + allowing value 'dbus.event.client'
ngfd[18324]: [30.18446744073709550861] DEBUG: core: firing hook 'transform_properties'
ngfd[18324]: [30.18446744073709550861] DEBUG: profile: transforming profile values for request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550861] DEBUG: profile: + transforming profile key 'touchscreen.sound.level' to target 'sound.volume'
ngfd[18324]: [30.18446744073709550861] DEBUG: profile: new properties:
ngfd[18324]: [30.18446744073709550861] DEBUG: proplist: sound.stream.module-stream-restore.id = x-feedback-sound-level (string)
ngfd[18324]: [30.18446744073709550861] DEBUG: proplist: sound.stream.media.name = feedback-event (string)
ngfd[18324]: [30.18446744073709550861] DEBUG: proplist: canberra.filename = pulldown_lock (string)
ngfd[18324]: [30.18446744073709550861] DEBUG: proplist: sound.volume.profile = touchscreen.sound.level => sound.volume (string)
ngfd[18324]: [30.18446744073709550861] DEBUG: proplist: haptic.effect = strong (string)
ngfd[18324]: [30.18446744073709550861] DEBUG: proplist: dbus.event.client = 0x0x368da8d0 (pointer)
ngfd[18324]: [30.18446744073709550861] DEBUG: proplist: sound.volume = 0 (int)
ngfd[18324]: [30.18446744073709550861] DEBUG: proplist: haptic.type = touch (string)
ngfd[18324]: [30.18446744073709550861] DEBUG: canberra: request has a sound.filename, we can handle this.
ngfd[18324]: [30.18446744073709550861] DEBUG: haptic: can handle pulldown_lock?
ngfd[18324]: [30.18446744073709550861] DEBUG: core: firing hook 'filter_sinks'
ngfd[18324]: [30.18446744073709550861] DEBUG: resource: filter sinks for request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550861] DEBUG: resource: resource type 'audio' enabled
ngfd[18324]: [30.18446744073709550861] DEBUG: resource: resource type 'vibra' enabled
ngfd[18324]: [30.18446744073709550861] DEBUG: resource: resource type 'leds' enabled
ngfd[18324]: [30.18446744073709550861] DEBUG: canberra: sink prepare
ngfd[18324]: [30.18446744073709550861] DEBUG: core: sink 'canberra' synchronized for request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550861] DEBUG: ffmemless: prepare
ngfd[18324]: [30.18446744073709550861] DEBUG: ffmemless: prep effect strong, repeat 1 times, duration of 26 ms
ngfd[18324]: [30.18446744073709550861] DEBUG: core: sink 'ffmemless' synchronized for request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550861] DEBUG: core: all sinks have been synchronized
ngfd[18324]: [30.18446744073709550862] DEBUG: dbus: sending reply for request 'pulldown_lock' (event.id=15) with code 2
ngfd[18324]: [30.18446744073709550868] DEBUG: canberra: sink play
ngfd[18324]: [30.18446744073709550868] DEBUG: ffmemless: play
ngfd[18324]: [30.18446744073709550868] DEBUG: ffmemless: play id 11, repeat 1 times, iface 0x368db3f0, req 0x36910b20 data 0x36b21a00
ngfd[18324]: [30.18446744073709550868] DEBUG: ffmemless: setting up completion timer
ngfd[18324]: [30.18446744073709550868] DEBUG: ffmemless: Starting playback 11
ngfd[18324]: [30.18446744073709550868] DEBUG: ffmemless: 11 effect re-load failed
ngfd[18324]: [30.18446744073709550868] WARNING: core: sink 'ffmemless' failed play request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550868] WARNING: core: sink 'ffmemless' failed request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550868] DEBUG: core: stopping all sinks for request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550868] DEBUG: canberra: sink stop
ngfd[18324]: [30.18446744073709550868] DEBUG: ffmemless: stop
ngfd[18324]: [30.18446744073709550868] DEBUG: ffmemless: Effect id 11 completed
ngfd[18324]: [30.18446744073709550868] DEBUG: core: sink 'ffmemless' completed request 'pulldown_lock'
ngfd[18324]: [30.18446744073709550868] DEBUG: ffmemless: Stopping playback 11
ngfd[18324]: [30.18446744073709550868] DEBUG: dbus: error occurred for request 'pulldown_lock': no fallbacks!
ngfd[18324]: [30.18446744073709550868] DEBUG: dbus: sending reply for request 'pulldown_lock' (event.id=15) with code 0
ngfd[18324]: [30.18446744073709550872] DEBUG: core: request 'pulldown_lock' done
ngfd[18324]: [30.18446744073709550996] INFO: dbus: >> play received for event 'pulldown_highlight' with id '16' (client :1.251 : 1 active request(s))
ngfd[18324]: [30.18446744073709550997] DEBUG: core: evaluating events for request 'pulldown_highlight'
ngfd[18324]: [30.18446744073709550997] DEBUG: event-list: consider event 'pulldown_highlight' (priority 0)
ngfd[18324]: [30.18446744073709550997] DEBUG: event-list: -> (cached) context@'call_state.mode'-> true
ngfd[18324]: [30.18446744073709550997] DEBUG: core: evaluated to 'pulldown_highlight'
ngfd[18324]: [30.18446744073709550997] DEBUG: core: + context@'Vibra upload effect: Invalid argument
ngfd[18324]: Vibra erase effect: Invalid argument

In case it ends up useful, you might want to check the vibrator HAL for the Xperia 1/5: https://github.com/sonyxperiadev/vendor-qcom-opensource-vibrator

@b100dian
Copy link
Contributor Author

Thanks @voidanix,
This is really helpful.

In dmesg when unlocking and moving a pulley up/down:

This seems to be an error in the initialization of the custom data (this one https://github.com/mer-hybris/android_kernel_sony_msm/blob/hybris-sony-aosp/LA.UM.7.1.r1/drivers/input/misc/qti-haptics.c#L888 )

That field is parsed here, copied (in the case of CACHE_EFFECTS) here and used before upload is done here (and is meant to be like this https://onlinegdb.com/NRkfrRM4N ).

As the author of the lines I am not able to find (am blind about) what gets wrong here. Can you help?
I can make a branch with more logging added around that value, can you also provide your config file?

Also I can make this somewhat switchable from the config file, but I don't like that the struct field is always present even if not used (see https://github.com/sailfishos-on-tucana/ngfd/tree/tucana/constant-optin )

@voidanix
Copy link

@b100dian could it be that request is bugged?

Doing some printf debugging around copy->request and copy (the argument) inside static int ffm_sink_prepare(...), their values seem strangely big, but most importantly, they keep changing continuously:

ffmemless: copy request: 604810224
ffmemless: copy request number 2: 603380800
ffmemless: copy request: 604809840
ffmemless: copy request number 2: 603380944
ffmemless: copy request: 604809936
ffmemless: copy request number 2: 603381088
ffmemless: copy request: 604809936
ffmemless: copy request number 2: 603381232
ffmemless: copy request: 604809936
ffmemless: copy request number 2: 603381232
ffmemless: copy request: 604809936
ffmemless: copy request number 2: 603381088

This number is now in the mid 60*******s, but will change once ngfd is restarted and to no one's surprise, that value will still be too big for int16_t.

Looking at:

qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9008 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9152 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9296 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9440 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9584 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9728 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9872 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9728 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9584 is NOT supported
qcom,haptics c440000.qcom,spmi:qcom,pm8150b@3:qcom,haptics@c000: predefined effect -9440 is NOT supported

You can clearly tell there is an overflow going on:

arr.cpp:7:23: warning: overflow in conversion from ‘int’ to ‘int16_t’ {aka ‘short int’} changes value from ‘603380224’ to ‘-9728’ [-Woverflow]
    7 |         int16_t lol = 603380224;
      |                       ^~~~~~~~~

The -9728 value matches what dmesg has given.

re. config: it is the one you already provided for tucana, the values seem to match the ones used by my kernel dts/driver/HAL/whatever so it should be good.

Will try your constant-optin tree tomorrow just in case, thanks :)

if (play) {
data->cached_effect.id = -1;
if (data->cached_effect.type == FF_PERIODIC) {
int16_t custom_data[CUSTOM_DATA_LEN] = {data->customEffectId};
custom_data[0] = data->customEffectId;
data->cached_effect.u.periodic.custom_data = custom_data;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that store a pointer to a variable allocated on stack (which soon goes out of scope) in a dynamically allocated structure or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @monich for taking a look at this PR!

Yes, for the sake of upload, it does that. The data should be copied to kernel by the driver.

More or less what's happening here https://github.com/sonyxperiadev/vendor-qcom-opensource-vibrator/blob/aosp/LA.UM.7.1.r1/Vibrator.cpp#L80

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I did miss that it doesn't go out of scope anymore, before being accessed. That's better))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand now what you're saying - the stuct was too localized inside the if to be available outside, where the actual upload happens. So it was not 'compiler optimizes it out' incorrectly, it was correctly discarding it (in a previous experiment I noticed that logging the values 'made' them correct). Thanks for restoring sanity!

@b100dian
Copy link
Contributor Author

I haven't added comments in a while, but what happened in the last 2 weeks was that @voidanix helped identify through logging that there was a compiler optimisation that prevented to local custom_data variable from being set at all when defined close to the upload, so I worked this around by moving its definition slightly in an outer scope. This should now work with CACHED_EFFECTS on Xperia 1/5 too, I hope.

Copy link
Member

@jusa jusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I would like to see the cache effects feature to be runtime configurable with defaulting to "false" to include this in the main tree.

It looks like the behavior doesn't change with undefined CACHE_EFFECTS.

There were also some unnecessary new lines added or removed which could be cleaned while doing other changes.

To configure this cache feature in adaptations which need this they can have file /usr/share/ngfd/plugins.d/60-ffmemless.ini with

[ffmemless]
cache_effects = true

Read from plugin props, something like:

cache_effects = !g_strcmp0(n_proplist_get_string(props, "cache_effects"), "true");

@b100dian
Copy link
Contributor Author

b100dian commented Mar 1, 2022

Thanks for the PR! I would like to see the cache effects feature to be runtime configurable with defaulting to "false" to include this in the main tree.

Thanks @jusa for reviewing this. The only drawback from runtime configuration is that the field cached_effect will be present for all, just not used.

To configure this cache feature in adaptations which need this they can have file /usr/share/ngfd/plugins.d/60-ffmemless.ini with

[ffmemless]
cache_effects = true

Read from plugin props, something like:

cache_effects = !g_strcmp0(n_proplist_get_string(props, "cache_effects"), "true");

Also thanks for acknowledging that the hardest part in this is getting a bool out of the config file:) One version I did before was taking into account only the key presence, but comparing to "true" sounds good enough (and better than that).

@jusa
Copy link
Member

jusa commented Mar 2, 2022

Could you still squash the commits, prefix the commit subject line with ffmemless: and add something like this to the bottom of the commit message:

[ffmemless] Added constant and custom periodic effects. Fixes JB#57639
[ffmemless] Enable effect caching and upload cached effects before play. JB#57639

@b100dian
Copy link
Contributor Author

b100dian commented Mar 2, 2022

Could you still squash the commits, prefix the commit subject line with ffmemless: and add something like this to the bottom of the commit message:

[ffmemless] Added constant and custom periodic effects. Fixes JB#57639
[ffmemless] Enable effect caching and upload cached effects before play. JB#57639

Thanks, I will address this later today. Just to be clear, you would prefer a single commit or would two also do it?

The custom support is observed in two implementatins as using
3 words for the data, only the first being input (id) and the
other two being output playback time.
Also adds effect caching so they can be uploaded right before play.

[ffmemless] Added constant and custom periodic effects. Fixes JB#57639
[ffmemless] Enable effect caching and upload cached effects before play. JB#57639
@b100dian b100dian changed the title Adding constant and custom periodic effects. Upload before play. ffmemless: Adding constant and custom periodic effects. Upload before play. Mar 2, 2022
@jusa jusa merged commit 44a0cad into sailfishos:master Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants