Zaphod's Guide to safely consuming PGGB-AP

"What is this? Some sort of galactic hyperhearse?"

Overview

PGGB-AP is a PCM remastering tool for upsampling or downsampling PCM audio files with an optimal choice of linear filters. PGGB also transfers all the common metadata tags to the converted files. PGGB always saves the converted files in .wav format. Image and cover information within the metadata are transferred when possible. All PCM rates including DXD are supported. PGGB will convert DSD to PCM too with an optimal choice of linear filter.

The ’AP’ in PGGB-AP stands for Arbitrary Precision. PGGB now implements arbitrary precision computing for the entire processing pipeline starting from the generating Windowed Sinc filter coefficients and FFT based filtering to noise shaping and EQ. This allows you to optionally choose higher precision computing from quad precision 128 bit (Insane), hex precision 192 bits (ridiculous), up to 256 bits (Ludicrous). Higher precision results in improved reconstruction accuracy and noise shaping performance.

PGGB will process all files in the input folder and all folders in the input folders recursively. For example, if you have a music folder 'C:\Music' and the folder contains albums organized in multiple folders like C:\Music\Album-1, C:\Music\Album-2. It will process any music file with extensions (.wav, .flac ,aif, .aiif, .m4a, .dsf) in both C:\Music and also the Album-1 and Album-2 folders. The upsampled files will be found in output directory and they will be organized in the same way in sub-folders. PGGB also copies jpg, png and pdf files to the destination folders.

It is very simple to use. Once you have chosen the input and output folders (both are required), press ‘Process’ to start processing. Use Pause to pause processing and ‘Stop’ to stop processing. Stop and Pause may take a few seconds to a few minutes depending on what PGGB is processing. Once the processing has started, you may also add new folders inside the input folder. PGGB will discover them and will process them too after it has competed the current set of folders. Processing can be done in three modes. Selecting ‘Create New’ will create a new album folder if the album already exists in the output directory. ‘Skip’ will skip previously processed tracks if they are present in the output folder and ‘Overwrite’ will overwrite the existing tracks. You may add multiple input folders using the ‘Add’ button, you may also remove an input folder by selecting it and pressing ‘Remove’.

Advanced: If PGGB finds 'pggb_to_process.txt' in the input folder, it will process the list of folders in the text file (recursively), in addition to any folders in the input folder. By default, it will create a folder with the name of the parent folder. If it finds ‘FQN’ in the first line of the text file, it will replicate the full directory structure (Excluding the drive letter) in the output folder.

On Windows, The very first time PGGB runs it may request permission for firewall. Please accept the request as PGGB needs it to manage parallel threads and in the case of a trial license, it needs to connect to a time server.


Configuration

PGGB is already tuned to provide optimal results with very little tweaking needed. In short it is in auto-pilot mode. Go to ‘configure’ tab to change the settings.

Settings for the three dropdowns on the left are determined by your DAC and your PC

  1. Output Sample Rate: Choose a sample rate family that matches the maximum output rate supported by your DAC.
  2. Maximum Taps: PGGB will choose the maximum taps to use for upsampling based on the physical memory on your PC. It is best to leave it as is.
  3. Output Bit Depth: If your DAC supports 32 bits, then 32 bits is the best option. If you wish to do further processing (such as EQ or dither), then 64 bit doubles may be a good option too but do be aware, it will double the storage requirements. If your DAC is a 24 bit DAC, dithering or noise shaping is recommended to reduce correlated quantization noise. Bit depths of 12 bits through 32 are an available to help you choose the right bit depth that is optimal for your DAC. For example, some R2R DACs may have a higher settling time for very high sample rates (1Mhz or more), in these cases, choosing lower bit depths may help.
  4. Adaptive Noise Shaping: PGGB will choose the optimal noise shaping algorithm to remove quantization noise from the audible range if left in ‘Auto’ or ‘On’. Noise shaping helps attain high small signal accuracy in the audible range. The algorithm is based on the bit depth, sample rate you have chosen, and noise filter settings. The noise shaping and is very effective in removing quantization noise. Removal of quantization noise results in a very lifelike sound. Choose ‘None’ if you do not want any noise shaping (not recommended). Choose ‘Dither only’ if you want to apply dither only (recommended only when the track is likely to be processed further).
  5. Precision: You can now choose the precision you want PGGB to use for all of its processing and EQ. Normal (64 bit)processing is the default, it is the fastest and least memory intensive. If you desire even higher accuracy, you may choose to do the processing at an Insane 128 bit precision or higher, a ridiculous 192 bit precision, up to a Ludicrous 256 bit precision. The higher precision improves reconstruction accuracy and noise shaping performance, but come at the cost of increased processing time (10 – 30 times slower) and increased memory usage (2 – 8 times). While we kept the Ludicrous 256 bit precision for completeness, we found no reason (objective or subjective) to go beyond the ridiculous 192 bit precision.
  6. Gain (dB): If you wish to use PGGB for off-line volume control, you may set the gain. Also refer Inter-Sample-Overs Section.

