Sunday, January 23, 2022

XP-PEN Display Tablet Express Keys "fix" for M1 Mac

UPDATE 7 FEBRUARY 2023
A macOS update apparently made the version 2.0 drivers stop working.  I also ran into an issue where, because I'm using custom display profile overrides the tablet settings app cannot find the names of my displays nor could it tell there were two of them (it sees both displays as one ultrawide).  After some playing around with both newer and older drivers I am now recommending you use the version 2.1.6 driver.  It does have a bug that causes it to sometimes lose all your custom settings (like hotkey assignments), which you can mitigate by locking the actual settings file so it's "read only."  (You can find it at ~/Library/Preferences/com.ugee.pentabletsetting.plist and lock it by right+clicking and select "Get Info" then in that dialog tick the "Lock" box)  But don't do that until after you've finished getting everything set up the way you like.  Also, some apps simply won't accept your custom settings from this driver.  For example, even with the default button assignments on my tablet where K1 = increase brush size, K2 = decrease brush size, CSP sees the first one correctly - but inconsistently - and the second one as "eye dropper."  Even if I assign those to "]" and "[" it shows at the bottom of the display that the tablet IS using the configured keyboard character, but CSP ignores it.  In Affinity Photo, though, it all works as intended.  So this comes with a heavy dose of YMMV.  You can still try the version 2.0 drivers and see if they work for you, but otherwise:

DOWNLOAD THE XP-PEN 2.1.6 DRIVERS FOR macOS

The 2.1.6 drivers *should* automatically create entries for the macOS Privacy settings as shown below in the original post, but you'll want to make sure they are checked, and your tablet will not work until you restart your Mac.  On restart you'll likely see a bunch of privacy/security pop-ups and you need to authorize all of them.

------------ original post follows --------------

Both I and one of my friends own the same model XP-PEN Artist 15.6 display tablet and M1 Macs.  It's a nice tablet for the money but the support for Mac users is terrible, especially since the M1 "Apple Silicon" chip was introduced.  The tablet itself is actually made by Ugee and I think XP-PEN is just one of many "brands" the same tablets are sold under (their websites have the same layout, the driver files are the same versions, the interface for their preferences app is the same, they just swap out some images).

So, anyway, the "New UI" version 3.x drivers are garbage.  They absolutely do NOT work.  Version 3.0.5 would at least detect the tablet if you unplugged it and plugged it back in, though you couldn't configure the pen or the Express Keys as none of the sections would appear in the left-hand column of the preferences app.  The versions after that won't detect the tablet at all. 

I'm using the USB-C to USB-A + HDMI cable that came with my tablet because I'm mirroring my primary display to the tablet through an HDMI splitter.  I haven't tried connecting my display tablet with a USB-C cable, but from what I've read on their forums and Reddit, it doesn't sound like that would make any difference.

The (as of this writing) current 2.1.8.2 drivers are listed as the "Official" ones on XP-PEN's website, and if you have an M1 Mac they will get you up and running, but you won't be able to assign your Express Keys.  There's a bug in those drivers that won't let you reassign them properly and I doubt they'll ever fix it because they've moved on to developing their worthless 3.x drivers.

The Express Keys bug was also present in 2.1.7 version of the drivers and a different bug was present in the 2.1.6 drivers.  The 2.1.6 will let you reassign the functions of the keys, but they were inconsistent in actually working.  When yo press one it displays a message across the bottom of the screen confirming not only that the button was pushed by tells you in bright green lettering what it's supposed to do.  Except on a M1 Mac it wouldn't always actually do it (the drivers seem to work fine on my Intel Mac).

XP-PEN frustratingly does not provide an archive of older versions of their drivers.  And, no, you can't get them through the Internet Archive Wayback Machine either.  Thankfully between three computers I had installers for several different older versions.

After installing and testing and uninstalling ALL of them on my M1 Mac I finally found ONE that actually works the way it's supposed to!

The Version 2.0 drivers that ACTUALLY WORK are, ironically, the oldest ones I have.  The ones I downloaded when I bought my tablet.

You can get them from my Google Drive but installing them in Big Sur is not exactly straight forward.

1. UNINSTALL your current XP-PEN drivers!  Use the "Uninstall" app in the same folder as the Settings app.

2. RESTART your computer to make sure it's gone.

3. Download the installer ZIP from that link in the line above.

4. Unzip it and inside there should be one file: XP-Pen Mac(20180425).pkg 

5. Right+Click on that file so the context menu shows up.

6. Press the OPTION key on your keyboard and then select "Open" from the context menu.

7. The macOS Gatekeeper will warn you about opening it, go ahead and do it anyway.

8. Run the installer and wait for it to finish.

9. It will finish saying "Installation Failed!" but it's a liar, the installation worked just fine. Close the installer.

10. Go to Applications --> PenTablet --> PenTabletSetting.app and open it.

11.  Authorize the app in any macOS security and privacy pop-ups you see.

12. Open System Preferences and go to Security & Privacy

