Saturday, 23 June 2018

Galaxy Tab S tablet volume goes up and down: Farming Simulator 18

I was listening to BBC iPlayer (in Chrome) on my son's Galaxy Tab S and I noticed that the volume kept going up and down. All rather annoying. My other son's Tab S was doing the same. Other people have complained about this too.

So I did some debugging.

I put the Tab into developer mode, connected the USB and ran adb logcat > c:\temp\debug.txt from a command prompt.

Whenever the volume dropped I looked for patterns. I started to notice
requestAudioFocus() from android.media.AudioManager$8d530e6org.chromium.content.browser.AudioFocusDelegate$f901627 req=3flags=0x0

AudioManager dispatching onAudioFocusChange(-3)

and
AudioFocus  abandonAudioFocus() from android.media.AudioManager$8d530e6org.chromium.content.browser.AudioFocusDelegate$f901627

AudioManager dispatching onAudioFocusChange(1)

So I ran baretail with the syntax highlighting turned on and it confirmed the pattern was happening whenever the volume dropped.

Looking at the documentation it indicated that the audio was requesting to be reduced (and then subsequently returned to normal).

I ran adb shell ps > c:\temp\process to determine the process names that correlated to the PIDs in the log output.

Looking further in the logs I could see entries like

com.giantssoftware.fs18.google  14229 W AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 48000 Hz, output 44100 Hz

/system/bin/mediaserver  9422 W AudioPolicyIntefaceImpl: Skipped to add effects on session 332


Farming Simulator 18? What is this doing? It is installed, but not running in the foreground. It kept trying to do something with the audio.

It also kept trying to download some Javascript.
com.giantssoftware.fs18.google  com.giantssoftware.fs18.google  I chromium: [INFO:CONSOLE(1)] "05bd228f", source: https://vpaid.springserve.com/production/vpaid_a1597ab3.js (1)

So I uninstalled it. And the audio is back to normal!

The problem is known as "ducking". This article provides greater background.

It seems like Farming Simulator 18 was causing the problem. It was also installed on my other son's tablet.


Friday, 22 June 2018

Group Policy

Group Policy settings are stored at: C:\WINDOWS\system32\grouppolicy
Registry: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies

Let's Encrypt provides free certificates


https://letsencrypt.org/about/

Monday, 18 June 2018

Testing sql for concurrency bugs

There is a method for checking SQL or Stored Procedures against concurrency bugs. Using the SQL Server scheduler you can run two queries in parallel.

To do this:
Open two SQL Server query windows and then split them vertically.
Then in each window, run:

waitfor time '13:16:20.00'
exec uspMyStoredProcedure

You might need to run it several times as the scheduler is not accurate to microseconds, but if you have a long-running query it should show the bug relatively quickly.

Saturday, 16 June 2018

Pairing a Dualshock 4 (DS4) with the Playstation 3 (PS3)

Click on Accessory settings
Manage Bluetooth devices
Register a device

Note you must hold down the Share + PS3 button on the DS4 for about 3 seconds until the front display flashes rapidly.

Also note that the PS button and the rumble will not work.

If you need to reset the DS4, you can use a paperclip to press the reset button on the back near the R2 trigger.

Assigning nominal codes in Kashflow

Run the Profit and Loss report
Click on the value of the Other colum.
Select the entries to be moved.
Select Re-assign selected transaction(s)