Friday, July 29, 2016

Cable WLAN / home network connectivity debug

Somehow my cable connection is quite bad, gets lost, takes long time to connect, when streaming videos these are really choppy. So, I decided to dive in the home networking to try to solve this once and for all!
  1. When streaming in Youtube, I can see with the System Monitor the download speeds dropping to almost zero and the video failing to keep loading...
  2. Speedtest actually comes to about 1Mbps and works even when the video is not loading.
  3. Modem (Motorola Surfboard SB6141) to router (either Netgear WGR614 v6 or Fry's FR-300RTR) light shows orange blinking, which indicates less than 100Mbps connection (is this normal?)
  4. Connecting directly with wire to the modem shows 0 packets lost and pings (http://www.pingtest.net/) of 14ms with jitter of 4ms, consistently. For the test to be reliable, stop any other network activity. Youtube seems to interfere sometimes and speedtest.net interferes a lot (which makes sense).
  5. Checking the ports for security on this mode (connected directly to modem), many ports are easy to find (visible or closed) but somehow they change with the scan (like something is adapting!?). The PC firewall (vino) is on.
  6. We then disconnect our home PC and switch to the laptop, the laptop does not connect, even after 20 minutes and several repair (Windows) attempts. It did have an IP (169.254.177.150).
  7. Plug back into the home computer and flies back. Modem IP is 192.168.100.1. Connecting to it and checking "addresses" one can see that the CPE MAC address is D0:50:99:3B:5F:6C (the one on my PC).
  8. Connect back the laptop and again, does not work. 
  9. Reboot the modem and sure enough, the laptop works now! New CPE MAC is E8:E0:B7:EE:B3:E5.
  10. Our theory is that the modem needs to renew the new computer address after that is plugged (Max of 1) and do to so, the easiest way is to restart the modem. To prove it, we plug the home PC back and sure enough, now that is the one not working. But if I clone (spoof) the MAC address of the Linux box to E8:E0:B7:EE:B3:E5 it connects flawlessly right away!
  11. Unfortunately the Intel adapter on my Windows laptop does not allow for that, at least through the Device Manager (this other link may work). So, I am going to leave my Linux box like this which will make transparent the switch of the cable, if I ever need to.
So, one mystery down, but still haven't solved the streaming. It probably has to do with the router. So, let's debug that...
  1. We plug now the Fry's router to the linux PC (not to the modem!). And connect to the router by typing 192.168.0.1. 
  2. Then try cloning the MAC of the modem (the WAN, under Status, on Device Info) to be the same as that of the Linux PC (which is now also the same as the laptop xxE5). Nevertheless, we have a familiar issue with the router refusing to accept that as a valid MAC address. Found solution here. Basically there is an error on a java function that validates the address (in public.js). You got to open the console and overwrite it by typing: check_mac = function check_mac(mac){ var error = true; return error; }. There is a 2nd function that you got to overwrite too: check_mac_00 with the same.
  3. So, to recap, now we got laptop, PC and router with the same MAC. We should be able to plug the router onto the modem and go, but somehow, even before that, after cloning, the PC can't connect to the router. If I change the MAC of my PC, then I can, no problem. Actually the laptop has also the same issue. This happens already without connecting to the WAN, so, got to be something related to the router. Maybe related to the DHCP?
  4. Found out that the MAC filtering was enabled and E8:E0:B7:EE:B3:E5 was not in there. Wondering if I ever got my laptop connected through wire to the Fry's router. Wonder also if when I did step 2, my Linux PC had still its MAC, not the cloned, and that is why I could connect. And only when I switched to E8:E0:B7:EE:B3:E5 failed... A mystery but after adding E8:E0:B7:EE:B3:E5 to the list of addresses, now it is working.
  5. Tested the speed of the net and looks good. Also with video streaming.
Wireless
  1. This was straightforward as I had already configure it. Using the Fry's router, connecting my cell phone through WiFi and testing the speed, had no issues. Same for the laptop, in the sense that it looked the same as through the wired connection on the PC, although the upload speed on both cases was pretty poor (0.5Mbps).
VPN:
  1. The final test was to connect my laptop wirelessly and see if all works fine as it used to fail too sometimes. Nevertheless, now I got no issues. Ping and speed was a bit slower but no big deal, likely due to the VPN itself. 
So, hopefully this is it. I'll revisit if any future issues.

Update: about 1 year later, things continue to work solid. Actually I had to unplug everything because of some remodeling at the apartment and plugging it back, without changing any configuration (but in the right order, as above, although I can't think of why I have to, as all the MACs still the same) and it is working great.

Other links of interest:

Saturday, July 9, 2016

Head tracking off-the-shelf solutions

So had a quick look at how to track the head position, just to see what is out there. Some quick findings:

Through face tracking:
Besides the theta/phi that helps present the image from the right angle, we can probably find out the R from the size of the face. Not trivial, will have to see how the effect works out.
  1. Of course, we can use OpenCV and all the stuff presented in this blog (only for the position, not so much for rotation).
  2. FaceTracknoIR Open source face tracking for Windows. It tracks rotation too...
With markers in the head: Either passive (reflective) or active (LED as light source):
  • Tutorials:
    1. This guy talks too much too but the slides he shows makes everything funnier...
    2. I feel this guy talks too much.
  • Solutions: 
    1. FreeTrack (software)
    2. OpenTrack (software)
    3. LinuxTrack (software)
    4. TrackIR (both software and hardware, ~$150)
    5. Sony Playstation Move (I include here as it is cheaper than the Vive or Occulus systems...) and the Playstation Camera. Probably these would give you anything beyond position.
    6. TrackHat buy the hardware, use the free software (spin from OpenTrack).
    7. DIY hardware Mostly about the mechanical part... The electronics is basic if you know anything about it (the LEDs are just DC, not pulsed or anything fancy...)
    8. These guys did something very similar to what I had in mind (kind of a virtual window). It was probably inspired in both cases on the great and open job of Johnny Chung Lee
    Comparison of both methods (not a good one...)

    Wednesday, July 6, 2016

    Saving space in Outlook and other utilities

    Managing Outlook manually can be quite painful. Files grow to take a lot of your hard drive (I have an old 74GB SSD and probably 40GB of mail total), and once you have created a lot of folders, it is not going to be easy to clean it if you intend to do that, again, manually :).

    Obviously moving folders you don't use out (saving the pst somewhere else) is the easiest way. But can we do more, easily? Sure! Actually searching, I found that Outlook is quite awesome on this!

    1. To remove emails from the same conversation It does allow you to do this for folder and sub-folders, but not at the top of the PST level. Wonder why, so, that will force you to do this one by one inside the level, but ok... The other thing to watch out is that it may remove the flagged emails (for instance, if you flag them to remember them or easily find them), if they are the beginning of some conversation, although sure, they will be part of another email. You probably can avoid that with some setting or by recovering them from the Delete Folder. Anyhow, this alone did already pretty good (maybe 20%) but to see the effects you may have to force Outlook to clean up the PST. Bottom line, this is good to avoid storing duplicates and can have significant savings, but it does have some minor drawbacks (a bit time consuming, potential loss of some organization...). So, if you don't care much about that space, as anyhow you plan to move/store things away you may do only #2.
    2. The second great thing is to be able to store mails that are old in a different PST, but replicating the PST, with the file trees inside. Then you can store away those PSTs... The cool thing also is that if you have marked the file with a flag it won't move it (unless you tell him so...). 
    I am assuming that you know how to load/unload from outlook the PST: File >> Account Settings >> Data Files tab and the Remove. Don't worry, that doesn't delete the file from your SSD/HDD, just takes out the access from Outlook and frees it, so that you can move it somewhere else for storage.

    Outside Outlook, there are also other useful utilities for saving space and doing other interesting stuff:
    1. Cleanup the system install files (this was 10GB in my drive!!)
    2. Stat viewer and attachment removal
    3. Outlook reporting tools and utilities Get reports on how much you spent on every given topic, how much email you sent/receive, how many times you read the same email, email traffic/time of the day...
    4. Others along the same lines
    Cheers!

    Monday, July 4, 2016

    Fixing audio choppy playback in Linux Mint - Pandora, Youtube...

    This is just for my reference, nothing fancy... Sorry the way is explained but was what I tried on this order. At the end I solved both.

    Basically audio in Pandora was choppy. Same used to happen with Youtube videos... Firefox or Chrome didn't make a difference. I just fixed the Pandora problem reinstalling alsa and pulse-audio.
    Also this one actually really helped me.

    By the way, after this my Desktop Environment (Cinnamon) was replaced by Gnome. Even the display manager was not giving me the option for Cinnamon. Looks like Cinnamon installation basically gets corrupted and doing sudo apt-get install cinnamon will fix it.

    Anyhow, this did not solve the Youtube issue. VERY weird, the issue goes away with the volume control of Youtube (if I use lower volume settings). I also did this, but no luck, nevertheless this may be because my audio is not the same as described in the post (Intel chipset Z97).  Doing a lshw -short shows C610/X99 series chipset HD Audio Controller

    So, let's apply the same fix but replacing  snd-hda-intel vid=8086 pid=8ca0 snoop=0 by the right parameters. Something tells me that the 8086-8d20-1028-0618 is a clue. Used then 8d20 instead of the 8ca0 but that didn't do it :(.

    Next I found this and that gave me the clue!! It looked related to the volume, so, I installed pavucontrol. Executing saw the playback bar hitting the max some times! If I increased the volume, it was totally saturated! So, there you go, lowered the controls to 100% (works without getting there) and that did it!! DUH!!!! By the way, you don't need pavucontrol. I found it also on the standard Sound controller (type sound on the start bar...). Posted the answer here.