Yearly Archives: 2021


Gaming with PlayStation Controllers of Android

Recently we decided to try and game on Android (specifically on a OnePlus 6T) using the controllers of Sony Playstation (Sony DualShock 4 wireless controller and Sony Dualsense wireless controller).

Sony DualShock 4 wireless controller

To use the Sony DualShock 4 wireless controller (https://www.playstation.com/en-us/accessories/dualshock-4-wireless-controller/), we paired the device using Bluetooth technology. To do so, we pressed the PlayStation logo button and the Share button to set the controller into pairing mode. Then, from our Android device, we paired the new device that appeared to have the name Wireless Controller.

We tried to play the game of Doom which worked like a charm! We had all functionality and the button mapping seemed very convenient.

Sony Dualsense wireless controller

To use the Sony Dualsense wireless controller (https://www.playstation.com/en-us/accessories/dualsense-wireless-controller/), we paired the device using Bluetooth technology again. To do so, we pressed the PlayStation logo button and the Create button to set the controller into pairing mode. Then, from our Android device, we paired the new device that appeared to have the name Wireless Controller.

To our disappointment, when we loaded the game of Doom we realized that the button mapping was very weird and not functional. The Slayer would spin all the time (you could prevent it by spinning in the other direction) and there was no button mapped to firing.

Conclusion

Sony DualShock 4 wireless controller worked like a charm on Android while Sony Dualsense wireless controller had some weird button mapping configuration making it unusable to play.

More results

After some additional investigation, we post the following:
We could not get the Dualsense controller to work as expected on any version of Android.
On the other hand, the Dualshock controller worked correctly on the following configurations:

  • OnePlus 6T + Android version 11
  • Samsung Galaxy S9 + Android version 9
  • Samsung Galaxy S9 + Android version 10

The Sony Dualshock controller failed as well on the following setup

  • Samsung Galaxy S9 + Android version 8

From these results, we can assume something was created or fixed in Android 9 and higher that allows Sony Dualshock wireless controller to work properly on Android devices.


Ubuntu how clear journal logs and free up some disk space

On a machine that has Ubuntu 20.04LTS was recently running out of space, while using the Disk Usage Analysis tool we noticed that /var/log/journal was taking a bit more than 4 GB.

We knew that the machine was not hosting any kind of public service nor did it have any hardware problems, so we decided to clear up old logs. To do so, we used the following command that removed all logs that were older than two days.

sudo journalctl --vacuum-time=2d;

The result was great as it saved 3.9 GB of space:

Vacuuming done, freed 3.9G of archived journals from /var/log/journal/ee4a566eacf347dbb47e03b3f33821a1.

More information on journalctl can be found here. You can find more options on removing old logs, for example limiting the total size of logs that you want to keep, using this variation which will keep only 50 MB of data:

sudo journalctl --vacuum-size=50M;

2-on-2 A.I. football players trained with reinforcement learning M.L. playing against each other

This lengthy video shows several hours of 4 artificial intelligence agents playing football. The players were trained with machine learning. This means that they were never instructed on how to play football or what their purpose was. After several tries, they found out that getting the ball into the opponents’ goal rewards them, while if the opponent achieves the opposite effect, they receive a penalty.

This video was produced using the Unity game engine.