13. Click the padlock icon in the lower left and  enter your login password to unlock it.

14. Scroll the left column down to "Accessibility"

15. Click the [+] button under the list on the right and navigate to:
Applications --> PenTablet --> PenTabletSetting.app

16. Click the [+] button again and this time navigate to:
Macintosh HD --> Library --> Application Support --> PenTablet --> PenTabletDriver.app

17. Now scroll the list on the left to "Input Monitoring" (and we're going to do the same...)

18. Click the [+] button under the list on the right and navigate to:
Applications --> PenTablet --> PenTabletSetting.app

19. Click the [+] button again and this time navigate to:
Macintosh HD --> Library --> Application Support --> PenTablet --> PenTabletDriver.app

20. Restart your M1 Mac.

21. Plug in your XP-PEN display tablet.

22. Go to Applications --> PenTablet --> PenTabletSetting.app and you should be able to set your preferences for pen buttons, pressure, display mapping, and Express Key assignment.

23. EXIT the settings app.

Your settings should now be usable with your tablet.  When you press one of the Express Keys on the tablet you should see a gray bar across the bottom of the screen with text telling you what action is assigned to that button.

When you re-open the settings app be aware you may need to select your tablet from the drop-down list at the top before it will actually load your custom settings.  I had made my pen pressure softer but when I reopened the settings app it wasn't showing the curve I'd set for the pen, but after selecting "Artist 15.6" from the list at the top it loaded my settings.  They seem to be persistent after that, but if they revert to showing defaults I'd try selecting the tablet in the drop-down first, just to see if your custom settings load.

This WILL fix your issue assigning the Express Keys custom functions.  Whether using these old drivers ends up causing you other problems I can't say.


Tuesday, January 21, 2020

Running Clip Studio Paint in Wine on Linux


I would love it if Celsys released a Linux version of their Clip Studio apps, but I highly doubt that will ever happen.  Though if it did it would go a long way toward me being able to ditch both macOS and Windows (at least for my personal projects).  So, without a native Linux version what to do?  Try to run it in Wine (read more about Wine here).  Emphasis on the word "try" because it can be rather difficult to get programs to actually work in Wine.  They have an App Database which can often help you decide if it's even worth the trouble, which it often is not.

Well, with that stellar sales pitch I'll tell you that Clip Studio Paint 1.9.7 and Clip Studio Modeler 1.9.1 both worked for me in Wine 3.0.1 and Wine 4.0.3 on Kubuntu Linux 18.04 LTS.  You should see similar results with just about any Linux distribution, especially the Debian-based ones like Ubuntu and its derivatives.  I only installed the "trial" versions, but I tested as much as I could and everything I tested seemed to work just like it does on my Windows 10 machine.

Clip Studio Paint 1.9.7 running in Kubuntu Linux 18.04.  As you can see the 3D features also work.


However, I would strongly recommend if you have an actual Windows machine, or if you have a copy of Windows you can install on a partition on your machine and dual boot, that would be the preferable solution.  But let's say you don't have a copy of Windows, or you hate it with passion, or you're not sure you'll use Clip Studio often enough to dedicate a drive partition to it.  Ok then, let's install Wine and configure it for running the Clip Studio apps...

Install WINE


1. Open whatever package manager your distribution uses and search for "Wine" and mark it for installation along with whatever dependencies it needs.  

Sometimes the version available in your distro's repo is really old, in which case you'll want to add the Wine repository as a new source and pull it directly from there.  I'm using Wine 3.0.1 (the latest in my Kubuntu LTS repo), though 4.0.3 is the latest stable release available from Wine HQ.  

However, having the latest release isn't always an advantage with Wine, you'll want to check the app database to see if your particular application(s) are listed and what success or problems others have reported.

Note that you can also install the Wine HQ Release Key and Repository source using the Terminal (this would be for my Kubuntu 18.04 LTS install, but any Debian-based distro would be similar):

wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
sudo apt-get update
sudo apt-get install —install-reccommends winehq-staging

This will allow you to easily install the latest stable or development releases, as well as force previous versions if that's what you need.

Another reason you may want to use the official Wine HQ repo is for reasons I don't know some of the ones in the Ubuntu repos were missing the Wine Gecko and Wine Mono components, which I had to download separately and manually install.  The one from the official Wine repo was complete.

As I said in the intro, I did test this with both Wine 3.0.1 and 4.0.3 and it worked in both of them, and should presumably also work in all the versions in between.

Install WineTricks


2. Install WineTricks from your package manager, along with whatever dependencies it has.

3. Make sure "cabextract" is installed.  If it's not, install it with your package manager.

Install DLLs Clip Studio Needs


4. Run WineTricks and make sure the radio button for Default Wine Prefix is selected and click OK.

5. Select "Install a Windows DLL or component" and click OK.

6. One by one, in the order they are listed install:

vcrun2005
vcrun2008
vcrun2010
vcrun2012
vcrun2013
vcrun2015 or vcrun2017 (you can't have both, I'd recommend 2017)
vcrun6
vcrun6sp6
msxml4
msxml6
mfc40
mfc42

I honestly don't know if all of those are actually necessary but they were the ones listed in the Linux Mint forum post I found that pointed me in the right direction and it shouldn't hurt anything to install all of them.  If any of them do conflict with your running some other software in Wine you can always use Wine Config to create a custom profile just for that app that excludes the problematic one(s).

Install the Clip Studio App(s)


7. Download and run the Windows installer for Clip Studio Paint.  Note that the shortcut icons on your desktop may show the Wine icon instead of the app.  This is because it actually has to run Wine first.  You can edit the shortcut and assign the correct icon to it under the right+click context menu —> Properties though it may correct itself after a reboot.

8. (optional) Download and run the Windows installer for Clip Studio Modeler if you want to set up 3D objects and characters.  This download will also install the Clip Studio materials management app, which does NOT completely work (see below).

9. Try to open and run each of the Clip Studio apps to make sure they actually work.  If the desktop icons placed during installation don't work use Wine's file "Explorer" to navigate to your fake "C:" drive and drill down to the:

"Program Files (x86)" folder → CELSYS → CLIP STUDIO 1.5 → CLIP STUDIO PAINT → CLIPStudioPaint.exe  

Wine has a file Explorer like old-school Windows


If it crashes or freezes instead of running you probably need to change the Windows version in the Wine Config to Windows XP.


Clip Studio Modeler 1.9.1 running in Kubuntu Linux 18.04.  As you can see the 3D setup functions appear to work.


Configure Your Tablet


10. If you have a Wacom tablet and are using KDE as your desktop environment, they have a Wacom Tablet preference panel you can install from Discover (it's sort of like KDE's App Store), but no guarantees it actually works.  If you have some other kind of graphics tablet and it doesn't have a Linux driver (since most don't) you can try installing the generic "Graphics Tablet" app for system settings.  Again, no guarantees it will work.  Getting your graphics table to work, and particularly trying to get pressure sensitivity to work, can be a real bear on Linux.  For example, XP-Pen graphics and display tablets actually do have a native Linux driver available, but you have to run it with "sudo" from a terminal and keep the control panel open in the background (it doesn't appear to be persistent).  YMMV.

Problems Encountered


1. The desktop shortcuts created by Wine don't always open the apps or take such a long time to open them you think it didn't work.  They're far more likely to work if you already have something open in Wine (like the Config utility or Explorer).  Similarly, the links in the Clip Studio app sidebar don't always work for launching Paint and Modeler either.  Sometimes they do, sometimes there's a lag in Wine and they fail to open.  It's far more reliable to navigate with Wine's Explorer app and open the EXE files directly.

2. If you are using Wine 3.x you MUST set Wine Config to "Windows XP" which will trigger an "unsupported OS" warning when you open the Clip Studio apps, but they will work anyway.  If you select any Windows version later than XP you will have problems.  For example, on my system Windows 7, 8, or 8.1 would let the program run, but the canvas would be blank instead of white.  Window 10 would cause a page fault on startup and crash the program.  In Wine 4.x you can set it to Windows XP, 7, 8, or 8.1 but it will page fault if you set it to Windows 10.

3. The CLIP Studio management app does not work properly.  It relies heavily on loading HTML content both from remote servers and a local folder.  The web code uses CSS3 querySelectorAll and the Wine implementation of the mshtml.dll is too old to support it, so the web content fails to load (which is most of the app).  If you have a CLIP account, you should manage it through your web browser instead because you can't do it from this app.  So what does work?  Well, you can use it for maintenance on your Materials and Work folders.  In fact, because the interface is broken, the ONLY way you can get to the management sections for Work or Materials is to first do a Gear → Maintenance → Organize Work Tags / Organize Materials Folders.  At the end of those relatively fast operations it will take you to the management subsections.  You can also use the app to download the large package of Materials when you first run it.

The Clip Studio Assets Management app running in Kubuntu Linux 18.04 (Notice that a LOT of it does NOT load!)


4. Be wary of updates!  An update to the Clip Studio apps, an update to Wine, or an update to any shared Linux library could break the whole thing.  Running apps in Wine is often a fragile balancing act.  When a new update comes along for the Clip Apps you should RENAME your existing "CLIP STUDIO 1.5" folder to something else, like maybe the actual version number (in my case "CLIP STUDIO 1.9") and then install the update, which will create a NEW "CLIP STUDIO 1.5" folder.  That way if the new version doesn't work under Wine you can simply run the previous version without having to reinstall it.

5. Pressure sensitivity can be difficult if not impossible to get working in Wine.  Odds are you will not get it to work, so you'll have to live with fixed pen and brush sizes.  If you don't usually use variable line widths anyway this won't be a problem, but in Wine most graphics tablets only work in "mouse mode."  Also, even if you get pressure sensitivity to work in one program in Wine that doesn't mean it will work in another program.  Recent releases of Wine are supposed to have improved graphics tablet detection, but it's still pretty buggy.

6. It should probably also go without saying, but I'll say it anyway: don't expect any technical support from Celsys if you're running their software in Wine.  For any problems you encounter you're far more likely to find your answers in a Wine or Linux forum anyway.

If you can't live with all this uncertainty then you should probably run Clip Studio in a Virtual Machine running actual Windows (though if you have a copy of Windows you'd be even better off just running a dual-boot set-up to run Clip Studio in Windows directly on your actual hardware).

