Personal computing discussed

Moderators: SecretSquirrel, notfred

 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Stupid Amarok replaygain bug

Sat Aug 27, 2016 10:03 am

So Amarok -- IMO the "least worst" music player app for Linux (Foobar2000 is one of the few things I miss from my Windows days) -- has had this one long-standing bug that really... erm... bugs me. When using replaygain, there's a quarter second or so of lag when a track change occurs, before the new gain value kicks in. If you're switching from a track which has a very high replaygain value to one with a very low one, and that track happens to start out loud, you get a quarter-second blast of extremely loud music before the gain adjusts downwards. On a semi-regular basis this has startled me enough to utter an expletive.

This bug has literally existed for YEARS. From what I can gather from forum discussions, Amarok is pointing the finger at the Phonon audio back-end, and refuses to address this on the grounds that any workaround they could implement in Amarok would break gapless playback, since it would involve pausing playback long enough for the gain change to propagate. Or something.

Last night, finally fed up with this issue, I decided to attempt my own workaround. The only time gapless playback REALLY matters is when you've got multiple tracks from the same album queued up, and those tracks segue directly into one another. In that case, you'd want to be using album mode replaygain anyway, so there would be no gain change between the tracks that you want to play back gaplessly. So what if we enable gapless playback (i.e. queue the next song up for playback before the current one has finished) ONLY when there's no gain change? Sounds simple enough...

Of course the devil is in the details, and I have zero familiarity with the Amarok codebase (or with KDE/Qt development in general, for that matter). Rather than dive into how to examine meta-data of tracks in the playlist, I made the simplifying assumption (which works for my music library) that files in the same directory are assumed to have the same replaygain value (and should be played gapless), while files in different directories should not. My first attempt failed miserably. My second attempt worked about 9 times out of 10; the other 1 time out of 10 -- which seemed to occur at random -- playback froze at the track transition where the gain change was supposed to occur. After scratching my head over this, I finally applied another hack on top of my hack -- in the timer callback that updates the progress bar, I check whether playback has gotten "stuck" (we're in "play" mode, but playback has not progressed for 2 timer callback ticks), and force playback of the next track to begin if so. :roll:

This "fix" is obviously nowhere near production quality so I have no intention of trying to contribute it back to the Amarok project at this point, but it does what I want, for my use case. For now, I'll use my hacked copy of "Korama" (I reversed the spelling of the application name in the title bar so I can easily tell at a glance if I'm running the hacked version).

If anyone else here uses Amarok and is annoyed by this bug, I'm willing to share the source code modifications if you PM me... but they really are an embarrassment that I'm ashamed to put my name on, so unless/until I figure out a cleaner patch they won't be posted publicly on the web. :lol:
Nostalgia isn't what it used to be.
 
UberGerbil
Grand Admiral Gerbil
Posts: 10318
Joined: Thu Jun 19, 2003 3:11 pm

Re: Stupid Amarok replaygain bug

Sun Aug 28, 2016 11:38 pm

