Tuesday, August 12, 2014

Saffire Pro 26, Firewire, Windows DPC latency

For the last 6 or so months, I've had a big problem with crackles and pops when playing or recording music, due to DPC latency issues.

When I ran DPC Latency checker v1.3, it would show sudden red spikes every time there was heavy network traffic. Sometimes, just refreshing Chrome would do it.

This was not only happening within Reaper, while recording but also when playing back MP3 files via AIMP.

Extensive searches through the web failed to find anything that would work for me. The best I could do, was reboot the PC and the start recording.
Once the PC had been up for a while (especially if it had been put in 'Sleep' mode and then woken up), the crackles would come back.



At the time, I was running Win7-64 and used USB3 for all external devices.

So, in order to overcome this I decided to move the sound generation to external hardware and I bought a Focusrite Saffire Pro 26 for recording my music.

This provides me with A/D conversion from my guitar --> PC, as well as D/A when playing back music from the PC.

In addition to that, I get to use some of the best pre-amps around.

Alas, it would seem that USB3 does not provide sustained  high throughput, so most audio equipment manufacturers (including Focusrite) use Firewire.

Given that I was going to move to Win8 at some point, I wanted to make sure the card I bought worked well with Win8.
(It appears that MicroSchmuck saw it fit to stop supporting Firewire in Win8 and only a few chipsets actually work with it).

I ended up taking a chance and buying a generic Firewire card from CPL in Notting Hill, Victoria.




Against all odds, it worked perfectly well in Win7-64.
A few days later, I moved to Win8.1 and that card still works fine!

Additionally, the DPC latency seems to now hover around 1-3 ms, no matter what I do with the network!
I was copying 220GB over the network without any problem.

I hope this helps others struggling with DPC issues while recording/playing back music.

[UPDATE 16aug2014]
Hmmm, it would seem that VirtualBox can sometimes mess with DPC latency...
It is quite amazing running an i7 CPU and yet still struggle with performance at this level.
Something tells me Billy-Boy's creation is at fault.
If only Reaper and the VSTs I use were available under Linux!

[UPDATE 13oct2014]
So, even though I now run an i7-4790 CPU @3.6GHz, I still (sometimes) get atrocious clicks and buzzes when generating music from the PC itself.


See my article on how I moved my music playing off the PC and onto a Raspberry Pi.




ps: Comments and/or links to this article are most welcome!

Saturday, July 19, 2014

Laravel, Composer, WAMP/PHP 'missing open_ssl' fix

If you are trying to install Laravel and are encountering the 'The openssl extension is missing' error with the Composer installer, here is a fix:

WAMP maintains a different php.ini for the Apache dir and the PHP dir.
The WAMP control panel maintains the PHP.INI in the apache dir 
(for example   C:\wamp2.4\bin\apache\Apache2.4.4\php.ini)

There is also another PHP.INI, using by the command-line PHP, in the PHP directory 
(for example   C:\wamp2.4\bin\php\php5.4.16\php.ini)


Edit the PHP.INI file in the PHP dir and uncomment the following line

extension=php_openssl.dll


Done!


ps: Comments and/or links to this article are most welcome!

Tuesday, October 15, 2013

Compile LESS CSS files and compress/minify CSS and JS files using node.js

Here is what you need to do, in order to

- compile your LESS files into CSS whenever they are changed and also compress those CSS files into .min.css (*1)

- compress your JS files into .min.js whenever they are changed


The 2 scripts described here will automatically perform the above actions upon invocation and will then also set up a file-watcher on the specified directory.



But first:
- Download and install node.js from here.

- Download and install uglifyjs from here, using
npm install uglify-js --global
- Download and install LESS compiler from here, using
npm install less --global

Download this RAR file, which contains all the script files that I have modified, so all you need to do is adjust the contained sample batch file and off you go.


These scripts allow you to specify a source and a target directory.
For LESS/CSS, the LESS file is compiled into CSS in the same directory.
The CSS is then compressed into the target directory.

For JS, the js file is compressed into the target directory.

When you run the batch file, it will scan and process all matching files and then it will stay in the background, monitoring the source directory.


Many thanks to the guys that have created all of the above tools.
The original idea for this was from Jonathan Cheung's code here.



[Blatant plug! See my article about my album on Google Play.]

ps: Comments and/or links to this article are most welcome!

Sunday, September 1, 2013

Freepascal/Lazarus decimal rounding vs Excel rounding


I found this thread quite useful, regarding decimal rounding in freepascal/Lazarus.

This article also describes a unit somebody has written that handles decimal values more accurately (and also more like .net does (much as it hurts me to say this!))


ps: Comments and/or links to this article are most welcome!

Sunday, August 11, 2013

How to achieve shift-click (contiguous) select on a Lazarus TDBGrid


Please follow this link to my post in the Lazarus forum

ps: Comments and/or links to this article are most welcome!

Thursday, July 18, 2013

FortesReports: Misc info

This post will accumulate info on FortesReports, the reporting tool used in Lazarus/FreePascal.

Once enough info has been collected and cleaned up, it will be passed on to the Lazarus group.
------------------------

- Grouping and ORDER BY
Groups in a report do not force a sort by that field.
If you have a SELECT f1, f2 FROM dooda ORDER BY f2
and create a report which groups by f1, you will end with multiple breaks, as f1 changes values while moving through the recordset.
To avoid that, you will need to SELECT f1, f2 FROM dooda ORDER BY f1, f2



ps: Comments and/or links to this article are most welcome!

Saturday, May 25, 2013

FreePascal/Lazarus: How to use lookup combo in DBGrid

I recently worked on a project where I used FreePascal in order to create an app that consisted of a single EXE and which did not need to be installed (portable app).

I had some difficulty in getting a lookup column in the grid and, after lots of searches pointing to convoluted solutions, I came across the following 2 pages, which gave me the info I needed to solve the problem.

Defining a Lookup List Column

Defining a lookup field

In a nutshell, you need to create a lookup field in the TSqlQuery (or whatever query type you use).
You then add a new field in the grid control and link it to the lookup field you created in the query.

Using this method means that you must specify the UPDATE and INSERT SQL (just in case you used to rely on what FreePascal/Delphi generated).


For example, in this case, the CrewMembers table contains a CrewID but not the CrewName.

A lookup field is created in the CrewMembers query, as show below



I want to show the CrewName from the Crew table when I am editing the CrewMembers table.
The CrewMembers table contains only the CrewID, not the name.


LookupDataSet= A Dataset that loads data from the Crew table
LookupKeyField= The name of the key field in the Crew table that I will link to via my CrewID
keyFields=The name of the key field in my table/grid (in this case, CrewID)

This is a just a quick overview. Leave a comment if you'd like more info.

[Blatant plug! See my article about my album on Google Play.]


ps: Comments and/or links to this article are most welcome!