Thursday, April 4, 2019

Google Chrome "Managed by your organization" when you don't have an organization?



Starting with Chrome 73 when one or more policies are set in the Chrome Browser you'll see "Managed by your organization" at the bottom of the 3-dots menu and at the top of your Chrome Settings screen.   I'm posting this because, first of all I posted it as an answer on Googles support forums and it's pretty clear from the many confused, freaked out, wrong answer posts after that nobody there actually read it; and  Google's official answer isn't terribly useful.  For starters they don't tell you how to clear it.  The links in their answer also aren't helpful if you're a HOME USER who isn't using a Chromebook or your company's G Suite or an organization's computer.  I'm going to tell you below how to get rid of this notice and take control of your browser.

This notice is normal if you're in an enterprise setting like a business or a school where the IT Department is managing the browser capabilities or if you use G Suite for business and you're logged into an account associated with G Suite.

However it's distur
bing to suddenly see it when you're using your private computer at home with your personal account!  If you're using Chrome on your personal computer and saw this "Managed by your organization" appear don't worry, it *probably* doesn't mean anyone hijacked control of your browser.

I say "probably" because there are malware and malicious extensions out there that can reset your home page and/or search engine and they do this by creating Chrome Policies, which will trigger the "Managed by your organization" notice. Allowing an extension to run in or even trying to print from "Incognito Mode" can potentially trigger this, but will persist even when you're back in a normal browsing window.

