Sunday, December 27, 2020

Mounting external SDCARD for WhatsApp

The way how WhatsApp using sent and received messages writing everything to internal sd card is very unfortunate for phones with small amount of build in memory. There is no default option to provide another path for Media files.

Since Android have mount folders capability the first try was to use bindfs from here: https://github.com/agnostic-apollo/bindfs/releases/tag/v1.0

DIR=/mnt/media_rw/[SD_CARD_FOLDER_NAME]

/mnt/bindfs-armeabi-v7a -o nonempty,nosuid,nodev,noexec,noatime,context=u:object_r:vfat:s0 -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore $DIR/WhatsApp /mnt/runtime/write/emulated/0/WhatsApp

But this approach were showing folders in /mnt/runtime/write/emulated/0/WhatsApp only for command prompt which was started from the phone itself, even starting the

Lucky Patcher Directory Binder were working only for default browser, but X-plore, for example, were not showing the mounted folder files and WhatsApp were not picking this either.
Here is a tutorial: https://proandroidgeek.blogspot.com/2015/04/how-to-use-directory-binder-in-lucky.html

However, using builtin mount command did the trick:

mount -t sdcardfs -o nosuid,nodev,noexec,noatime,mask=7,gid=9997 /mnt/media_rw/[SD_CARD_NAME]/WhatsApp /mnt/runtime/write/emulated/0/WhatsApp

This allowed WhatsApp to write/read using external sd card. Command could be set as a startup script in Tasker, for example, or placed in init.d, which is harder, but also could be as an option.

Note: at the moment of writing this post these commands were tested only on Samsung Note 4 with Marshmallow, SuperSU.

Saturday, December 26, 2020

Starting VLC to play audio sources simultaneously

 Ever wanted to play movies through two different audio outputs?

Here is the solution:

Step 1. Start two players from console with HTTP:

vlc --extraintf=http --http-host 127.0.0.1 --http-port 8081

vlc --extraintf=http --http-host 127.0.0.1 --http-port 8082

Step 2. Select audio output and audio track for the opened players.

Step 3. Use following command to simultaneously start and stop video.

curl http://127.0.0.1:8082/requests/status.xml?command=pl_pause & curl http://127.0.0.1:8081/requests/status.xml?command=pl_pause

Note: curl is available by default in the latest Windows builds