gateship-one / odyssey

Odyssey music player
GNU General Public License v3.0
235 stars 39 forks source link

Unable to play "HD" Flac #62

Closed KevinMinions closed 7 years ago

KevinMinions commented 7 years ago

I'm not able to use Odyssey App to listen "HD" Flac files. Same problem with Google Play Music, or the media player included in Solide Explorer App.

But, VLC 2.1.4 https://play.google.com/store/apps/details?id=org.videolan.vlc is able to play this file. So maybe it could help you ;-)

Thank you and have a nice day.

Flac file info (from my computer)

00000000 File Header (4 bytes) 00000000 Signature: fLaC 00000004 00 - STREAMINFO (38 bytes) 00000004 Header (4 bytes) 0000000B Last-metadata-block: No 00000004 BLOCK_TYPE: 0 (0x00)(7 bits) - 00000005 Length: 34 (0x000022) 00000008 BlockSize_Min: 1152 (0x0480) 0000000A BlockSize_Max: 1152 (0x0480) 0000000C FrameSize_Min: 2565 (0x000A05) 0000000F FrameSize_Max: 5439 (0x00153F) 00000016 SampleRate: 96000 (0x17700)(20 bits) - 00000013 Channels: 1 (0x01)(3 bits) - 2 channels - 00000016 BitPerSample: 23 (0x17)(5 bits) - 24 bits - 00000012 Samples: 4985600 (0x4C1300)(36 bits) - 0000001A MD5 signature of the unencoded audio dat: 11138771849978816100283884164309691608 (0x8613FDA5061E5FC9FB97368EE19ACD8) 0000002A -------------------------- 0000002A --- FLAC, accepted --- 0000002A -------------------------- 0000002A 04 - VORBIS_COMMENT (190 bytes) 0000002A Header (4 bytes) 00000031 Last-metadata-block: No 0000002A BLOCK_TYPE: 4 (0x04)(7 bits) - 0000002B Length: 186 (0x0000BA) 0000002E File Header (21 bytes) 0000002E vendor_length: 13 (0xD) 00000032 vendor_string: Lavf57.34.103 0000003F user_comment_list_length: 6 (0x6) 00000043 ------------------------------- 00000043 --- VorbisCom, accepted --- 00000043 ------------------------------- 00000043 TRACKNUMBER=01 (18 bytes) 00000043 Header (4 bytes) 00000043 length: 14 (0xE) 00000047 comment: TRACKNUMBER=01 00000055 TITLE=** (23 bytes) 00000055 Header (4 bytes) 00000055 length: 19 (0x13) 00000059 comment: TITLE=Tulou Tagaloa 0000006C ALBUM=** ** **/** ** (65 bytes) 0000006C Header (4 bytes) 0000006C length: 61 (0x3D) 00000070 comment: ALBUM=** ** **/** ** 000000AD ARTIST=Various Artists (26 bytes) 000000AD Header (4 bytes) 000000AD length: 22 (0x16) 000000B1 comment: ARTIST=Various Artists 000000C7 GENRE=Soundtrack (20 bytes) 000000C7 Header (4 bytes) 000000C7 length: 16 (0x10) 000000CB comment: GENRE=Soundtrack 000000DB DATE=2016 (13 bytes) 000000DB Header (4 bytes) 000000DB length: 9 (0x9) 000000DF comment: DATE=2016 000000E8 ------------------------------ 000000E8 --- VorbisCom, filling --- 000000E8 ------------------------------ 000000E8 ------------------------------- 000000E8 --- VorbisCom, finished --- 000000E8 ------------------------------- 000000E8 06 - PICTURE - Cover (front) (455417 bytes) 000000E8 Header (4 bytes) 000000EF Last-metadata-block: No 000000E8 BLOCK_TYPE: 6 (0x06)(7 bits) - 000000E9 Length: 455413 (0x06F2F5) 000000EC Picture type: 3 (0x00000003) 000000F0 MIME type size: 10 (0x0000000A) 000000F4 MIME type: image/jpeg 000000FE Description size: 9 (0x00000009) 00000102 Description: cover.jpg 0000010B Width: 0 (0x00000000) 0000010F Height: 0 (0x00000000) 00000113 Color depth: 0 (0x00000000) 00000117 Number of colors used: 0 (0x00000000) 0000011B Data size: 455362 (0x0006F2C2) 0000011F Data: (455362 bytes) 0006F3E1 02 - APPLICATION (1096 bytes) 0006F3E1 Header (4 bytes) 0006F3E8 Last-metadata-block: No 0006F3E1 BLOCK_TYPE: 2 (0x02)(7 bits) - 0006F3E2 Length: 1092 (0x000444) 0006F3E5 Application: UITS 0006F3E9 (Application specific): (1088 bytes) 0006F829 01 - PADDING (3060 bytes) 0006F829 Header (4 bytes) 0006F830 Last-metadata-block: Yes 0006F829 BLOCK_TYPE: 1 (0x01)(7 bits) - 0006F82A Length: 3056 (0x000BF0) 0006F82D Data: (3056 bytes) 0007041D --------------------------------------------- 0007041D --- Flac, finished but searching tags --- 0007041D --------------------------------------------- 0007041D ----------------------------------------------------- 0007041D --- Tags detection, jumping to offset 1265481 --- 0007041D ----------------------------------------------------- 01265481 -------------------------- 01265481 --- FLAC, finished --- 01265481 -------------------------- 01265481 ------------------------- 01265481 --- FLAC, filling --- 01265481 -------------------------

djselbeck commented 7 years ago

Odyssey uses the Android media framework for decoding and playback of music. Whereas VLC uses its own decoding framework (based on ffmpeg?) .

Therefore playback support depends on the android system you are using some manufacturers implement this on their own (Sony for example does).

On a personal note: Most android systems are running at a fixed samplerate of 48kHz (with some exceptions). So if VLC is decoding a flac with 96kHz samplerate it needs to downsample it by half which not only results in more cpu usage but also more battery strain.

You can verify this by looking through the /proc/asound/card/pcmp/ files during playback.

adb shell 'for i in /proc/asound/card*/pcm*p/sub*/hw_params;do echo $i:;cat $i;done' works on my sony device for example.

Some devices bypass the alsa framework by hw decoding and directly feeding the signal in the mixer in which case all audio devices are closed.

But what I want to say as a enthusiast about good audio quality is that you gain very little with high bitrate & samplerate audio files on a mobile device whereas the negatives (high cpu consumption, high space requirement) are remarkable 😉

KevinMinions commented 7 years ago

Ok, thank you @djselbeck for the explanations.

hex-m commented 7 years ago

The android documentation lists flac as one of the core media formats that are supported.

djselbeck commented 7 years ago

No one said, that flac is unsupported. This issue is about flacs with more than 48kHz samplerate.

Mono/Stereo (no multichannel). Sample rates up to 48 kHz (but up to 44.1 kHz is recommended on devices with 44.1 kHz output, as the 48 to 44.1 kHz downsampler does not include a low-pass filter). 16-bit recommended; no dither applied for 24-bit.

djselbeck commented 7 years ago

Closing this issue as this is device and android dependent.