Deleting accounts or profiles or creating new ones won't get rid of it.   Uninstalling and reinstalling Chrome doesn't work.  It might initially seem like it got rid of it, only to have it show up again.  You may have read somewhere that 
chrome://flags/#show-managed-ui  will fix it.  That just HIDES the notice, it doesn't change any of the managed policies.

Policies apply to ALL users and are set in the operating system not the browser. Unless you're using a Chromebook, then it's managed in the Google Admin Console and applied through your Chrome Profile.  This image explains how it works (image is a link to the Google page about it):


First see what policies are being set and by what by typing in:

chrome://policy

At the top are the "Chrome Policies" set administratively. If under "Applies to" it says "Machine" and the "Source" says "Platform" those are policies that were set ON your computer, they are NOT being managed remotely by Google or nefarious parties unknown.



If there are any extensions setting policies you can simply remove the extensions. Though some extensions NEED to set policies in order to work, for example password managers. That's why it's important to learn what policies they're setting and why.

MAC

On Mac this is pretty easy. You don't even need an Administrative level account.

1. Write down each "Policy name" (they're case-sensitive)
2. Quit out of Chrome entirely
3. Got to Applications 
→ Utilities → Terminal
4. In the terminal type the following for each Policy Name (example is "HomepageLocation"):

defaults delete com.google.Chrome HomepageLocation

Hit enter. Do this for each Policy Name until they've all been deleted.

5. Restart Chrome. If you did it right the "Managed by your organization" at the bottom of the 3-dots menu should be gone. You can double-check by going back to chrome://policy which should be empty of policies now.

Note that if you miss or leave even ONE you will continue to see the "Managed by" notice.

WINDOWS

Windows has tools you can download a fixer app:

Chrome Policy Remover: https://drive.google.com/uc?export=download&id=0B5uG-tHNHBj5XzNJbzlsd0NONnc

You can also do the fix manually by deleting a registry entry:

\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome
or
\HKEY_CURRENT_USER\SOFTWARE\Policies\Google\Chrome

Then run the Chrome Cleanup Tool:
1. Open Chrome
2. Go to the 3-dot menu and "Settings"
3. Click "Advanced" at the bottom of the Settings page.
4. Under "Reset and clean up" click "Clean up computer"
5. Click "Find"
6. If you're asked to remove unwanted software click "Remove"

Linux

It uses a JSON file to set user, rather than group, policies for the browser.  It's rather complicated.  Here's the Chromium Project page explaining it: http://dev.chromium.org/developers/how-tos/enterprise/adding-new-policies

Ultimately if you know they're being set at the operating system level (and if you're not on a Chromebook they will be) and you have administrative privileges on the computer (which you probably do if you own it) then YOU are the "organization" that is managing these policies.

Saturday, February 23, 2019

Character Model Reference Sizes

If you're trying to make 3D character models from scratch it is helpful to know the actual dimensions of real humans.  One of the best resources for this information that I've found are the dimensions for the Alvanon Forms.

