Liquidsoap
  1. Liquidsoap
  2. LS-612

FLAC with 24 bit decoded audio volume is too low.

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0+dev
    • Component/s: None
    • Labels:
      None
    • Environment:
      CentOS 5.5, libsamplerate-0.1.8, flac-1.2.1

      Activity

      Hide
      Romain Beauxis
      added a comment -
      Hi!

      Thanks for including a test file!!

      Unfortunately, I cannot reproduce. I have tried this and it worked:
        liquidsoap 'output.ao(single("/tmp/bla.flac")) set("log.level",4)'

      Could you tell us more about your issue? And, if possible, include logs and perhaps a script?

      Thanks
      Show
      Romain Beauxis
      added a comment - Hi! Thanks for including a test file!! Unfortunately, I cannot reproduce. I have tried this and it worked:   liquidsoap 'output.ao(single("/tmp/bla.flac")) set("log.level",4)' Could you tell us more about your issue? And, if possible, include logs and perhaps a script? Thanks
      Hide
      Martin Konecny
      added a comment -
      I'd guess this has something to do with the system libraries Liquidsoap uses for playing FLAC correct Romain? Vittee, can the command line utility mplayer play this file on your system?
      Show
      Martin Konecny
      added a comment - I'd guess this has something to do with the system libraries Liquidsoap uses for playing FLAC correct Romain? Vittee, can the command line utility mplayer play this file on your system?
      Hide
      Vittee Nakka
      added a comment -
      Hi,

      Sorry for the delay.

      After re-investigating the issue, I found out that the file can be played in Liquidsoap, with some problem.
      The 24 bits FLAC sound is too quiet compared to 16 bits FLAC, I don't know what cause this, but I can hear it as usual via various players (foorbar2000, windows media player, mplayer, etc)

      The issue of track begin skipped was caused by the "eat_blank" operator which I instruct it to skip a track which is too quiet.

      BTW, The actual root cause of this issue is that the decoding of 24 bits FLAC file is too quiet.
      Show
      Vittee Nakka
      added a comment - Hi, Sorry for the delay. After re-investigating the issue, I found out that the file can be played in Liquidsoap, with some problem. The 24 bits FLAC sound is too quiet compared to 16 bits FLAC, I don't know what cause this, but I can hear it as usual via various players (foorbar2000, windows media player, mplayer, etc) The issue of track begin skipped was caused by the "eat_blank" operator which I instruct it to skip a track which is too quiet. BTW, The actual root cause of this issue is that the decoding of 24 bits FLAC file is too quiet.
      Hide
      Vittee Nakka
      added a comment - - edited
      Hi,

      I've looked into ocaml-flac source code and noticed that flac_stub.c does not handle 24 bit flac properly.

      Here's just a dirty and quick fix (decoding only).

      at function:

      static inline double sample_to_double(FLAC__int32 x, unsigned bps)

      at line 400 add this case to switch statement

          case 24:
            return (((double)x)/0x007fffffL);


      and, TADA! 24 bit FLAC files are now decoded properly, I can hear it loudly and clearly :)

      Show
      Vittee Nakka
      added a comment - - edited Hi, I've looked into ocaml-flac source code and noticed that flac_stub.c does not handle 24 bit flac properly. Here's just a dirty and quick fix (decoding only). at function: static inline double sample_to_double(FLAC__int32 x, unsigned bps) at line 400 add this case to switch statement     case 24:       return (((double)x)/0x007fffffL); and, TADA! 24 bit FLAC files are now decoded properly, I can hear it loudly and clearly :)
      Hide
      Martin Konecny
      added a comment -
      Great! Please patch upstream :)
      Show
      Martin Konecny
      added a comment - Great! Please patch upstream :)
      Hide
      Romain Beauxis
      added a comment -
      Just done, thanks!

      Is there any reason for you guys to release a new ocaml-flac soon? The bug does not seem that bad to me and I'd like to wait a bit to see if other issues may be reported.

      However, if you need this fix pushed, I'll do it quickly..
      Show
      Romain Beauxis
      added a comment - Just done, thanks! Is there any reason for you guys to release a new ocaml-flac soon? The bug does not seem that bad to me and I'd like to wait a bit to see if other issues may be reported. However, if you need this fix pushed, I'll do it quickly..
      Hide
      Romain Beauxis
      added a comment -
      Ha, I forgot: it would be nice if you could confirm that I did the right thing, although I'm quite confident but you never know :-)
      Show
      Romain Beauxis
      added a comment - Ha, I forgot: it would be nice if you could confirm that I did the right thing, although I'm quite confident but you never know :-)
      Hide
      Vittee Nakka
      added a comment -
      Hi,

      Thanks for giving me credit in the source file, however, could you please update my name to Wittawas Nakkasem? as it is the real-life full name.

      Thanks :)
      Show
      Vittee Nakka
      added a comment - Hi, Thanks for giving me credit in the source file, however, could you please update my name to Wittawas Nakkasem? as it is the real-life full name. Thanks :)
      Hide
      Romain Beauxis
      added a comment -
      Done!
      Show
      Romain Beauxis
      added a comment - Done!

        People

        • Assignee:
          Romain Beauxis
          Reporter:
          Vittee Nakka
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: