There may be cases, when the songs of the same album have different replay album gain and album peak values: for example, songs from multiple sources ("Best of...", etc.). To find and correct them, an easy and simple variant:
Variant A: if you organize albums only by tags, and files of the same album may be in different folders (this is the slower way).
1. In Mp3tag, select any file, and click Export > New, give a name "DifferentRG". Choose Edit, and replace the content of this .mte file with... $filename('DifferentRG.m3u8',utf-8)$puts(
)$loop(1,1)$puts(crlf,$char(13)$char(10))$puts(br,'{br}')$loopend()$replace(
$loop(%albumartist%)$replace(
$loop(%album%)$replace(
$loop(1,1)$replace(
$puts(first_gain,%replaygain_album_gain%)
$puts(first_peak,%replaygain_album_peak%)
,$get(crlf),,$get(br),$get(crlf))$loopend()
$loop($num(%track%,3))$replace(
$if($or(
$neql($get(first_gain),%replaygain_album_gain%),
$neql($get(first_peak),%replaygain_album_peak%)
),%_path%$get(br),)
,$get(crlf),,$get(br),$get(crlf))$loopend()
,$get(crlf),,$get(br),$get(crlf))$loopend()
,$get(crlf),,$get(br),$get(crlf))$loopend()
,$get(crlf),,$get(br),$get(crlf))
2. Open your whole music library in Mp3tag. Select all files, click Export, choose DifferentRG.
Choose, where to save the playlist.
Important: in Settings must be set the use of BOM at export!
3. In foobar2000 click File > Preferences > Quick search. (You must first install the foo_quicksearch component.) Create (if you don't have) a new entry in Tags table.
Name: Albumartist+album
Value: %albumartist% - %album%
If you have the same songs in different formats, too, then better...
Name: Albumartist+album+codec
Value: %albumartist% - %album%, %codec%
Then don't forget to click on "Add", and "OK" buttons!
4. Create a simple, empty new playlist. Rename it to "DiffRG" (or any else).
5. Open the resulting (from Mp3tag export) DifferentRG.m3u8 playlist in foobar2000.
6. In the DifferentRG.m3u8 playlist, click on the first song, choose from context menu (right click) Quicksearch for same... > Albumartist+album (or Albumartist+album+codec). Select all files, then drag and drop them to the newly created DiffRG playlist.
7. Repeat the previous (No. 6) with all songs of the playlist (but only 1 from each album, of course).
8. Go to the DiffRG playlist. Select all songs, right click > Replay Gain > Scan selection as albums (by tags). When ready, click to write values in tags.
It was hard for me to find out this tricky variant, because of...