Alvanon is a company that makes and sells dress forms (aka "dressmaker's dummies") for the fashion and apparel industries.  They also do extensive research on the dimensions of actual human beings, both adults and children, all around the world.  They do sell 3D model services, but they are very expensive and geared exclusively toward their target industries.  In other words, you can't buy one of their standard male or female models to use as a posing dummy in Clip Studio Paint or as a base in your 3D modeling software.

But they do have a massive amount of data on human dimensions you can use as a starting point.  On their website there are PDF product data sheets for each of their many dress forms:

https://alvanon.com/resources/alvaform-manual/

If you go to the last page of each of those product data sheets you'll find all the dimensions for the dress forms in both inches and centimeters in a chart like this:


You can glean the dimensions you need from there.  In this sample it is for six men's UK clothing sizes, but what are useful are measurements such as the Total Height, Inseam, Across Shoulder, etc.

Of course it's helpful to know how they arrive at those measurements so you'll also want to check out the Measurement Specifications documents:


Which have useful charts like this inside:

Universities are also doing this kind of work for other industries.  For example, here is a 2018 survey published by the University of Malaysia Engineering Department which gathered anthropometric data on Malaysian, Thai, Filipino, and Indonesian men and women:

https://www.ias.ac.in/article/fulltext/sadh/043/01/0010 (PDF file)

I took a bunch of data from various sources (including the CDC, EU, the Malaysian survey mentioned above, an architectural design website, etc.) and put it all in a spreadsheet to get these "Average Human" dimensions:

           AVERAGE HUMAN DIMENSIONS
================================================
                   MALE     FEMALE    AVERAGE

HEIGHT             1715mm   1588mm    1651mm
EYE HEIGHT         1599mm   1478mm    1538mm
SHOULDER HEIGHT    1411mm   1302mm    1357mm
SHOULDER BREADTH    418mm    382mm     400mm
ELBOW HEIGHT       1072mm    991mm    1032mm
HAND LENGTH         189mm    174mm     181mm
HAND BREADTH         77mm     76mm      76mm
REACH UPWARDS      1724mm   1540mm    1632mm
LOW HIP WIDTH       376mm    382mm     379mm
WEIGHT               77kg   62.5kg    69.7kg
------------------------------------------------

The data sets were based on the geographic location of wherever the particular study was being done, with no break-down by race or ethnicity, just male and female.  So it's probably not as globally encompassing as it could be.

In addition to the apparel and fashion industries, knowing these numbers could be useful to engineers, architects, furniture designers, industrial designers, and probably video game, 3D animation, and other artists who work with or from 3D character models.

Friday, August 31, 2018

Clip Studio Modeler FINALLY officially in English!



The version 1.8.0 release of Clip Studio FINALLY has an official English language version of MODELER!!

Ok, here's the catch: it's not the FULL version of Modeler.

You'll still have to create your models in some other program.  This is just the FREE bits, which is everything Clip Studio Coordinate (also a free program) could do for setting up 3D assets.  However Coordinate never got an official release in another language or outside of Japan, so this pared-down version of Modeler is more than we got before!

Presumably, at some point, they'll also unlock the other features of modeler for an additional license fee.  But for now you can't actually MODEL in this version of Modeler.

You can go download it here:
http://www.clipstudio.net/en/modeler

Friday, April 27, 2018

HaiPad M701-R Firmware & Hacks


I bought a "Haipad" M701-R back in 2010, shipped directly from Shenzhen China, about a month before even the Samsung Galaxy Tab 7.0 was available.  For a no-name Android tablet it turned out to be surprisingly well built.  As I write this in April 2018 it's usefulness isn't so great, but it still works!

I used to run a user group over at AndroidTablets.net for this tablet.  But during one of the redesigns of their website the user groups were apparently eliminated - along with all that collected knowledge.  Now, only those things that were copied into the public forums survive...and what I archived offline.

I strongly recommend you use the custom MalaRom firmware on this tablet!  It is superior to any of the stock ROMs, 1.1.0 is already rooted and tweaked, and there is also an optional pack of drivers for almost any USB device Linux supports that will make the micro-USB port a lot more useful.  You can get MalaRom builds here:

http://www.michel-lange.net/tcc/

