Monday, December 30, 2019

Pt 2 :: A33 (quad core 32-bit Cortex A7) Allwinner notes

Links: key xda post :: firmware site

Ok, here we go again.

  1. Uses eMMC (not NAND) flashing
  2. Can run the installation from an SD card, which makes no changes, but allows users to do so.
  3. Maybe can use linux scripts in lieu of PhoenixCard or Phoenix USB (manufacturer), or Live Suite (retailer)

Command line connection

This particular Allwinner (A33) has a sunxi sun8i SoC (System on a Chip). I found this using the app, "Terminal Emulator for Android" and looked in the /system directory.

adb

NB: both boot.img and recovery.img are image files, so one needs to know which is which to know which directory into which to put them.

Different ID's depending on mode, like other phones.

$ lsusb
1f3a:1007 Allwinner Technology Android
18d1:d001 Google Inc. Nexus 4 (fastboot)
Similarly with the ADB's; depends on the mode.
$ adb devices
List of devices attached
990c3b4b07f100000000 device
990c3b4b07f100000000 recovery
990c3b4807f100000000 sideload
$ adb reboot bootloader [to run other adb's]

fastboot

press power and volume down at same time. When it's correct, you'll see only the A33 Quadcore logo with caption "Allwinner Tech". Verfiy...

# fastboot devices
Android Fastboot fastboot

yes

fastboot devices
fastboot erase boot [or recovery, data, cache, system]
fastboot continue

no

fastboot devices
fastboot flash boot someimage.img [block size]
fastboot continue
video unbrick with SD card It's possible that the initial "fastboot flash boot" failed with block size errors because all block sizes in the phone must be 1024 (native to phones), not 4096 (native to my laptop and desktop) or 256 I got the PhoenixCard here and then tried to use it with Wine.

Sunday, December 29, 2019

wine -- can we do this better?

Wine works but has been useless to me since its creation. Each app requires a custom installation -- that's fine -- but when we start the actual app with the "wine" command preceeding the EXE file, Wine "updates"(overwrites) the custom settings, and one receives the same suboptimal performance as if customization hadn't been accomplished in the first place. Because it's been entirely eliminated. It's essentially a repeat of the old problem we used to have with Python when running "pip" instead of a package manager. But Wine doesn't ask first.

Summary of iRoot steps

See backstory below for the steps regarding this USB connected device.
  1. Download PC version from website.
  2. Enter the ~/.wine and delete all files
  3. Prepare Wine and .NET using winetricks
    $ mkdir .wine/Win7
    $ WINEARCH=win32 WINEPREFIX=/home/$USER/.wine/Win7 winetricks dotnet452 vcrun2010 corefonts wininet
  4. Unzip the downloaded installation file somewhere, eg ~/.wine/Win7install.exe
  5. Install the iRoot program using wine.
    $ WINEPREFIX=/home/$USER/.wine/Win7 wine explorer /desktop=somename,720x480 "/home/$USER/.wine/Win7/iRoot_1.8.9.21144_cid1005.exe"
  6. Connect the tablet via USB and be sure screenlock is off, and data transfer enabled.
  7. Run the program, using wine. You could make an iDesk icon or menu entry with same info.
    $ WINEPREFIX=/home/$USER/.wine/Win7 wine explorer /desktop=somename,720x480 "/home/$USER/.wine/Win7/iRoot/1.8.9.21144/Root.exe"

Summary of audio editor steps

  1. $ mkdir .wine/Win7/audio
  2. $ cp audio.exe .wine/Win7/audio/audio.exe
  3. $ WINEPREFIX=/home/$USER/.wine/Win7 wine explorer "/home/$USER/.wine/Win7/audio/audio.exe"

backstory

For me, there are four applications with operating system complexity inside Linux use: Linux itself, LaTeX, Wine, and Blender. Plus perhaps the only slightly lesser issues of ALSA audio and CUPS printing. This time it was Wine, due to the need for two Windows PC apps, one for audio editing, another (iRoot) for rooting a cheap tablet. The former was straightforward, but the tablet rooting app was apparently developed using the .NET framework, and requires a USB connection to the tablet. As is well known, even in Windows proper, .NET dependent USB connections are horrible. Then add Wine complexity. The plan was to work through the errors to get a good Wine installation, then do the same thing for a good application installation.

part 1 :: wine (12+ hrs)

Strategy: follow someone else. Bracing for turbulence and a lost weekend, I downloaded the iRoot PC app and began Googling. The closest I could find was the Garmin Nüvi PC application for updating maps. It is .NET framework dependent, with a USB connection. Chris Titus has a helpful video (11:45) and a helpful web page on the Garmin. I followed his steps, only with the iRoot app, but wasn't successful. It's important to be specific about failures, the USB device was detected but then...
... and the tablet did not appear in the iRoot app, in spite of being detected beneath the hood.

directory structure

Unless two applications can run on the same version of Windows, each application requires a separate installation of windows. I put them in folders as seen here.
That is, although I keep wine and winetricks in the system, I completely eliminate all their files inside of /home/foot/.wine/. I then add directories for each version of Windows required. Based on my iRoot application, and Chris Titus' stuff above, I knew I wanted to work it into Windows 7.
$ mkdir .wine/Win7
$ WINEARCH=win32 WINEPREFIX=/home/$USER/.wine/Win7 winetricks dotnet452 vcrun2010 corefonts

installation errors

During the .NET (dotnet452) portion of the installation, several files are downloaded from Microsoft. A status box (left) also appears, and displays the error that I lack "Windows Modules Installer Service" (C:\Windows\servicing\TrustedInstaller.exe). I sought this executable afterward, but could not locate it. Based on the terminal, it appears the lack of this file prevented a certain level of software use.
0060:fixme:service:QueryServiceConfig2W Level 6 not implemented
I hoped to perhaps remedy this via the cleanup tool, once the Win7 was in, the next step.
$ WINEARCH=win32 WINEPREFIX="/home/$USER/.wine/Win7" winetricks win7

registry cleanup

This doesn't have to be run, but I was curious about it. With Windows 7 in, I placed the cleanup tool just inside the Windows 7 installation, in /home/foo/.wine/win7/drive_c/. It should look like this:
I had read about the (.NET framework cleanup tool) and wanted this operating. Cleanup would also have to be placed in any other installed folders -- XP, 10, whatever -- in which a person wanted to check their .NET install. The prefix is the OS folder, and then I gave it a 720x480 desktop to run inside, in case the Cleaner requires one.
$ WINEPREFIX="/home/$USER/.wine/win7" wine explorer /desktop=cleaner,720x480 "/home/foo/.wine/win7/drive_c/cleanup_tool.exe"
As it ran, the Cleaner, among many thousands of errors it revealed, noted the lack of level 6 implementation. Here are some of the error notifications...
Level 6 is not implemented.
HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Components key is not present.
No product/patch data was found.

part 2 :: application (12+ hrs)

First run indicated some missing pieces from my installation
0054:err:wininet:open_http_connection create_netconn failed: 12029
... it appeared the program needed to dial home. So, I added the missing wininet.
$ WINEARCH=win32 WINEPREFIX="/home/$USER/.wine/Win7" winetricks wininet
Here's more of the garbled mess that popped up. The program itself indicated a bug.

dead ends

A collection of various things I tried and which were apparently irrelevant.

lack of Windows Module Installer Service

During .Net (aka. "dotnet452") installation, if the installer is unable to find the Windows Module Installer Service,then it provides an error window. There is a noticeable effect downstream from this.
For example, error messages will appear if one attempts to attach a USB device via USB. This is because Level 6 of the .Net installation was not met. The USB device will successfully be detected, but the device will not be able to send file information or be written to. The complaints will take a form similar to...
0060:fixme:service:QueryServiceConfig2W Level 6 not implemented
The situation has been encountered by others, for example as documented here.

linux library checks - AUR

One of my dead ends was checking the Linux libraries. Mine turned out to be fine, but I read of them being a problem for others and having similar problems. Eg, a Battlenet article noted some missing Linux libraries had led to fails. The only one I thought might be mine was hal, so I checked for it...
$ ldconfig -p | grep hal
... returning nothing. Hal is in the AUR,so it has to be built.I'd want the 32 bit version. My luck, yaourt is no longer functioning.
$ yaourt -Ss hal
package-query: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory
$ ldconfig -p | grep alpm
libalpm.so.12 (libc6,x86-64) => /usr/lib/libalpm.so.12
libalpm.so (libc6,x86-64) => /usr/lib/libalpm.so

... so it's annoying as heck. Time to move to yay, I suppose; yaourt getting just too unmaintained -- I'm not going to create softlinks to libraries and such. Buh-bye...

yay build

# nano /etc/sudoers
foo ALL=(ALL) ALL
... otherwise the build will fail. Then...
$ cd Downloads
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

Sunday, December 22, 2019

video card replacement - hdmi

Although it looks imposing and is potentially a solid choice, I became tired (2019) of the 2Gb nVidia GeForce GTX770 (GK104 Audio Controller onboard) that came with my system.
Maybe it's an nVidia thing, but it had the nasty habit of ramping-up sound instead of turning audio on immediately. This meant that, after any silence, sound always returned smoothly, however it made video editing impossible. Sound needs to match video precisely and, since we're not going to play back video on only this nVidia system, we need to know volumes exactly, not with system-specific audio ramping.

nVidia vs Radeon

According to the proprietary utility nvidia-settings (in the nVidia driver), my motherboard has a PCIe Gen3(16bit) slot. I'm not a gamer, but for Blender's sake, I doubled GPU RAM with a 4Gb Polaris based AMD Radeon RX560D.
Again, however, the main factor is having audio that works correctly. There was simply nothing I could do to stop the nVidia card audio ramping. All automuting, all of that was disabled, but the nVidia sound always ramped instead of immediate.

Remove nVidia software

Once replaced, i uninstalled the nVidia module in favor of amdgpu module.It's just sitting there and not being used so it doesn't really hurt anything, but it's a 200Mb of orphaned stuff. I ran # pacman -Ss nvidia to see what I had installed and removed all of them...
# pacman -Rdd libvdpau libxnvctrl nvidia nvidia-utils

audio

When I had the nVidia card, I was never able to pass the dreaded same-named sound card issue...
$ cat /proc/asound/modules
0 snd_hda_intel
1 snd_hda_intel
...which would sometimes provide sound and sometimes static.

libva v libvdpau

I still don't understand if I'm supposed to have both the Intel and the nVidia video hardware acceleration. I knew that va was intel and vdpau nVidia, so which/what to use on with the amdgpu and a Radeon. At some point, because Chromium appeared to favor vdpau, I installed vdpau, and did so by installing its utility, vdpauinfo...
# pacman -S vdpauinfo
... which also brought in libvdpau. Following this, Chromium opened normally, and YouTube functioned.

xorg

With the nVidia software removed and the amdgpu package installed, X refused to initialize. The error and the solution discussion are here. The solution required a change to /etc/mkinitcpio.conf...
MODULES=(amdgpu)
... and then
# mkinitcpio -p linux
After this, X loaded normally.

Sunday, December 15, 2019

sound and systemd, restart sound

Running HDMI means dealing with two audio chips -- the first on the motherboard and a second on the video card, where the A/V HDMI cable is connected. Many things can therefore derail the sound. In this case it was an Arch update, causing some conflict with the kernel. But each failure has to be solved by a process of elimination. ALSA is embedded into the kernel, so that systemd is the way to restart.
# systemctl restart alsa.restore.service
Should d

Let's suppose the connected HDMI device at the other end of the cable is putting out clean video. Now let's suppose the audio is also present, but that it sounds distorted: chipmunky or maybe raspy or fuzzy, like a bad AM radio connection. We know that at least one of the audio chips IS working if sound is present at the output. But solving the distortion many not be easy. Perhaps the wrong sound chip, both chips simultaneously, or that the correct chip has incorrect settings. You've done everything here and the gold standard...
$ aplay -D plughw:1,7 /usr/share/sounds/alsa/Front_Center.wav
...for your particular hardware, which you correctly determined with...
$ aplay -l

Suppose this is in spite of Pulseaudio being effectively disabled , /usr/share/alsa/alsa.conf successfully sterilized of hooks, and /etc/asound.conf, ~/.asoundrc, and ~/.config/asound.conf having been successfully deleted.

Suppose also that we have...
$ systemctl list-unit-files |grep alsa
alsa-restore.service static
alsa-state.service static

$ systemctl list-units |grep sound
sys-devices-pci0000:00-0000:00:01.0-0000:01:00.1-sound-card1.device loaded active plugged GK104 HDMI Audio Controller
sys-devices-pci0000:00-0000:00:1b.0-sound-card0.device loaded active plugged 7 Series/C216 Chipset Family High Definition Audio Controller
sound.target loaded active active Sound Card
... well then WTF is going on? We can see ALSA is properly "static" and therefore compiled into the kernel. We can see that both hardwares examine some of those systemd service modules inside /etc/systemd/system/, but this does not seem to be the problem.

possibility 1

Suppose you still have an unaddressed situation of both sound cards receiving the same name from the kernel
$ cat /proc/asound/modules
0 snd_hda_intel
1 snd_hda_intel

Sunday, October 27, 2019

Pt 1 :: A33 (quad core 32-bit Cortex A7) Allwinner notes

Links: ADB, APK, and ZIP sideloading :: Gadget Hacks :: XDA developers

Must have: a Micro SD card for side loading ROMS. There's no other way.

The Allwinner A33 QuadCore touchscreen tablet anachronisms come straight out of Guangdong. They run $40 on EBay and come preloaded with Android 4.42 (KitKat) and firmware embedded adware. The A33 has (a $4) quad-core 32-bit Cortex-A7 processor and a dual-core Mali-400 MP2 GPU, both are licensed from ARM, and these are built by Onda (v702 or v975).

The tablets feature only 500Mb of working RAM, and 1.2 G of internal storage, half taken with bloatware.

Google, Phone, Linux?

I can't find the SIM installation location or an IMEI. As noted however, it's Android Wi-Fi, so it would seem to do anything a Wi-Fi phone would do, if a person could get it properly configured to detect WiFi. It's not lsusb detected when a USB Micro-B (older Android connector) is attached to the tablet and the opposite USB-A connector is plugged into a desktop.

But is there a Linux distro that runs on it so we can use it as a media player tablet? It has a 3.5mm sound jack.

Out of the box, the tablet is a functional media player. Load media via USB from one's desktop -- the 7" 1024x600 WSVGA display (9" advertised, lol) natively plays MP3's and MP4's rendered as 5:3 WVGA, or WXGA...

Video: h264 (High), yuv420p, 1366x768 [SAR 2048:2049 DAR 16:9], 1096 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
... typically created by re-rendering video, eg...
$ ffmpeg -codecs [to be certain]
$ ffmpeg -i original.mkv -vn -ar 44100 -ac 2 output.wav
$ ffmpeg -i original.mkv -vcodec libx264 -b:v 500k -s wxga -an output.avi
$ ffmpeg -i output.avi -i output.wav -acodec libmp3lame
-ar 44100 -ab 192k -ac 2 -vol 330 -vcodec copy -b:v 504k wxga final.mp4

Recharge with a standard Android charger. They supposedly take a SIM and phone service if needed. It's extremely slow, even loading a browser page. I believe the limit for SD card expansion is 32GB.

rooting these days (2019)

It's not like it was in years past. The tablets require the hassle of rooting unless you can tolerate malware/adware, but at the same time, these days, we can't easily sideload APK's and ZIPs without tripping SafetyNet (more in this 7:32 video -- TLDR: IP/DRM sewer strikes again) and losing access to much of Google Store. BTW, since one needs to access Onda factory firmware, in order to disinfect it, some custom ROMS might be fun to attempt. Fortunately, the SELinux is natively set as "permissive" (verify with any root validator), which is a start. Still, and even though it's necessary in this case, sideloading undoubtedly carries the complications of 1) signature verification, 2) tablet compatibility, and 3) Google Store risks. Early on, it looked like a new sort of ROM that carefully avoids modifying PlayStore files Xposed, might be the best solution.