Preferences

Settings on the right (three sets of buttons) can be chosen based on your preferences, though the default settings should work best for the majority.

Transparency Setting: These two buttons helps you choose between two flavors of transparency. Both provide a very high time domain reconstruction accuracy but make different tradeoffs. What you choose may depend on your playback chain and preferences.

  • Natural: This is the default setting; it is the most natural presentation that portrays leading edges and timing accurately while maintaining body and warmth.
  • Front Row: This setting is a different take compared to above. It is a slightly forward presentation favoring micro-detail, giving the feeling of a ‘front row seat’.

Presentation: PGGB is already optimized to provide maximum transparency, depth, and timbre. The presentation buttons let you fine-tune time domain characteristics of the remastered music and strike a balance between transparency and dense presentation. Choose ‘Moderate’ or ‘Dense’ when you need more body. This is especially useful for genres such as classic rock, big band jazz or CDs that may not have the best downsampled quality.

Noise filter: It is common for higher sample rate material to have a significant out of band quantization noise; this is especially true with DXD and DSD, but listening test and analysis show even material at 88.1kHz and above can benefit from noise filtering. Beyond the audible range, there reaches a point where it becomes increasingly hard to differentiate between quantization and other noise and the music signal. This is can be recording dependent and makes it harder to choose the noise filter. The new noise filter used in PGGB tries to simplify and remove some of the guesswork. The default setting (Moderate) would work best in most cases. This is all about balancing the signal to noise ratio at frequencies beyond the audible range. As more filtering is done (Full setting), the sound is cleaner but may sound smoother or a little less open. With less filtering (Minimal setting), it would sound airy but can come at the cost of added noise or harshness. The Moderate setting seems to strike the right balance where it remains clean and yet has enough air and detail without starting to sound edgy. These are still very subtle changes to help you fine tune to your system and preferences. There is no correct answer. The noise filter will not be applied to 44.1k or 48k material.

Apodizing: CD audio can often have aliasing distortion due to either deficiencies in the decimation filters used or the Analog to digital conversion process. Apodizing is recommended to remove these aliasing distortions during the remastering process.


Load or Save Settings

If you own multiple DACS or if you wish to process your library with different settings, you can create multiple settings. To create new settings, enter the name of the setting you wish to create and press Save. To overwrite the existing setting, select the setting from the drop-down, make the setting changes and press Save. You can also remove existing settings; just choose the setting you wish to remove and press Remove.

Note: Default setting cannot be removed but can be overwritten.


PGGB-EQ

Starting with version 2.0.42, PGGB supports EQ using convolution filters. You can access EQ configuration through the ‘PGGB-EQ’ tab. The interface is quite simple.

Bring your own EQ

PGGB uses the concept of ‘Bring your own EQ’:

  • DRC: If you are interested in Digital Room Correction (DRC), PGGB is not a substitute for measurement software. You would use your favorite measurement software to create the convolution filter. Alternately you can also enlist the services of someone who can help you with measurements and EQ. The filters need to be stereo in .wav format.
  • Headphones: You have a few choices
    • If you have your own headphone EQ filters, you can import them.
    • Alternately you can use the Auto EQ project to find your headphone and import the 48kHz or 44.1kHz Minimum phase wav file.
    • Download headphone EQs from here. This list will expand as we get more feedback and submissions.

Filter Type: Two ways to import and apply EQ

Applying EQ is a simple mathematical operation (convolution). However, the quality of your filters affects the quality of the resulting remastered track. Ideally, applying equalization should impart tonal changes only, with no degradation in other qualities like dynamics, transparency, depth, and resolution.

PGGB Optimized: PGGB-EQ provides an option (‘Optimize for PGGB’) to import your EQ filter and apply them during the remastering process in a transparent fashion. When ‘Optimize for PGGB’ is chosen, PGGB does not resample your filters for different input rates, but instead creates new filters from scratch from the imported filters and applies them in a way that retains transparency and only alters the tonal balance. This is the recommended option.

Use as-is*: Some EQ filters incorporate time domain correction using excess phase components. If you wish to use these filters as is without any alteration, you may choose ‘Use as-is’ option. When using this option, please make sure you provide filters for all the input sample rates (44.1kHz – 368kHZ, a total of 8 filters). PGGB does not resample filters, so if EQ filters are missing for a subset of sample rates, you will need to choose between two options:

  • Use PGGB Optimized: I.e., allow PGGB to create PGGB optimized filters for missing sample rates (including DSD).
  • Do not apply EQ: PGGB will not apply any EQ if it cannot find an imported filter matching the sample rate of input track.
Note: For best results using this option, it is recommended that the measurements be done at the individual sample rates and the filters be derived at these rates instead of resampling the time domain correction filters.

Import Filters(s): Once you have chosen the filter type, click on ‘Import Filters’ button to import your filters.

  • If you chose ‘Optimize for PGGGB’, import filters expects a single .wav file in stereo format if you want to apply a different EQ for the left and right channel, or a mono wav file if you want to apply the same EQ to both channels. The filter sample rate can be any rate between 44.1kHz and 368kHz. It will also accept the PGGB optimized ‘.pggbeq’ format that you can download for a few headphone models from the remastero website.
  • If you chose ‘Use as-is*’, import filters expects a folder with EQ filters for rates between 44.1kHz – 368kHz. It is OK if you do not have filters for all rates available.

Note: If you chose ‘Optimize for PGGB’ as the filter type or ‘Use PGGB optimized’ when a filter rate is missing, the import process can take a few seconds to a minute, because PGGB is generating the a new set of filters.

Note 2: If you chose ‘Optimize for PGGB’ as the filter type, you will need to reimport filters for every precision you choose (i.e., Insane, ridiculous etc.). The import process takes even longer for higher precision.

Enable or Disable EQ and Status

Once you import EQ filters, you have the option to turn EQ on or off using the Enable EQ switch. A status lamp shows current status of EQ . The status lamp is always available on all tabs on the bottom right corner. When the status light is green, it implies filters have been successfully imported and EQ is enabled. Please refer the legend below for all possible EQ status indications.

Select Frequency Range

This setting is applicable only if you choose ‘Optimize for PGGB’. Sometimes, you may prefer to apply EQ only to a range of frequencies. You can choose the start and end frequency over which you want EQ to be applied. In most cases. You can leave this setting at the default values if you have already created your EQ filters only for the desired range of frequencies.


Combining Tracks

PGGB uses the longest possible tap count depending on track length. However, depending on how the tracks were indexed, it is possible that some albums (especially long classical works) may have been cut into multiple tracks even though they were a single long recording. In these cases, to take advantage of longer tap lengths that would have been available had the tracks not been cut, PGGB allows you to treat contiguous group of tracks as one. Please be aware that PGGB currently does not split the tracks back to the original track numbering after processing. To allow PGGB to combine tracks, you will need to create a 'combine.json' file and drop it into the album folder. You will have to provide the tracks you want to combine as a comma separated list within quotes, enclosed in '[]'. In the below example, tracks 2-4 will be combined and given a track number '2' and tracks 7-14 will be combined and given a track number '7'. The rest of the tracks will be processed normally.

For Combine to work, there are a few requirements
  1. The sets of tracks being combined cannot have overlaps
  2. The tracks should have the track numbers in their metadata

Status

The status window at the bottom provides useful information about the current state of PGGB. This includes error messages, displays values when you change a setting, the current file it is processing etc. When PGGB is processing files, the status window may be a bit slow to refresh. This is normal. PGGB also displays detailed messages in a command window and logs them too. Progress bars show Batch, Album and Track level progress.