Be aware that Haipad sold this exact model number in both 2GB and 4GB versions with Samsung, Hynix, or Micron flash storage - so make sure you grab the correct version!  The ZIP should also contain the FWDN firmware flashing app (but it's Windows only).

If you're running one of the stock firmwares (there were about a dozen releases) you'll probably need to root and hack it. I've collected all the useful hacks for the Haipad M701/M701-R in one place so you don't have to hunt for them.

USING ANDROID DEBUG BRIDGE (ADB)

You will need the Android SDK from Google for these, so go get it here: http://developer.android.com/sdk/index.html

If you are using Windows you need to also get the USB Driver: http://developer.android.com/sdk/win-usb.html

HACK DRIVER android_winusb.ini FILE
You may have a problem getting the ADB Driver to connect to your tablet.  That is because the drivers from Google only support a small list of devices (all phones) and you need to add your tablet to that list!

1. Copy one of the existing sections with two parameters something like this:

;Moto Sholes
%SingleAdbInterface%        = USB_Install, USB\VID_22B8&PID_41DB
%CompositeAdbInterface%     = USB_Install, USB\VID_22B8&PID_41DB&MI_01

2. Paste it in between a couple of the other entries
3. Change the device name (";Moto Sholes" in my example) to ";Haipad M701"
4. Go to the device manager
5. Double-click on ADB (which should have an question mark next to it).
6. Select details.
7. From the dropbox select “Device Instance ID” and copy the VID and PID
8. Paste the VID & PID values into the entry you created
9. Either reinstall or update the driver
10. Open Console, cd to the SDK /tools folder and type "adb devices" (without the quotes) - your device should now show up as connected.  However it may show it as a gibberish-looking device ID instead of the name, which is normal.  I start every ADB session by first checking that I can connect to my device.

Things to keep in mind!
1. Back up your tablet if you can, any little mistake in ADB could brick it!
2. You MUST have changed directories into the SDK /tools/ folder to run ADB
3. When PUSHING files the first path is referring to your desktop computer, 2nd to the tablet
4. When PULLING files it's the other way around (and it has to be a directory you can write to)
5. You type [B]adb.exe[/B] on Windows and [B]./adb[/B] on Mac & Linux
6. The "#" hash sign indicates the shell prompt on the Android tablet, don't type it in.

ROOT YOUR TABLET
You need the "su" and "SuperUser.apk" apps.  SuperUser.apk is available from Market.  Google for "su" or download it from http://bit.ly/su2361ef (this may only be for Eclair, I'm not sure).

adb shell mount -o remount,rw /dev/block/mtdblock3 /system
adb push su /system/bin/
adb shell chmod 4755 /system/bin/su
adb push Superuser.apk /system/app/
adb shell reboot

Once Rooted, on the device you can enter the following in a terminal app to get "write" access to the file system:

mount -o remount,rw /dev/block/mtdblock3 /system

REMOVE CELL STANDBY SERVICE
A tablet is not a phone.  It doesn't have a cell radio.  Yet if the OS thinks it's a phone (because it is a phone OS) the cell standby service can drain your battery.  Best to get rid of it:

adb shell mount -o remount,rw /dev/block/mtdblock3 /system
adb shell mv /system/app/Phone.apk /system/app/Phone.OLD
adb shell mv /system/app/TelephonyProvider.apk /system/app/TelephonyProvider.OLD
adb reboot

(This technically doesn't remove it, you can always reverse the process and change the .OLD back to .apk and it will restore them - so it's easy to undo).  I just did this myself so I'll have to update this post when I know how much (if any) extra battery life I got out of it.

Also, put your tablet into "Airplane Mode" (Settings>Wireless>Airplane Mode) and turn off GPS (Settings>Location & Security>Use GPS satellites) since the tablet doesn't have a GPS module either.  Turning these things off can also help improve battery life, and you can still enable Wi-Fi while Airplane Mode is on.  You won't, however, be able to use Google Maps or Latitude - they require the GPS option be checked even if there isn't actually a GPS module and the apps are using wireless networks to find your location.

REMOVE EOE MARKET APP
If you don't intend to ever use the EOE Market for apps you may just want to get rid of it.  Here is how to do that:

adb remount busybox
adb shell
#rm /system/app/eoemarket.apk
#cd /system/bin
#sh pm uninstall com.eoeandroid.market
#sync
#exit
adb reboot




ABOUT GOOGLE APPS (GAPPS)
I've never been clear on whether Haipad paid the license to include Google's apps on this tablet or not, but the real problem is that Google Play Services, Play Store, Maps, etc. continue to increase inside and are very, very bloated compared to the versions originally installed on this tablet.  If you have the 2GB version of the tablet you probably won't be able to install anything else if you update the Google Apps to their last compatible versions.

Therefore I would recommend you de-Google-ify this tablet entirely and either download apps via the browser from some trustworthy website providing APK files (I would suggest https://www.apkmirror.com) or side-load the apps to the device instead.

UPDATE GOOGLE MAPS
You may have already found out you can't update Google Maps.  You first need to get rid of the pre-installed one:

adb remount busybox
#rm /system/app/Maps.apk
#cd /system/bin
#sh pm uninstall com.google.android.apps.maps
#sync
#exit
adb reboot

Now, go to Market and install the current version of Google Maps.  The newly installed one will be able to update normally.

Again, though, I'd recommend just uninstalling it and not reinstalling it at all.  This tablet doesn't HAVE a GPS chip in it, so the usefulness of the Maps program is questionable.

CHANGE BUTTON LAYOUT
I don't really advocate you do this, but some people want the buttons to do other things or want to swap around which button does what. 

I should start by mentioning there is one button alteration you can make without hacking system files or even needing a rooted tablet!

If you have the app "SpareParts" (either the ad supported or sdk version) on your tablet go to the "End Button Behavior" setting. You can change the behavior of the Top Left button to either "do nothing" (why?), "Go Home," "Sleep" (what it is already set to), "Go Home and then Sleep."

Now, if you want more control than that there are apparently TWO different files you have to change to reassign all three buttons:

/system/usr/keylayout/qwerty.kl
/system/usr/keylayout/telechips_keypad.kl

Just pull those with adb to your desktop, MAKE BACKUPS, and open them in a text editor.

The magic key scancode values are:
107 = Top Left
139 = Top Right
158 = Front

Some guides I found said you only need to change the first one, but to get it to work I had to change values in BOTH files so they matched.

As for changing short press and long press values, the long press functions are kind of paired up with a short press one as follows:

HOME | RECENT APPS
CALL | VOICE DIALER
SEARCH | VOICE SEARCH
MENU | SOFT KEYBOARD
SLEEP | SHUTDOWN (actually ENDCALL=SLEEP on this tablet)

So what you do is assign the short press function to a button and it automatically assigns the matching long press function as well. I found out that since Android 2.0 this isn't actually "hard coded" behavior, it can be programmatically over-ridden so apps can change what the buttons do while the app is in use. But if you want to change the default behavior to what you suggested it requires editing Framework files to change the pairings - which I'm not comfortable messing with.

So what I did was found the following lines in each .kl file:
key 107 ENDCALL WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 158 BACK WAKE_DROPPED

and changed them to:
key 107 MENU WAKE_DROPPED
key 139 HOME WAKE_DROPPED
key 158 BACK WAKE_DROPPED

Then I saved the files and pushed them back to the tablet with adb and rebooted.

In case you're wondering (I know I did) what the heck the "WAKE" and "WAKE_DROPPED" flags are all about, they refer to what happens to a button call when the device is already asleep. Does it wake up and send the command or does it wake up and drop the command? Most keycodes appear to be the latter.

Now the top left and right buttons actually match the little icons printed by them. But this creates a new problem - there's no button to properly shut the tablet all the way down! The easiest solution I could think of was to open a terminal and type:

reboot -p

Which, sure enough, shuts the tablet down instantly. The only way to turn it back on is to slide the on/off switch from off and back to on, which immediately begins booting the tablet BUT ONLY IF IT IS CONNECTED VIA USB TO THE DESKTOP! So if you make this hack you will only be able to let your tablet go to sleep when it's disconnected from the desktop.

Thankfully any button will wake it up if it goes to sleep. So it's just the shutdown that is annoying. If you want to put your SLEEP/SHUTDOWN back in just assign "ENDCALL" to your button of choice.

That's all there is to it!

Reference: http://www.androidtablets.net/forum/telechips-based/2212-need-help-rooting-changing-button-layout-m701-r.html#post12782

CHANGE REMOTE CONTROL BUTTON LAYOUT
If you have a M701-R and want to play with changing the button assignments on the Remote Control you can do that to:

pull /system/usr/keylayout/telechips_remote_controller.kl

save a backup copy. Open it in a plain text editor.

The currently assigned values will tell you which button goes with which number, for example here is my stock file:

Code:
key 1 POWER          WAKE
key 2 MUTE
key 3 MEDIA_REWIND
key 4 DPAD_UP
key 5 DPAD_DOWN
key 6 DPAD_LEFT
key 7 DPAD_RIGHT
key 8 DPAD_CENTER
key 9 BACK
key 10 MENU
key 11 HOME          WAKE
key 12 VOLUME_DOWN
key 13 VOLUME_UP
key 14 SEARCH
key 15 MEDIA_PLAY_PAUSE
key 16 MEDIA_PREVIOUS
key 17 MEDIA_NEXT
You can assign any valid values to those buttons, just like the hardware buttons. Might be confusing given how they are labeled on the remote, but if you're the only one using it you can customize the layout however you please (YAY!)

On a related note there is also an Audio/Video Remote Control Profile file (AVRCP.kl) which defines some remote control media operations. These are typically associated with Bluetooth devices (such as a set of headphones with ff/play/rw buttons) but is not limited to Bluetooth devices. These settings are repeated at the end of the the "telechips_keypad.kl" file, so I'm assuming if you change it in one you have to change it in the other for the new settings to take effect. I don't know, however, if these settings are for the tablet as a "control" or "target" device ("control" means the tablet controls other A/V devices, "target" means other devices control A/V on the tablet). It's also possible that this file is intended for Bluetooth devices, which this tablet can't actually use. If anyone wants to play around with the AVRCP stuff and find out you're welcome to it.

As long as I'm digging deep into the key layout files I may as well mention the "h2w_headset.kl" - it only has one button defined in it for a wired headset with a "call" button, which should wake up the tablet. I don't have a phone headset like that so I can't see if it works, but in theory you could assign the button to do anything you wanted.

Reference:  http://www.androidtablets.net/forum/telechips-based/2212-need-help-rooting-changing-button-layout-m701-r.html#post21977

FORGOTTEN SCREEN LOCK PATTERN RESET
If you have already set up a Google Account on your tablet and locked yourself out by forgetting the unlock pattern you should be able to get back in by attempting patterns six or more times in immediate succession - after which it should ask you to enter your Google Account (remember to put the @gmail.com on the end!) and let you in.  There is also an Unlock Page: https://www.google.com/accounts/DisplayUnlockCaptcha for Google Accounts (I don't personally know exactly how this works) but it's supposed to be an alternative if the device isn't asking for your account info.

Despite the fallbacks/safeguards it is still possible (especially on unofficial/unsupported devices like our tablets) to be locked out.  This is also the case if you bypassed the Google Account setup and subsequently locked yourself out of the tablet, which would have no Google Account associated with it yet.  Here is the possible fix over ADB (no guarantees this will work for you though):

1. Plug the tablet into the computer via USB and turn it on/boot it up.
2. Open a Terminal/Console and change directories to your Android SDK /tools/ folder.
3. Enter ADB commands.

adb -d shell
# sqlite3 data/data/com.android.providers.settings/databases/settings.db
   sqlite> update system set value=0 where name='lock_pattern_autolock';
   sqlite> .exit
# exit
adb reboot

If all went well the tablet should now boot WITHOUT the pattern lock enabled!

It will probably ask you for account info again like the first time it was booted. You can bypass that by pressing in all four corners in sequence upper left, upper right, lower right, lower left (if I recall correctly). Once into the tablet perform an actual factory data reset or it will pester you for setup info EVERY time you boot it. Go to Privacy>Factory Data Reset>Reset

Last resort is to reflash the tablet firmware, which will wipe out whatever is on it and let you start fresh.

WILL THERE BE FUTURE UPDATES?

No.  Most of the no-name Chinese tablets had little to nothing in the way of customer or software support after the sale.  The Haipad was the exception, by providing about a dozen firmware updates before they ended support.  Unfortunately Haipad ran into the same problem as custom firmware developers did - the South Korean chip maker Telechips wouldn't release their source code, so nobody could cook up any firmware for a later version.  Ok, I take that back, they did ultimately release the source code for a Honeycomb kernel on that chip, but nobody was ever able to successfully build from that source.  And it took a massive e-mail campaign and complaints about them not abiding by open source rules to get them to release anything.

So the lowly M701 tablets are forever stuck on Android "Gingerbread" and of the ROMs for this tablet the MalRom custom firmware remains the best.

WHAT GOOD IS THIS THING ANYWAY?

Well, the screen on it is pretty low-res but it doesn't hurt your eyes with terrible contrast or abysmal viewing angles, so it's ok as an e-reader, or for checking your POP/IMAP email, webmail, some web browsing (keeping in mind the browser is badly outdated and never got security patches).  It streams audio and video pretty well (considering it only has a 802.11/g wifi chip in it) and plays audio and video files from a micro-SD or USB flash drive quite well.  Combine that with the full high-def HDMI output and the infrared remote, and it's an okay way to get some digitized movies up on a TV screen without having to muck about with Airplay or Chromecast or Miracast.

The resistive (rather than capacitive) screen means you can use it with gloves on.  You can use any pointy thing as a stylus on the screen.  I used to have a sketching app called "Maple" on it and, so long as you're not expecting pressure sensitivity, it was ok for dashing off quick drawings.

What it's good for depends on what uses you might have for it, and what compromises you're willing to accept. ;)

Wednesday, April 18, 2018

Stop Avid Composer Background Java Processes

Today I noticed in Activity Monitor that there were multiple “java” processes constantly running under both CPU and Network and wondered what they were.  Double-clicking to get info showed they were launched by “bash” and owned by "root."  That didn’t tell me much so I ran this command in the terminal:

sudo fs_usage -w -f filesys java

That gives you TON of info, but most importantly it revealed that it was Avid/EditorTranscode/rnc-central/lib/ and then a bunch of things after that.  I wasn’t using Avid, and hadn’t in a while, so why was it seemingly running a bunch of transcoding processes in the background!?

No idea.  But I wanted it to stop.  Since the processes were owned by “root” but there are no Avid launchers in System/Library/LaunchAgents or System/Library/LaunchDaemons I figured they were probably owned by "root" only because the system "bash" had been used to launch them.  That led me to look in Library/LaunchAgents or Library/LaunchDaemons (the "Library" folder that's at the root of the Mac drive, not inside "System").

There are some com.advid… plists with “transcode” and “editor” in the name set to “RunAtLoad” so I changed the <true> to <false> in these:

com.avid.interplay.editorbroker.plist
com.avid.interplay.editortranscodestatus.plist

Then, because I'm not using Avid's Cloud Service I didn't see any reason for it to be doing stuff either.  So I changed the “KeepAlive” to <false> for the Avid Cloud service too:

com.avid.transport.client.plist

That seems to have successfully killed all these java processes that were constantly running in the background.

I like Avid Composer, but I don't use it very often and I hate that it assumes you want it - and all its components - ready to go at a moment's notice so it keeps all these bits and pieces active in the background all the time.  It's obvious it's meant to be installed on a dedicated video editing workstation and not your everyday computer.