some features

type note
Processor Core7 (32 bit) quad core
SoC Sunxi 8i sunxi8i
GPU Mali-400 MP2
/etc/asound.conf alsa config file for pulse
/usr/share/alsa/default.pa change ALSA hooks
/etc/pulse/default.pa change PulseAudio hooks

rooting problems 12+ hours

It's not easy; , many people have problems rooting this tablet. Neither Kingroot, Kingoroot, SuperSu, nor Towelroot could root this tablet. It was also the case that the old version of SuperSu(2.46) blocked installation of the newer SuperSu(2.82), lol. I had to get a special uninstaller, and boot into Recovery Mode, to remove the old SuperSu. This also did not work -- as with all other ZIPs, the installation was aborted.
Xposed also was a failure (screenshot), not even its basic Framework was successful. Meanwhile, from the store, I downloaded the Terminal Emulator for Android (Pavlovich), so that I could at least use the terminal once rooted. But really, I was beginning to think of some ARM version of Linux by this point. Eg, I located an ARM Arch port, and they had some Onda compatibility, but only the 2 core version of the ARM7 was available. The other interesting look might have beeen the Android Pi with GAPPS, since there are apparently getting to be many AOSP ROMS out there, if the A7 can run any of them.

wine and iRoot

I found a post from a person who successfully rooted this tablet. He wasn't confident about the process, he knew he used iRoot, a Windows based PC app, with a USB connected to the device. Unfortunately, USB device connections are one of the largest shortcomings in Wine(2015). If you've seen Chris Titus' video on Garmin software (11:45), you know he's good with these kinds of environments, so I went to his web-pages about it. I ultimately used an Arch configuration (I describe it here) underwritten with his knowledge. In short:
1) Recovery preliminary -- to kill the ad and stealware.
  • Tablet: settings -- enable developer USB connections and security
  • Tablet <-> PC: physically connect USB cable.
  • PC: digitally establish a USB connection. Suggest CLI, eg simple-mtpfs --device 1 ~/mnt
  • PC -> Tablet: transfer the ZIP file (eg, ROOT_Limpieza_Logo_V3.zip) onto whatever tablet SD card
  • Tablet: Settings -> Backup & reset -> Recovery Mode and reboot into recovery mode.
  • Tablet: select the ZIP file and reboot