Log files

The output log file can be found by typing ‘%HOMEPATH%\PGGB’ in the Windows Explorer Address Bar. Album level logs can be found in remastered output folders. . On Mac Go to Home (cmd-shift-H)\PGGB.


Between PGGB and Your DAC

Digital processing within PGGB has been done with the utmost care. When playing back PGGB remastered tracks, a bit perfect transmission to your DAC will yield the best results and when possible, your DAC must be configured to do the least processing.

Setting up your DAC:

  • A direct connection (or the equivalent) to your DAC from the end point is ideal (i.e., not using any upsamplers). Use of re-clockers or regens that do not alter the bits are OK
  • Set PGGB output rate to the maximum input PCM rate your DAC supports.
  • Set PGGB output bit depth to the native bit depth of your DAC (not the maximum allowed by the Audio driver). In the case of some R2R DACs, the optimal bit depth may depend on the sample rate.
  • If your DAC has the option, set your DAC to NOS mode.
Your playback software:

Any playback software you use should not do any processing of the PGGB remastered tracks. This includes volume control, dither, noise shaping, further upsampling, bit depth conversion (padding is OK). I.e., PGGB remastered tracks should be transmitted to your DAC bit for bit without any change for the best results.

A note about software volume control:

Software volume control may look innocuous, what possible harm could come from converting to 64 bit doubles and changing the level? PGGB’s noise shaper all but eliminates quantization noise in the audible range. Any sort of processing such as volume control leads to 64 bit conversion and then truncation back to your DAC’s bit depth (16, 24 or 32). This conversion adds quantization noise back into the track that PGGB worked hard to remove.

Sometimes your DAC does not provide volume control and/or you may prefer to use software volume control. You have couple of choices:

  • Best option: Set PGGB to Remaster output as 64 bit, the downside is large file size. Use software volume control and output at desired bit-depth. Enable Noise shaping if or dither if your playback software supports it
  • Alternate option: Disable noise shaping in PGGB and output in 32 bit format. Use software volume control and output at desired bit-depth. Enable Noise shaping or dither if your playback software supports it
  • Another option (use with caution): This is a good option if you do not use the volume knob much and generally leave it at a fixed level (like say -3dB). Enable noise shaping in PGGB, and set the gain slider to the reduced gain (same as what you would set in your player such as HQP) and gargle-blast your tracks. During playback, disable noise shaping or dither in your playback back software but start with a reduced level (first set the volume to where you will normally set it in your player) and gradually bring it up to 0dB or max.

Folder Paths and Permissions

Please make sure you have Read permission to the input folder and read/write permission to the output folder. In addition to this, PGGB needs write permission to:

    Windows
  • The APPDATA folder. PGGB installs the license and also saves the configuration in this folder. Typically, this is C:\Users\[user name]\AppData\Roaming\PGGB or you can access it by typing %appdata%\PGGB in the Windows Explorer Address Bar.
  • The HOMEPATH folder. PGGB writes logs into this folder in addition to writing logs into output folder. Typically, this is C:\Users\[user name]\PGGB or you can access it by typing %homepath%\PGGB in the Windows Explorer Address Bar.
    Mac
  • PGGB installs the license and also saves the configuration in /Users/[user name]/PGGB
  • PGGB writes logs (in addition to writing logs into output folder) to /Users/[user name]/PGGB


System Requirements

PGGB requires 64-bit Windows 10 PC or Mac (Mojave or higher). On Windows, 64GB RAM and 8 core processor is recommended. If your library is mostly 44.1kHz, a minimum 16GB (512M taps max) or 32GB RAM for more flexibility and a 4-core processor is required. On Mac, 16GB (512M taps max) with 4 cores will suffice for Redbook. On Windows, SSD drive for virtual memory (minimum of 128GB)* is recommended too. Fast drives (SSD, NVMe, etc.) for input and output folder improve processing performance further. PGGB is memory intensive and would need virtual memory. Virtual memory on fast drives improve processing speed.

PGGB scales to use all the processor cores when more memory is available and CPU load can reach max TDP. Be sure that your PC has the cooling necessary to handle the heat especially if you have overclocked or run in turbo mode.

It is possible to run PGGB on Linux either within a virtual machine running Windows with the enough RAM and CPU cores allotted for the VM.

*Please note: Memory requirements double with quad precision (128 bits - Insane) and quadruple with ridiculous (192 bit) or higher precision. A minimum of 32GB is recommended for quad precision and a minimum of 128GB RAM for 192bit or higher precision. Similarly, virtual memory also needs to be a minimum of 256GB for quad precision or 512GB for 192 bit or higher precision. On Mac which lacks user assignable VM size, please turn on caching in the hidden menu, on Windows if you are uncertain about how much VM you need, you can turn on caching too. But please ensure you have enough free space (500GB).

Note: PGGB requires Internet access during installation. It also needs Internet access for the trial version. On the first run, PGGB will request firewall permission to enable parallel processing. PGGB is mostly harmless, we do not use or share your personal information nor do we use the idle CPU cycles to mine Ethereum.


Virtual Memory (Windows only)

It is best to set the virtual memory (both the initial size and the maximum size) to the same value and equal. 128 GB or more is recommended. Choose the fastest internal drive for setting the virtual memory. Make sure the drive has free space greater than the virtual memory size you set. For all other dries set 'No paging file'. Restart your PC once you have set the virtual memory. After restart, check if the drive you set virtual memory for has a 'pagefile.sys' file with the size close to the virtual memory size.

Note 1: Please make sure you have free space that is comfortably greater than the the virtual memory you allocated on the drive.

Note 2: Windows optimization programs such as Audiophile Optimizer or Process Lasso will interfere with the normal operation of PGGB. Please make sure programs that could throttle paging, memory and CPU usage are either deactivated or uninstalled.

To set virtual memory, use the system property command-let. Go to start menu and start typing ‘advanced’ and select "View Advanced System Settings." Then click Advanced-> Performance Settings. This will open the Performance Options dialog. Click on Advanced tab, then click the ‘Change’ button under ‘Virtual memory’. Finally, in the Virtual memory dialog, uncheck ‘automatically manage paging file’ and enter a value greater than 128000 under Maximum size in Mb. Virtual memory availability and drives are system dependent. Below is just one example.


Licensing

PGGB requires a license and PGGB license is tied to your Hardware ID. You will also need to provide your name and email address to get a PGGB license. Your Hardware ID will be displayed if you go to the ‘About’ tab. Use 'Ctrl + C' or 'Cmd + C' to copy your Hardware Id and paste it in the email. Refer here to get a license.

When PGGB does not find a valid license, it displays a ‘License’ button. Once you have a valid license, use the ‘License’ button to browse to the license file. Once the license is installed, it displays your name and the duration of the license (either perpetual or with a time limit). Hardware-id is tied to the PC you run it on. The license is non-transferable. When your Hardware-id changes, you may request for a new license. PGGB is not for commercial use unless you have purchased a commercial license

If you need to reinstall the license or you have upgraded your license, use the ‘I’ button next to ‘License’ to do so.


