Saturday, November 19, 2016

ChromeCacheViewer "Error 2: The system cannot find the file specified" - REASON / FIX



ChromeCacheView v1.70 - Cache viewer for Google Chrome Web browser 
Copyright (c) 2008 - 2016 Nir Soferhttp://www.nirsoft.net/utils/chrome_cache_view.html

"Error 2: The system cannot find the file specified"

This error was due to #enable-simple-cache-backend being turned on in chrome://flags/

The "Simple Cache Backend for HTTP" is a new cache. It relies on the filesystem for disk space allocation and it writes your cache in a different format, 1 file per file. It is indeed better, BUT...

The program relies on using the old format that uses an indexable database of basic cache files needed to get the cache information, and they are missing: data_0, data_1, data_2, data_3 ...

Bottom line, the new "simple" structure is currently incompatible with the v1.70 of ChromeCacheViewer. (hopefully this will change)

Toggling the flag will clear your cache, so don't do that if you are struggling to retrieve something from cache. Instead, go to chrome://cache, and follow the instructions in the blog post directly below this one to retrieve the file.

ABOUT the simple-cache-backend (nerdy) : https://www.chromium.org/developers/design-documents/network-stack/disk-cache/very-simple-backend

Senseful Solutions: Viewing Chrome cache (the easy way) UPDATED

SOURCE: The original website is located here:
Senseful Solutions: Viewing Chrome cache (the easy way)

Instructions:
How to view a file from the cache:

  1. COPY the code in the pastebin link at the bottom of this post, including all the ( )
  2. In Chrome, navigate to chrome://cache/
  3. Ctrl+F to find whichever file you want to view, then Click on it.
  4. You should then see a page with a bunch of text and numbers.
  5. In Chrome, Press F12 to open the DevTools Console
  6. Near the bottom, find the > cursor character, click and PASTE the copied code and Press Enter. 
  7. Alt-Tab switch back to the main cache contents window.
  8. You should then see a link which says Download cached file on the top. Click to download it obviously.
  1. If the resulting downloaded file is a compressed gzip archive (Gzip encoding) (should be a .gz file, or maybe push Ctrl+F and search for: gzip to make sure) :
  2. Use 7-zip or a program that reads these files to open the .gz archive And extract the file inside, giving it the appropriate file extension of what exactly the filename was originally. (viewable on the top line)
  3. There you have your file.

UPDATED with code from Ron Howard February 29,2016:

http://pastebin.com/33XH625e

Sunday, November 13, 2016

Enabling Pepper Flash for Spotify in Franz

Franz is an integrated chat program based on Electron (node.js + Chromium). It uses web frameworks to act as an application + a web browser. It comes with various services pre-installed, and you can add your own services with plugins. I wanted to add Spotify, but it required Flash and was not enabled by default.

I am going to assume you are on Windows, because I am, and if not, I hope you know the analogues for what I am talking about, too.

So I created a spotify plugin pack file :
https://dl.dropboxusercontent.com/u/50769577/spotify.rar (9 kilobytes) (make sure you edit the URL in the package.json file as it currently points to MY spotify page)
http://pastebin.com/hNBYce6f (main.js unpacked/unobfuscated + already pre-edited for 64-bit Flash on Windows)
http://pastebin.com/hByDUD0i (integrationClass.js unpacked/unobfuscated + already pre-edited to remove the bug)
https://dl.dropboxusercontent.com/u/50769577/pepflashplayer64_23_0_0_207.dll (30MB) Pepper Flash 64 bit for windows, version 23.0.0.207

The spotify plugin gets extracted to its own spotify dir inside C:\Users\?????\AppData\Roaming\Franz\Plugins\

Currently with Franz 4.0.4, this is not enough, as you will quickly find out, Flash is not enabled.
Electron supports Flash, but since you have to edit Franz, not everyone can figure it out,

Here is how to edit Franz (complicated, hope you can follow):