After scratching my head over this, I finally applied another hack on top of my hack -- in the timer callback that updates the progress bar, I check whether playback has gotten "stuck" (we're in "play" mode, but playback has not progressed for 2 timer callback ticks), and force playback of the next track to begin if so. [img=15x15]https://techreport.com/forums/images/smilies/icon_rolleyes.gif[/img]

Congratulations on keeping the true intent and spirit of the word "hack" alive!  
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Mon Aug 29, 2016 6:02 am

UberGerbil wrote:
After scratching my head over this, I finally applied another hack on top of my hack -- in the timer callback that updates the progress bar, I check whether playback has gotten "stuck" (we're in "play" mode, but playback has not progressed for 2 timer callback ticks), and force playback of the next track to begin if so. [img=15x15]https://techreport.com/forums/images/smilies/icon_rolleyes.gif[/img]

Congratulations on keeping the true intent and spirit of the word "hack" alive!  

LOL... but who's even going to see that, unless you're wearing socks with sandals?

FWIW, after using the hacked player for several hours over the weekend it seems to be "good enough" for me. No delayed gain changes, and no hangs at track transitions. But anyone who's done software development should be able to appreciate how much the above described fix is the software equivalent of an auto repair done with duct tape, chewing gum, and twine... :wink:
Nostalgia isn't what it used to be.
 
chuckula
Gold subscriber
Gerbil Jedi
Posts: 1815
Joined: Wed Jan 23, 2008 9:18 pm
Location: Probably where I don't belong.

Re: Stupid Amarok replaygain bug

Mon Aug 29, 2016 7:09 am

I went old-school with my music playback and use CMUS

It's extremely lightweight and works fine for me, but I can understand if it doesn't have the right featureset for you like replay gain (although the website for the project indicates that replay gain is supported, you might want to see if it does what you want).
4770K @ 4.7 GHz; 32GB DDR3-2133; GTX-1080 sold and back to hipster IGP!; 512GB 840 Pro (2x); Fractal Define XL-R2; NZXT Kraken-X60
--Many thanks to the TR Forum for advice in getting it built.
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Mon Aug 29, 2016 9:43 am

chuckula wrote:
I went old-school with my music playback and use CMUS

It's extremely lightweight and works fine for me, but I can understand if it doesn't have the right featureset for you like replay gain (although the website for the project indicates that replay gain is supported, you might want to see if it does what you want).

I've tried some alternatives over the past few years. Audacious seemed promising (old-school, very Winamp-like), but it turned out to have a nasty memory leak bug which made it unusable unless you remembered to close it periodically. Just leaving it paused overnight would chew up a couple of GB of RAM. :roll:

I'll take a look at CMUS. And check to see if Audacious' memory leak issue has been fixed.

I'm OK with lightweight/minimalist; one of the first things I do after installing Amarok is disable all of the silly plugins it enables by default! :lol:
Nostalgia isn't what it used to be.
 
Chuckaluphagus
Silver subscriber
Gerbil Elite
Posts: 781
Joined: Fri Aug 25, 2006 4:29 pm
Location: Boston area, MA

Re: Stupid Amarok replaygain bug

Mon Aug 29, 2016 11:32 am

chuckula wrote:
I went old-school with my music playback and use CMUS

It's extremely lightweight and works fine for me, but I can understand if it doesn't have the right featureset for you like replay gain (although the website for the project indicates that replay gain is supported, you might want to see if it does what you want).

I am very fond of CMUS - it'll run on nearly anything, but most importantly the interface reminds me of the program (name lost to time) I used to play MOD files that I would download off BBSs late in the night.
 
bthylafh
Maximum Gerbil
Posts: 4047
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Stupid Amarok replaygain bug

Mon Aug 29, 2016 1:14 pm

There's nothing more minimalist than mpg123 and ogg123 that I once used. Pure terminal interface, not even ncurses.
Hakkaa päälle!
i7-8700K|Asus Z-370 Pro|32GB DDR4|Asus Radeon RX-580|Samsung 960 EVO 1TB|1988 Model M||Logitech MX 518 & F310|Samsung C24FG70|Dell 2209WA|ATH-M50x
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Mon Aug 29, 2016 2:01 pm

I do like being able to queue stuff up by dragging and dropping folders, but would not be entirely averse to CLI either. :wink:
Nostalgia isn't what it used to be.
 
synthtel2
Gerbil Elite
Posts: 726
Joined: Mon Nov 16, 2015 10:30 am

Re: Stupid Amarok replaygain bug

Sat Sep 03, 2016 5:23 pm

I use MOC (sometimes known as MOCP). It's pretty similar to CMUS, but I found MOC's interface a bit more comfortable. I don't use a lot of advanced features, but it's by far the most trouble-free player I've ever used (in contrast to various bugginess and non-determinism every time I've tried a graphical one other than VLC).
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Mon Sep 05, 2016 8:37 am

synthtel2 wrote:
I use MOC (sometimes known as MOCP). It's pretty similar to CMUS, but I found MOC's interface a bit more comfortable. I don't use a lot of advanced features, but it's by far the most trouble-free player I've ever used (in contrast to various bugginess and non-determinism every time I've tried a graphical one other than VLC).

Lack of replaygain is a showstopper for me, as wonky replaygain support in Amarok is what sent me down this rabbit hole in the first place!
Nostalgia isn't what it used to be.
 
synthtel2
Gerbil Elite
Posts: 726
Joined: Mon Nov 16, 2015 10:30 am

Re: Stupid Amarok replaygain bug

Mon Sep 05, 2016 11:37 am

Whoops, I was thinking it had support for some reason. :oops: As I said, I don't use too many features. Sorry about that.
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Mon Sep 05, 2016 12:01 pm

synthtel2 wrote:
Whoops, I was thinking it had support for some reason. :oops: As I said, I don't use too many features. Sorry about that.

A little Googling seems to indicate that someone has attempted to hack in support for it, but AFAICT it hasn't made it into the official release yet.
Nostalgia isn't what it used to be.
 
SuperSpy
Gold subscriber
Minister of Gerbil Affairs
Posts: 2299
Joined: Thu Sep 12, 2002 9:34 pm
Location: TR Forums

Re: Stupid Amarok replaygain bug

Tue Sep 06, 2016 7:52 am

There's always iTunes under wine! /ducks
Desktop: i7-4790K @4.8 GHz | 32 GB | EVGA Gefore 1060 | Windows 10 x64
Laptop: MacBook Pro 2017 2.9GHz | 16 GB | Radeon Pro 560
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Tue Sep 06, 2016 8:18 am

SuperSpy wrote:
There's always iTunes under wine! /ducks

:lol:

I did attempt Foobar2000 under wine several years back, and chalked it up to a "learning experience". Sure, it ran... but not particularly well.

The prospect of iTunes under wine conjures up mental images of the Ninth Circle of Computer Audio Hell...
Nostalgia isn't what it used to be.
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Sun Jan 08, 2017 7:45 am

Thread necro!