Hidden Menu (#42)

You can activate the hidden menu by using the key combination ‘Ctrl+4’, you can exit the hidden menu by using the key combination ‘Ctrl+2’. If the keys do not work, just click on the cocktail picture to reveal the hidden menu. The hidden menu provides five options:

  1. Logging: Choose the level of logging you prefer, with -2 being near silent to 2 that is extremely chatty.
  2. Workers: PGGB improves processing speeds by distributing the workload over multiple worker threads. It uses a heuristic based on the available RAM and logical cores to choose the optimal number of worker threads for each track. However, there are other factors (such as heat dissipation and fan noise) that PGGB is not aware. Here, you may use your judgment to cap the maximum number of worker threads. By default, this is the number of logical cores. If you set it to 1 there is no parallism and it may be beneficial to choose this option on a resource constrained PC for processing 176.4k or higher tracks including DXD and DSDs.
  3. Mode: PGGB can run under two modes
    • Processing: PGGB processes and upsamples files, this is the default mode.
    • Analysis: PGGB does no processing but instead prints statistics on how the tracks will be processed.
  4. Throttle DSD: In resource limited PC/Macs or without adequate cooling, DSD processing can cause it to freeze due to memory limitation or because of overheating. Use this checkbox to throttle PGGB while processing DSDs and reduce the chances of freezing or rebooting.
  5. WavPack or FLAC: Off by default. When set, it will output file as FLAC instead of Wav if two conditions are met - Sample rate is 8fS(DXD) or less and bit depth is 24 bits or less. For all other rates and bit depths, it will output lossless WavPack compressed files (.wv).
  6. Add PGGB to album tag: Optionally adds suffix to album tag, '[PGGB][bitdepth-sample rate]' for example [PGGB][24-705.6]. It does not affect album discovery, but makes it easier to know instantly and to search for gargle-blasted albums.
  7. Remove PGGB file suffix: Optionally remove ‘(… PGGB)’ descriptor at the end of processed tracks.
  8. Cache to disk: When there is not enough RAM, this is an alternative to Virtual Memory or Swap files. When checked, PGGB will efficiently cache intermediate results to disk and only keep what is needed in RAM. This is very useful on Mac OS where there is no manual way to configure virtual memory. It is helpful on Windows too when you are uncertain on how much virtual memory to allocate. There is also a possibility that enabling caching to disk may speed up processing for longer P128 or P192 tracks, but this is system dependent. The main purpose is to reduce the chances of OOM (Out Of Memory errors) in places in the processing where memory pressure can hit a peak. Caching of course only works if you have space in the drives. Do be aware that you still need to have enough free disk space (preferably an internal NVME drive). On Mac the cache files will be on '/Users/[username]/PGGB', and on windows it will be on 'C:\Users\[username]\PGGB'. You can specify an alternate location for PGGB cache files by creating an environmental variable ‘PGGB_CACHE’ and assign it a different path. Refer here if you are unsure of how to add an environmental variable in Mac.

Note: PGGB remembers all your current settings on the next start, except the processing mode. This is intentional as you may forget the processing mode was set to analysis.


Inter-Sample-Overs

During reconstruction of the music signal after upsampling, the new samples can have values greater than 1.0 these are generally referred to as inter-sample-overs. Inter-sample overs will cause clipping and can be unpleasant.

When gain is set to Auto as shown above, PGGB detects inter-sample overs and applies just enough attenuation to avoid clipping. However, PGGB does this based on only the first block of data (about first 20 minutes in a track). If you are a fan of classical music, you already know tracks can be longer than 20 minutes. Since PGGB does not go back and reprocess tracks, when PGGB finds inter-sample overs, it records the value in pggb_album_analysis_vN.csv

pggb_album_analysis_vN.csv file is created for each album you process, inside the output folder of that album. This file has a log of useful information about each track such as the settings you used to process it, how long it took to process, number of Taps used etc. in addition to the settings information, it also has two columns (shown above, the rest are hidden here for clarity). On rare occasions where you suspect clipping of an upsampled track, you can refer this file, and look to see if First-block-gain matches the Track-gain. If not, there are portions of that track where clipping could occur. To fix this, you will need to either process the whole album or just track by using the gain shown under ‘Track-gain’. If you choose to process the whole album, be sure to choose the largest negative value under ‘Track-gain’ across all tracks in the album.


Workflow to Arrive at a Favorite Setting

PGGB is designed keep the interface intuitive. It tries to provide enough options to help you arrive at the optimal settings for your playback without overwhelming you with too many choices and combinations. Here is a simple workflow that may help you get started. The trick is to only change one setting at a time. Click on the ‘Onboarding’ tab and our paranoid robot Marvin will walk you through on how to arrive at your favorite. Please refer Marvin’s onboarding guide for more information. You may also press ‘Help’ link on the ‘Onboarding’ tab to access the onboarding guide.


This SOFTWARE PRODUCT is provided by THE PROVIDER "as is" and "with all faults." THE PROVIDER makes no representations or warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical errors, or other harmful components of this SOFTWARE PRODUCT. There are inherent dangers in the use of any software, and you are solely responsible for determining whether this SOFTWARE PRODUCT is compatible with your equipment and other software installed on your equipment. You are also solely responsible for the protection of your equipment and backup of your data, and THE PROVIDER will not be liable for any damages you may suffer in connection with using, modifying, or distributing this SOFTWARE PRODUCT.


So long and thanks for all the fish

.·´¯·.´¯·.¸.ZB.´¯·.¸¸.·´¯·.¸><(((º>