The option will also appear to use either Launcher or Nova Launcher, of which Nova Launcher is apparently the lighter.
2) Install APK -- for root binary, others.

screenshot

Power and Volume Down buttons simultaneously.

disable gmail

you have to disable this or it will be downloading messages to your phone.

browser viruses and notifcations

Try to modify the stock browser google's instructions.

auto-mount connection

Requires writing a udev rule specific to the device.
  1. I get a better result with USB debugging (Developer options) turned on
  2. Put the device in file transfer mode, not just charging
  3. arrange the system as described below
I recommend this, in concert with mtpfs, a fusermount, (NOT gvfs) library way to mount. It also includes the utility mtp-detect. With a rule in place, the Onda always mounts. The rule-writing steps are described well in this Ubuntu post. For the Arch case...
$ lsusb |grep Onda
Bus 001 Device 032: ID 1f3a:1007 Onda (unverified) Android
... then take the bus and device and determine what the kernel calls them...
$ udevadm info --query=path --name=/dev/bus/usb/001/032
/devices/pci0000:00/0000:00:12.2/usb1/1-3
$ udevadm info --export --query=property --path="/sys/devices/pci0000:00/0000:00:12.2/usb1/1-3"
...
ID_MODEL='Android'
...
ID_MODEL_ID='1007'
...
... then create the rule, in /etc/udev/rules.d ...
# ONDA A33 - MTP mount & unmount rules SUBSYSTEM=="usb", ATTR{idVendor}=="1f3a", ATTR{idProduct}=="1007", MODE="0666", OWNER="your-login" ENV{ID_MODEL}=="Android", ENV{ID_MODEL_ID}=="1007", ACTION=="add", RUN+="/usr/bin/sudo -b -u your-login /usr/bin/go-mtpfs -dev=1f3a:1007 -allow-other=true /media/Nexus_4" ENV{ID_MODEL}=="Android", ENV{ID_MODEL_ID}=="1007", ACTION=="remove", RUN+="/bin/umount /media/Nexus_4"