Suddenly my replaygain options were greyed out, with the only active option being "Disabled".

Initially I suspected a conflict between my hacked version of Amarok and some recent system update. Turns out the stock version was affected as well. Some recent system update (or something I installed) must have switched the default backend from gstreamer to VLC, and Amarok doesn't support replaygain when using the VLC backend. WTF.

Setting Amarok/Korama back to gstreamer fixed it.

I hate random breakage like this. Cost me a bunch of head-scratching, lots of Googling, and a (pointless) recompile of my hacked version from source code. :roll:
Nostalgia isn't what it used to be.
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Thu Jan 12, 2017 12:04 pm

I may just go back to using Audacious. It looks like the memory leak bug that caused me to ditch it a couple of years back has been fixed, and my Amarok hack seems to have introduced a small (but non-trivial) chance of the player wedging when you seek within a track.

Memory leak aside, I liked Audacious better anyway.
Nostalgia isn't what it used to be.
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Thu Jan 12, 2017 8:00 pm

...and that didn't last long. We're back on the hacked Amarok. Replaygain support in Audiacious is just plain busted in this version. WTF. Not the way Amarok was busted (with lag resulting in delayed volume changes at track transitions); just plain ineffective. :roll:
Nostalgia isn't what it used to be.
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Thu Jan 19, 2017 11:53 am

Decided to revisit Audacious, after realizing that the replaygain problem I had with it the other day was likely the result of files with incorrect/missing replaygain tags, not the player. Then discovered that for some inexplicable reason, playlist drag-and-drop functionality (to rearrange the order of the songs) is busted in the version of Audacious available from the Ubuntu repos. :roll:

Downloaded the latest source from the Audacious web site... and after manually installing a zillion library dependencies, I was able to build a working "latest and greatest" Audacious, which seems to be fully functional (AFAICT so far).

Getting a decent audio player in Linux shouldn't be this much of a struggle...

As an aside, now I need to figure out why a bunch of the FLAC files from last fall's massive media re-encode project seem to have duplicate sets of meta-data tags for artist, album, and song names in them. Amarok apparently ignored duplicate tags (displaying only one of each type even if multiple ones were present), while Audacious tries to display them all (resulting in everything getting displayed twice); so I didn't even realize the files were mis-tagged until I tried to load them into Audacious.
Nostalgia isn't what it used to be.
 
DancinJack
Grand Gerbil Poohbah
Posts: 3631
Joined: Sat Nov 25, 2006 3:21 pm
Location: Kansas

Re: Stupid Amarok replaygain bug

Thu Jan 19, 2017 12:03 pm

just brew it! wrote:
Getting a decent audio player in Linux shouldn't be this much of a struggle...


You can say that five times over.
i7 6700K - Z170 - 16GiB DDR4 - GTX 1080 - 512GB SSD - 256GB SSD - 500GB SSD - 3TB HDD- 27" IPS G-sync - Win10 Pro x64 - Ubuntu/Mint x64 :: 2015 13" rMBP Sierra :: Canon EOS 80D/Sony RX100
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Thu Jan 19, 2017 12:28 pm

DancinJack wrote:
just brew it! wrote:
Getting a decent audio player in Linux shouldn't be this much of a struggle...

You can say that five times over.

...and the thing is, there's like 50 different ones available in the official repositories, and every single one of them I've tried over the past few years (which doesn't cover all of them, but a pretty substantial subset) has either been broken in some way, or missing some key piece of functionality. And this changes every few years, as Linux distros and the various players evolve.

So for the current environment on my primary desktop (Kubuntu 14.04), Audacious built from upstream source seems to be the best bet. I give 50/50 odds this will change when I eventually migrate to 16.04. :evil:

Also just realized that apparently the default when building Audacious is to omit support for direct playing of audio CDs. :roll: I don't feel like dealing with figuring out how to fix that right now since I don't play physical CDs on the PC very often anyway, and I need to get some real work done (working from home today).
Nostalgia isn't what it used to be.
 
just brew it!
Gold subscriber
Administrator
Topic Author
Posts: 51182
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Stupid Amarok replaygain bug

Sun Jan 22, 2017 8:10 am

just brew it! wrote:
As an aside, now I need to figure out why a bunch of the FLAC files from last fall's massive media re-encode project seem to have duplicate sets of meta-data tags for artist, album, and song names in them. Amarok apparently ignored duplicate tags (displaying only one of each type even if multiple ones were present), while Audacious tries to display them all (resulting in everything getting displayed twice); so I didn't even realize the files were mis-tagged until I tried to load them into Audacious.

Whatever the cause, I'm running a massive batch job (using 6 of the 8 cores on my desktop system) to find and clean up all of the duplicate tags. It's on the Ds right now; at this rate it looks like it'll take about 30 minutes to do the whole collection. (It would go a lot faster except I'm also recalculating the replaygain tags for any affected albums, on the theory if some tags are screwed up, the replaygain tags might be too.)
Nostalgia isn't what it used to be.

Who is online

Users browsing this forum: No registered users and 1 guest