Author Topic: [solved] Problem with Perl 5.2  (Read 5837 times)

Einhard

  • Newbie
  • *
  • Posts: 12
    • View Profile
[solved] Problem with Perl 5.2
« on: June 05, 2014, 16:41:31 »
After upgrading perl to version 5.2 I get
Quote
Invalid version format (non-numeric data) at /usr/lib/perl5/core_perl/Encode.pm line 12.
BEGIN failed--compilation aborted at /usr/lib/perl5/core_perl/Encode.pm line 12.
Compilation failed in require at /usr/bin/gmusicbrowser line 26.
BEGIN failed--compilation aborted at /usr/bin/gmusicbrowser line 26.
as expected running with LC_ALL=C gmusicbrowser solves the problem but also killing localization support

Oh and can you make clipping prevention as option? I have a feeling it doesn't work as intended with mplayer backend and global volume other than 100. Whole replaygain analysis for mplayer seems a bit off or rather mplayer volume calculation (at least for my ears). I must change that line whenever I am updating gmusicbrowser and as I am using git it happens quite a lot (just call me lazy  ;D).
« Last Edit: July 01, 2014, 19:43:11 by Einhard »

Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1082
    • View Profile
Re: Problem with Perl 5.2
« Reply #1 on: June 08, 2014, 22:39:30 »
it's perl 5.20 not perl 5.2 :)

There is a change in perl 5.20 that causes problems when a library (in our case gtk) sets the locale without telling perl : https://rt.perl.org/Public/Bug/Display.html?id=121930
It shouldn't be too hard to fix, but I'll need to able to test it, which I currently can't.
I'm sure perl-gtk2 will include a fix of their own soon.

About the clipping prevention, if the problem is only that it doesn't work correctly, I'd rather fix it. I'll try to take a look and see if I see/hear a problem.

Einhard

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem with Perl 5.2
« Reply #2 on: June 09, 2014, 01:47:28 »
it's perl 5.20 not perl 5.2 :)
haha my bad I am always getting caught with this  ;D

Quote
About the clipping prevention, if the problem is only that it doesn't work correctly, I'd rather fix it. I'll try to take a look and see if I see/hear a problem.
Personally I am using track gain tag as volume control for each track. Replaygain analysis just doesn't do the job right, especially with mix of old songs mastered in times when loudness wasn't top priority and new ones. When I got my whole collection through replaygain analysis volume was all over the place, much worse than before the whole process. That's why I got global volume on 60 and if some track is too quiet I just adjust it's track gain tag (entering manually also peak on advanced tags seems too tiresome) . Problem with clipping prevention is that it works the same regardless of global volume

example:
with clipping prevention
At 60% volume program is parsing
mplayer -volume 21.6
and with 1dB track gain tag (no peak selected so it's probably 1)
mplayer -volume 21.6
At 100% volume and replaygain analysis (4.26 dB gain, 0.73 peak)
mplayer -volume 136.85

without clipping prevention:
At 60% volume program is parsing
mplayer -volume 21.6
and with 1dB track gain tag
mplayer -volume 24.24
How can be clipping here? With 136.85 no clipping and with 24.24 there is?

I just want to have more control over volume for each track. I know I am doing it wrong (without lowering the peak) but I don't see any other way to easily get the right volume per track.
« Last Edit: June 09, 2014, 04:04:19 by Einhard »

hansi

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Problem with Perl 5.2
« Reply #3 on: June 14, 2014, 04:24:43 »
Hi,

Same problem here for Perl 5.20 since update.
But on this link they said to simply "use locale" inside the script.
So, as error appear on line 26 in /usr/bin/gmusicbrowser
Code: [Select]
Invalid version format (non-numeric data) at /usr/lib/perl5/site_perl/Encode.pm line 12.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/Encode.pm line 12.
Compilation failed in require at /usr/bin/gmusicbrowser line 26.
BEGIN failed--compilation aborted at /usr/bin/gmusicbrowser line 26.

Where should I paste "use locale" in
Code: [Select]
use strict;
use warnings;
use utf8;

package main;
use Gtk2 '-init';
use Glib qw/filename_from_unicode filename_to_unicode/;
use POSIX qw/setlocale LC_NUMERIC LC_MESSAGES LC_TIME strftime mktime _exit/;
use Encode qw/_utf8_on _utf8_off/; #<---- LINE 26
??

Thanks,

Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1082
    • View Profile
Re: Problem with Perl 5.2
« Reply #4 on: June 14, 2014, 04:29:38 »
Where should I paste "use locale"
You can try putting it before "use Gtk2 '-init';"
Let me know if it works

hansi

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Problem with Perl 5.2
« Reply #5 on: June 14, 2014, 15:23:45 »
You can try putting it before "use Gtk2 '-init';"
Let me know if it works
Unfortunately no, it does not work. What can we try now?  :-/

Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1082
    • View Profile
Re: Problem with Perl 5.2
« Reply #6 on: June 27, 2014, 01:05:51 »
This should now be fixed in perl-gtk2 git (https://rt.perl.org/Ticket/Display.html?id=121930#txn-1298808).

In the mean time, running it with LC_NUMERIC=C should work and give you translations, just with dot as the decimal separator.

Also you can try changing the line "use Gtk2 '-init';" by
Code: [Select]
use Gtk2;
use POSIX qw/locale_h/;
BEGIN{ POSIX::setlocale (LC_ALL, ""); Gtk2::init (); }

Einhard

  • Newbie
  • *
  • Posts: 12
    • View Profile
Odp: Problem with Perl 5.2
« Reply #7 on: July 01, 2014, 19:41:55 »
I can confirm this, it's fixed upstream now