Sunday, October 20, 2019

[solved] Nougat (Android 7) - USB options selection

In Android 7, the USB notification is sometimes available in the shade, but other times it doesn't appear. This is because some USB -> Micro USB (Android port) cables will only charge. If the cable has the capacity to transfer data, the options will appear pulling down the shade.

After tapping, the options appear, of course, as we see in the second screenshot.

Thursday, September 5, 2019

Another pacman recovery

Pacman carries several types of problems. Some take so much time to solve that it's easier to do a fresh Arch install, if one has recently backed-up all their data. This one is a coin toss for a fresh install, and it's one of the more insidious pacman fails. It happens when one does a pacman -Syu, leaves for some other task, then returns to find the system off and unable to completely boot, noting it's unable to find the HDD or possibly
ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux`
The boot process dumps out into a maintenance prompt, and power may even cycle off. Not that it matters to what comes next, but the likely explanation is the internet connection was interrupted during the pacman update, possibly in addition to a power interruption.

1 hour with install disk, 2-3 hours if create disk

In short:
  1. boot with recovery disk
  2. delete /var/lib/pacman/db.lck
  3. fsuck the drive
  4. rerun pacman -Syu, mkinitcpio, and grub
As always, the devil is in numerous details neglected in most web posts and so forth about this problem: one large challenge is likely moving one's system to a wired connection, since the Arch install ISO has rudimentary wifi tools that will add significant time, or entirely thwart, the pacman update while chrooted. Move your system to an ethernet connection. Additionally,
  • mkinitcpio -p linux will likely be unable to locate vmlinuz unless one reinstalls the "linux" package, eg pacman -S linux.
  • one's printer will likely have to be reinstalled due to a "corrupted filter" b/c it won't match the new modules.

burn the CD

$ cdrecord -scanbus
$ cdrecord -v -dao -eject dev=1,0,0 file.iso

boot it and turn on the swap

# lsblock -l
# swapon /dev/sdb [or whichever]
# free -m

chroot

Typically we chroot and do a base install from the disk. But this is not an install. We want to complete a pacman -Syu inside our already existing installation. The mounting is similar, and is the key for proper paths. The key is not to mkdir /mnt, but simply to mount to it as if it already exists. Most people mount to "mnt", however, one could use a different directory name.
# mount -rw -t ext4 /dev/sda1 /mnt
now the entire drive is mounted in a virtual folder called "/mnt". It doesn't exist, but we can chroot into it and see the drive.
# arch-chroot /mnt

clear pacman cache

Users can always run pacman -Sc, but if a person is willing to install the pacman-contrib package (100Kb), there's a script called paccache that will clear all but the most recent 3 updates (in case a person needs to downgrade some package).

$ du -sh /var/cache/pacman/pkg/
14G /var/cache/pacman/pkg/
# paccache -r
==> finished: 870 packages removed (disk space saved: 8.92 GiB)
$ du -sh /var/cache/pacman/pkg/
4.5G /var/cache/pacman/pkg/

Saturday, August 31, 2019

surf ordinary

Ok, ok, one post with surf stuff.

If a person can't do it on the land they can't do it on a surfboard. Seals are inquisitive and friendly even though they will die a horrible death by sharks.

NB: Post surf -- even a short surf session adds about 2,000 calories to your day's intake, and a 3 hour session is equivalent to eating 4,000 calories of candy watching TV. It takes two days for the pot belly to descend from shoulders after surfing: do not eat anything for 2 days, otherwise will be unable to determine how much weight gain that session.

Car ($200 mo)

  • $92 non-op: $80 insurance, $12 registration per month
  • $180 mo gas
  • rotate, align 3 x year
  • $17.5 mo fluids 5Q OReilly synthetic 10/30 ($25). WIX 51394/Toyota 90915YZZF2 ($10); Store 3450, 9989 San Pablo Ave, El Cerrito, CA 94530 (510) 524.0267
  • El Cerrito dump site for oil and batteries. (M-F 8-5:30, Sa/Su 9-4:30)

4/3 Suits ($170)

WalMart ($183) 2XL 4/3mm O'Neill EPIC, via Wetsuit Wearhouse, 2019 :: external key pocket R calf
HBC suits ($123) XL 4/3mm Rip Curl Dawn Patrol, 2018 :: internal key on back

cheap watches

Watches costing $10-15 are a necessity if they need to be in the salt water daily. The watches and bands last eternally, but the band pins are cheap pop metal that rust-out in a few months. The watches simply fall off in the ocean if a person doesn't have a bag of properly fitting band pins and the OCD to swap them out every three months.

There are two main brands, SKMEI, and SMAEL. They both have two batteries, one for the analog hands, and another for the digital portion. You can change them yourself, who cares if the watch is ruined. When these watches arrive, I throw them into a glass of water and see if they leak. 1 out of 4 will leak. They all leak if a button is pressed in the water -- don't press a button while they're in the water. I take the bands off the leakers to use on other watches and throw them out.

When these arrive, they drive a person nuts: the hourly charm or alarm is nearly always turned on at the factory, and incomprehensible instructions. Here's how to turn off the alarm mode in each watch

SKMEISMAEL
alarm on/offC,D simultaneously
alarm set
start/stop timer
reset timer
time set
12/24 hr
light

review

Environment Variables (7:55) Maloco, 2017. Goes over each, notes that they are kept in the

safety - board repair

Board repair is an immense subject requiring a separate post. The two important points are 1) respiratory protection for vapors and particulates, and 2) power tool safety: angle grinder. are important safety notes, and it's all about respiratory protection, since a person will wear nitrile's anyway. I started with 3M products back in the day, so there are likely other options I won't cover here. The pricing challenge is you'd like to just use the flat 6501 (vapor-only) filters when glassing, but microspheres require particulate protection, so you need the pink shell 60926 filter if glassing with microspheres.

  • vapors: grinding and sanding are particulate, but glassing poses risks with 1) polyurethane resin, 2) MEKP catalyst, 3) Acetone clean-up, and occasionally 4) styrene "gloss" coat. 3M's top OV is required, the 6001 (best), or the 6003 or 6006. $30 season 6001 (US) 6051 (EUR) cartridge pair.
  • particulate during lay-up, there's only microspheres. During grinding and sanding prep, it's essentially all particulate fiberglass and resin dust. A P2/99 might work when sanding and grinding, but microspheres require P3/100, so might as well buy P100's. Microspheres are deadly as f***. $10-20 season 2197 or 2135 filter pair
  • combined easiest -- handles grinding and sanding and glassing. However, try to just use with glassing or the particulate will be full before the fumes are.$31 season 60921 or 60926 cartridge pair. The 60926 is a combination of the olive 6006 multigas and particulate P3.

This chart shows all the vapors, but not the particulate, so we need the 6051 series

7500 series half-face ($45)

For organic solvents, it's worth getting the more deluxe version of the half-face, the 7500 series, which has the exhaust valve and all (don't forget that filter). The model number for large is 7503. This typically runs $45, and then the twist-lock filters are additional. There's also a small exhaust filter in the front that requires occasional changing. 

Here's the vapor chart...

From this we can see that, for the combined filter, with the pink shell on top, the pink shell catches the particulates: it's the same as the round P100 disks you can put onto the the outside of it. The question is what kind of organics are being caught in the vapor cartridges beneath. Since we spend most of our time grinding and sanding, we can do this with a simple dusk mask or these here

3M guides are available here, butthe main one to see is this, that you need the 6051 filters.

safety - comms and tourniquets

IP ratings Sites with waterproof connection bags note the various ratings and depths for them. There's an ELD (Electronic Locating Device), similar to avalanche ELD's, but for ppl overboard, so it's called an Man Overboard "MOB" ELD, with DSC. $300. There's an article explaining how to select these things.

But the other issue is comms. I'd like to setup a $15 neoprene hood with waterproof headset and be able to talk to 1000' meters on a waterproof motorcyle bluetooth unit. Hood, headset (with 3.5mm), and motorcycle comm (with 3.5mm). And what about a throat mike instead of a booom?

philosophy

Surf is world of arms, land is a world of legs. But the legs need to be developed and developed until they can just lay there until needed and then flash into action once up. The fitness in the hips has to be so good that working and working the arms never defeats the lower body dominance.

Saturday, June 15, 2019

Unicast ARP flooding WiFi - ultimately kernel module with Realtek

I've got a friend who's a landlord. She recently upgraded the WiFi in one of her units to fiber optic. As part of her deal from the vendor, she received a SmartRG DSL wifi modem/gateway, model SR515ac. It's a nice rig, but has a couple of hitches, one of them being the WiFi would only seem to operate in bursts: fast traffic, then nothing, 3 MB traffic, then nothing. Additionally, some client boxes would freeze up entirely when connected to WiFi.

Solution

The problem was ultimately found to be only in clients that were at the edge of the operating range of the WiFi signal and were Linux boxes with Realtek 8723's, with its notorious rtl kernel driver problems. Once these cards were replaced with Intel Ultimate N WiFi Link 5300 cards, using the iwlagn module, all the freezing problems disappeared. They were so far away from the router there were occasional connection problems, but no more kernel freezes.

troubleshooting

Attempting to capture the problem, tcpdump (tcpdump >>file.txt 2>&1) revealed repetitive Address Resolution Protocol (ARP) queries to all available 256 addresses, eg...
09:01:40.129620 ARP, Request who-has 192.168.28.6 tell 192.168.28.1, length 28
09:01:40.130517 ARP, Request who-has 192.168.28.7 tell 192.168.28.1, length 28
09:01:40.131435 ARP, Request who-has 192.168.28.8 tell 192.168.28.1, length 28
09:01:40.132354 ARP, Request who-has 192.168.28.255 tell 192.168.28.1, length 28
...instead of limiting itself to those addresses to which it had authorized an IP. The queries would begin again as soon as they reached the 255th address. Apparently there was no ARP cache, but maybe the problem was even worse.

Obviously, wifi requires the kernel (module) for kernel space, and wpa_supplicant driver for user-space. The former were discussed in the solution, and the latter are typically Wext (generic wireless extension) or nl80211.


Thursday, June 13, 2019

Disable speaker w/headphone Intel NM10/ICH7 Audio

The Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 0) is a common audio chip in many laptops, but it has a Linux limitation. The ALSA mixer (alsamixer) has no setting for disabling the speakers when the headphones are inserted. A cacophony of dual headphone and speaker sounds, playing 1 second apart, is the result. Further, because it's the sound system, not the error notification system (beeps, etc), the customary disabling of pcspkr will not stop double sounds. Once configured, we'll want to reload it by creating a /etc/rc.local to do alsactl restore. This can be verified by running chkconfig alsa-utils.

1. disable pulseaudio

Worthless pulseaudio has been addressed many times in my blogs. Check this link, or some other you prefer, for how to disable it.

2. alsactl

# alsactl store
Running this command generates the file /var/lib/alsa/asound.state. Unlike the 5 visible controls in alsamixer, the true 23 settings of the card are revealed inside asound.state. It's the file to make adjustments which silence speakers during headphone use.

Saturday, June 1, 2019

XML information retrieval and display (python, XSL)

In most cases, we want to retrieve unformatted XML files, create a stylesheet (XSL, XSD), and view the XML file in a browser.

In a few cases, we may want to automate reading-in the XML (eg. w/Python), strip key information, and place the information into a database (eg. PostgreSQL). We can then create a template for recalling the XML info into a browser.

The simple display situation is similar to what LEO agencies do forensically for Court. The latter case of data retreival is more similar to what intelligence agencies do with electronic records. There's overlap of course. At any rate, citizens are forced to almost create their own wheel on this issue, probably b/c there's zero government/business incentive to allow citizens to access to information (since c. 2001).


In my computer filing system, I put each XML project in a folder. Because inside each project, there may be several different applications used as well as the HTML, XML, XSL files. There's too large a variety of software -- python, postgresql,etc -- used to store project under applications.

1. stylesheet solution (Geany)

We can add style information into an XML file, same as we do inside an HTML file if we add a "style" section in its header. Or we can have an XML file call to a separate style-centric XML file, which we usually re-suffix as an XLS file to point out its style usage. The latter is similar to putting all HTML formatting into a separate CSS file.

We can use any plain text editor, I often use Geany. We want our displayed HTML, XSL, or XSD files to be standalone, so we don't run SMS files through outside servers to re-format. Tightly constructed headers are necessary for this.

  • XML (input): the basic XML file which may not be conceptually clear or human readable, possibly with many attributes
  • XSL: the map we create formatting these tags, similar to a CSS in HTML, ie called or married to the document. More here. Many browsers consider XSL a security risk if placed in same directory as XML.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0">
    Document
    </xsl:stylesheet>
    An optimization will be to place the XSL style information into the HTML or XML header.
  • XSD
  • XML (output): our finished file structured in a way we can read and with a dictionary for future use.

XSLT to HTML (15:57) Brandon Jones, 2018. Skip first 4 minutes. Uses an intermediate step of an XSL file. 5:30: "marry" XML to an XSD to tell it how to display, but actually uses an XSL for the browser?
attribute notes (19:06) Kent D. Lee, 2013. important XML header information first couple of minutes. TCX file is Garmin proprietary XML.

2. python manipulation

python attribute retrieval (19:06) Kent D. Lee, 2013. teacher at luther.edu uses a proprietary TCX Garmin file, their tagged XML, and harvests information for his own use. 8:50 how to retrieve dictionary of attributes for an element (tag).
XSLT to HTML (15:57) Brandon Jones, 2018. Skip first 4 minutes. Uses an intermediate step of an XSL file. 5:30: "marry" XML to an XSD to tell it how to display, but actually uses an XSL for the browser?
basic extraction w/python (14:51) Extreme Automation Kamal Girdher, 2019. inflected English narrator. simplistic extraction of tree items.

XML considerations

SMS B&R's backups are standalone XML's with two label types: root labels ("smses"), and child labels. There is of course only one root label per XML file, but the child ("sms") labels number in the hundreds, depending on how many texts were backed-up. Each SMS or MMS is another child label, with its data stored in child label's attributes. I must write Python and/or XSL which harvests the information in the child labels, and then chronologically assembles texts beneath the correct phone number(s).

coding considerations

In Python it's trivial to create an output ASCII file; just add "w+" to some print statement, then close the file. For the data extraction though, there are thousands of approaches. Given my limited Python ability, I considered roughly two:

Schema1: XML is in date order. Open the XML, read all the cell numbers into a set (removes duplicates). First cell number in the set is tested against each line in the XML: if cell numbers match, the XML row is written to the text file. Second cell number in the set is tested against each line in the XML: if cell numbers match, the XML row is written to the text file. And so on, through the cell number set. Next, repeat this process with the second cell number in the set. And the third. Continue until each cell numbers in the set have been matched against the XML, and written to the output file.

Schema2: XML is in date order. Keeping date order, sort all instances of same number. So number order, then date order within each grouping of numbers. Write all of this to a file with a header between each grouping of numbers.

Schema 1

1) Create a set of all the cell numbers. We want a set, not a list, b/c Python sets exclude any non-unique items, unlike lists. We only want one instance of each cell number. Sets are iterable, but have no indices.
import os
import xml.etree.ElementTree as et

# read-in the XML file and get the root
xml_file="/home/foo/py/sms-20190303033634.xml"
tree=et.parse(xml_file)
root=tree.getroot()

# iterate through the XML file and create a set of
# telephone numbers
nu = set()
for sms in root.findall('sms'):
    numb=sms.get('address')[-10:]
    nu.add(numb)

XSL

Links: StackOverflow :: 2 conditions select (union) :: YouTube (8:17)
The Chromium team at Google apparently disallows XSL files to be in the same directory with an XML. I wasted a day writing reliable XSL files but wouldn't open the XML in Chromium. Finally, I remembered to tap F12 and look for errors: the "security" violation warning was obvious immediately. This Chromium XSL policy is a heated bug discussion on the Web. Whatever, I simply downloaded Firefox and the XSL displayed the XML. The basic template for an XSL is below:
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match= "[rootlabel]">

[Code to transform the text]

</xsl:template>
</xsl:stylesheet>
A line is also added to the source XML file pointing to this XSL file, similarly to how HTML and CSS are used together. HTML is just one type of XML code.

project specific

As noted at the top, I wanted XSL-transformed XML to approximate the EMT text format. I started to build the XSL: 1) extract phone numbers, 2) test each XML row against a phone number 3) write to text, 4) repeat with the next phone number, until all phone numbers were tested and printed.

background

There are certain benign actions which the powers-that-be nevertheless make difficult for citizens, either by security design or by the reverse invisible hand of dmca or other rent-seekers. One of these is an easy-to-read record of SMS's.

SMS retention is trivial for forensics and surveillance; they use SMS's regularly against citizens. What smells bad to me about that? 1) citizens should be on an equal playing field. 2) SMS retention should be easy (ASCII) for any citizen, 3) SMS retention used to be easy and mysteriously became difficult. For example, there used to be a simple app in the Android Play Store called Email My Texts. EMT backed-up SMS's and MMS's in a simple, intuitive, ASCII format (screenshot below). As you can see, EMT did not back-up MMS attachments, but it added a line of text to media MMS's noting that a media file had been attached. The ASCII format made the backup file on Dropbox easily searchable via a browser.

Try to find something like this nowadays that doesn't go through a questionable server somewhere. The closest you can get today is to download from your phone in some XML format. This of course means you'll have all the "user-friendlyiness" of inscrutable XML tags and no way to format your files. Let's see if we can find some way to harvest all the root tags and reformat it into eg, an html page, etc. Probably we can't. This will be a time consuming process with a the necessary addition of a huge CSS file or a an immense "style" header.

In about 2018, EMT disappeared from the Android store. The developer's website noted EMT was discontinued, but did not provide an explanation. I could find no apps in 2019 which produced a similar result to EMT -- the current batch of back-up apps produce annoying formats: PDF's, XML, CSV, proprietaries. All of these are undesirable compared to ASCII. After some research, the format which seemed the most simple to convert to ASCII seemed to be XML. So, a few weeks ago, I purchased the ad-free XML backup client SMS Backup and Restore Pro ($5). Its high price seemed worthy insofar as, by avoiding ads, I could likely avoid Google or App developers parsing my private texts for ad relevance.

As for XML, I figured I could create a layman/amateurish Python script or XSL file to parse the XML and convert it to a text file. I had no intention to use, eg., the timeit module or code optimize.

objective

Simple: translate SMS B&R's XML backup file into an ASCII format, similar to that in the screenshot above.

Saturday, February 9, 2019

Nvidia sound muting and screen blanking

None of us with Linux appreciates Nvidia's complications, but avoiding their cards in systems becomes a part time job few have the time for, and so we occasionally are stuck with an Nvidia card or chip. A person then needs to prepare themselves for auto-muting Hell. Instead of starting full-force at the outset, Nvidia has done you the favor of ramping-up volume over a period of about 2 seconds. No problem? Imagine editing an audio or video file. You will literally pull your hair out when you play it back on another device and find there's 2 seconds of sounds you didn't account for... on every fucking track.

So far, I haven't solved this entirely, but there's information on initial audio setup from my earlier post, but there's more with specific respect to the automute.

Here, you will find no audio controls, although it is helpful to note how one's HDMI is interpreted by NVIDIA...
$ nvidia-settings
...and it may also reveal other things to work on, time permitting:
Heh, "registry". And you thought you were free from gratuitous security "features" unrelated to actual security. Not if you bring proprietary garbage into your Linux install. But that's another post.

screen blanking

You Have an Nvidia card. Want to resume from standby or hibernation? Hope not. Nope, a hard reboot and the 10 minutes to fsck the drive aftwerwards is your fate. Basically, the only solution is to leave systems with Nvidia cards on Linux running continuously, and shut off the monitor manually when I leave. And as for stopping the automatic hibernation itself, something also easily tweakable in /etc/xorg.conf? Nope, the only file in Arch which allowed me to control hibernation and standby, that wasn't overwritten during Arch updates was ~/.xinitrc:
$ nano .xinitrc
# b/c they can't be adjusted, turn them off
xset dpms 0 0 0
xset s off