1. Go to C:\Users\????\AppData\Local\Franz\app-4.0.4\resources\
2. You will find a few .asar files in there, we are interested in app.asar
2b. Go ahead and delete the pre-existing app.asar.unpacked folder to avoid confusion, as it is a partial duplicate
3a. you will NEED to unpack it with an asar unpacker, which is available through installing node.js:
(sorry I don't have a better way to do this)
3b. Open a command and navigate to the directory above, from this dir, install Asar (link to github) by typing: npm i -g asar
4. Run this command to extract the app.asar file to the "app" dir (has to be named this):
 asar e app.asar app
5. The good thing is that now you can run Franz with the asar resources unpacked forever. (the app directory should take precedence over the app.asar file)
6. The .JS files in here are highly obfuscated and you will have a hard time doing much with them besides investigating the structure for now...

Launching Franz.exe sets off a chain reaction where Electron loads main.js, which loads index.html (and pulls css from css\main.css) We need to edit main.js

7. If you open up main.js in Notepad++ you will see its a mess of gobbledygook.
8. Go ahead and visit http://jsbeautifier.org/ and accept all the default options (most notably "detect packers") and paste the entire file into there, hit the "Beautify" button and it will spit out human-readable code (enough).
9. Delete the contents of main.js and Paste the contents back into main.js to replace everything that was there (obviously)
10. We need to replace line 17, the last line of the "window options" (they need to have this added),make sure you have included the comma at the end of title: 'Franz,' to continue the block. :
                title: 'Franz',
                webPreferences: {
                  plugins: true
                }
                //enable "plugins" for flash.
11. Now scroll down to about line 173. You will see, something that says n['on']('ready').
This is the point (Insert directly ABOVE the On ready line) at which you will tell Franz where the plugin is and that it should load it, with the following two lines of code:
        //ENABLE ADOBE FLASH PLUGIN (64-bit Windows)
        n.commandLine.appendSwitch('ppapi-flash-path', './resources/app/pepflashplayer64_23_0_0_207.dll');
        n.commandLine.appendSwitch('ppapi-flash-version', '23.0.0.207');
        //thats it.
12. Obviously now you may be wondering, where did I get this .dll file? You likely already have it on your hard drive in multiple places.
First check in C:\Windows\SysWOW64\Macromed\Flash\ (for 32-bit Franz.exe - yes SysWOW64 is backwards and it means 32)
Or C:\Windows\System32\Macromed\Flash\ for 64-bit Franz (on an x64 system). This matters. You can tell by the filename, The filename is approximately (depending on the version, just pick w hatever version you find): pepflashplayer64_23_0_0_207 (30MB for 64bit) and pepflashplayer32_23_0_0_207.dll (17MB for 32-bit)
The other place it could be is: C:\Users\?????\AppData\Local\Google\Chrome\User Data\PepperFlash\23.0.0.207\pepflashplayer.dll or if you have Chrome installed to program files, the same approximate location there. If you are on a mac or linux you will need the appropriate plugin.
If you can't find it at all well, its officially obtained by downloading Flash from here: https://get.adobe.com/flashplayer/?fpchrome
Make sure you get the "System" plugin, not the browser plugin (and dont click any of those extra MCafee crap things) My dropbox link above for it only exists temporarily, for simplicity.

Copy whichever file you need to C:\Users\????\AppData\Local\Franz\app-4.0.4\resources\app\
as this is the path i've referenced in the code above in step 11. If you need to change the filename, do so in the code above. The filenames just need to match.

13. The next file you need to edit is "lib\integrationClass.js" - it currently has a bug in it, and I have reported it.
Repeat the JS Beautifier.org steps you did before now to get this file in an editable form.
13b. The last few lines need to be changed :  Please follow along here: https://github.com/meetfranz/plugins/issues/84 
OR if it fixed (possibly) by the time you read this, you don't need to

14. Now you should be able to run flash!  Load up the spotify plugin and test it out!

If you want the files, they are hosted above.
If you have any questions, message me on Discord @ genr8_#8163

Sources: https://github.com/electron/electron/blob/master/docs/tutorial/using-pepper-flash-plugin.md
https://github.com/meetfranz/plugins/blob/develop/docs/integration.md
https://github.com/meetfranz/plugins/blob/develop/docs/configuration.md
Helpful for further electron editing:
https://github.com/electron/electron/blob/master/docs/api/web-contents.md
https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md
Next up in the Franz editing series will be the UI of Index.html and main.css

Friday, February 26, 2016

Digital Audio Cables - Do they matter? Maybe. Sometimes. For USB Yes, for Ethernet? no.


On USB Cables / DACs:

Yes digital cables will transmit a bit-perfect digital signal that can be reconstructed DESPITE any noise/flaws/jitter, but the story does not end here. I will give you a simple example which you neglected to mention, and is a valid data point (if it matters for one thing, it should not be dismissed outright). When a USB DAC device is self-powered off of USB, and the 5V Line is connected to the computer’s motherboard, noise is transmitted over that 5V line in the USB cable, and a ground loop may also be formed if the USB cable is quite long. In recent years, motherboard makers have introduced specific “USB-DAC USB ports” that have extra noise filtering circuitry in them to remove garbage created by the cheap switch mode power supplies in computers. The D+ and D- pins of the USB cable are differential pairs and prevents EMI and the bit-stream can be reconstructed and interpreted properly by the DAC. The issue is that you have forgotten about how the device the DAC is in was designed, and some devices may be susceptible to noisy 5V lines inducing noise on the analog signal path of the DAC.


On Ethernet Cables: (a copy of my response to someone):
This was going well until he got to the part about "electrically isolate your network cables and go with fiber optics". Clearly he thinks this would help because in the audio world, Optical cables usually serve well to break ground loops, but it is misguided advice HERE specifically when relating to networking. A normal network cable (unshielded) isn't actually grounded to the chassis ground. Assuming your network's ethernet cable runs are functioning enough that there is 0% packet loss, and as long as the analog electrical impulses get to the destination device's (ie: stream box renderer's) network PHY transceiver chip (Layer 1 of the OSI model), proper digital packet decoding will take place in the MAC chip (Layer 2 of the OSI Model). Any noise or garbage on the ethernet cable will never propagate further than the PHY. Your audio is not going to sound better because you're breaking a cable run up with some optical fiber. Any "noise" in the cable would only serve to hinder digital packet decoding (and inconsequentially at that, due to automatic re-transmission by TCP/IP, and the balanced twisted pair nature of the cabling). And if your network is not functioning properly and you did have digital audio packets being lost because of noise/interference, putting a gap of fiber optics AFTER the issue is not going to remedy that. Please note its hard to explain this in 5 minutes but I did my best. To be more technical: any common-mode noise (ground loop) induced onto the balanced twisted pairs in a UTP cable are subtracted out by the transceiver (PHY) as part of the differential transmission algorithm. Not only that, but since they are almost always 50/60hz due to AC hum, they do not affect data transmission due to the balanced twisted pair design of the cable (rated for ~350 MEGAhertz).

-part 2:

Millions of engineers out there can prove you wrong, but they have better things to do. The concept of proven reliable "bit-perfect" streaming is different on each. As long as you are getting packets from one end to the other without loss (which is easily provable by CRC routines and other in-built checks in the Ethernet spec) then no high quality Ethernet cable is going to give you better audio. The same can be applied to USB/HDMI but they are harder to prove and there are more ghosts in the machine so to speak. Also, of the things we do understand, like jitter in USB cables, each technology is fundamentally different, and what applies to USB does not apply to Ethernet and so on for HDMI and SPDIF coaxial. So if you're going to buy a high quality audio cable, save your money on audiophile grade Ethernet which is 100% nonsense and buy other high quality USB, HDMI or power cables......