janbar / noson-app

The essential to control music from your SONOS devices on Linux platforms
GNU General Public License v3.0
344 stars 28 forks source link

Flatpack install shows limited number of Albums in the ~/Music directory. #224

Closed droj73 closed 4 months ago

droj73 commented 4 months ago

Thank you very much for Noson!

I am however having an issue with the Local Device Library/Index, in that I can NOT populate it with more than 12 entries from my local ~/Music location.

I installed on a second machine, with same result, but it would only populate with 6 entries.

This is a FlatHub install (ver 5.6.7), and Linux Mint 6.5.0-41-generic.

My Sonos speakers are (2) S2 (version 79.1-54060) devices running 1.20.1.7-1.2 hardware.

Any Ideas?

Thank you!

janbar commented 4 months ago

You could have a corrupted file in ~/Music. I haven't tested the flathub package. Can you try it with the AppImage provided in the release section ?

droj73 commented 4 months ago

Hi Jean-Luc, I have uninstalled my Flatpak version of Noson, and downloaded 'noson-latest-ubuntu-jammy-x86_64.AppImage' from the release site, made it executable, and run it with the same results. I can only display 12 albums in my ~/Music directory. I have 127 directories/albums there. I did have some album art (.jpg) files in my music directories. Would your program be able to handle/ignore these?

The 'My Index' selection from the main menu shows NO files or directories. How can I re-initialize the Index file?

Thank you.

janbar commented 4 months ago

The app already apply a filter on filename extension before scanning them. The scanner examines only files with extensions like .flac .mp3 .mp4 .ogg. So any albumart with extension .jpg are not scanned. To be valid, an audio file MUST contain few metadata like "artist", "album" or "track title", "genre". Without metadata the file is discarded, because it cannot be grouped in any aggregat. Finally the scanner uses filesystem features allowing to catch updates. Using a shared mount (smb or nfs) will break this requirement. First I recommend you to try with a small set of audio files, to see what happens. Then check if the app uses lot of cpu. Once the scanning is finished, the cpu usage should be near 0. It could be exist a bug during scanning metadata, but until now, I haven't get issue.

droj73 commented 4 months ago

Hi Jean-Luc, Thank you very much for your response (and time)!

I think I have found my problem, in that the files NOT showing up are .m4a files (AAC). The ones that did appear, were either .flac or .mp3. :) So my next question is, when can Noson support an .m4a file type?

Thank you, again!

janbar commented 4 months ago

For now the app handles M4A files:

https://github.com/janbar/noson-app/blob/9bcfac1e3b017a0edbfe7b18009434a2de27f64a/backend/NosonMediaScanner/mediascanner.cpp#L47C1-L50C1

and the parser should be enabled:

https://github.com/janbar/noson-app/blob/9bcfac1e3b017a0edbfe7b18009434a2de27f64a/backend/NosonMediaScanner/CMakeLists.txt#L11C1-L11C51

But M4A file (MP4 container) is only a container, so the embedded streams could be flagged in manner the app cannot handle them. In fact m4a is mp4 container that should contain an audio stream. In your case your files could contains others ...

droj73 commented 4 months ago

Hi Jean-Luc,

I created these audio files using the fre:ac application in Linux Mint, using the FDK-ACC Encoder v4.0.0 included in that package. It created an MP4 file format using .m4a file extensions.

The only changes I made to the default settings were: MPEG AAC Low Delay 96kbps bitrate per channel

This could be an Encoder issue, and I will check to see if there are updates/issues on that end.

Thank you, again for your help.

droj73 commented 4 months ago

Hi Jean-Luc,

I have searched for issues/updates for the FDK-ACC Encoder that I used for the creation of these files, with no luck. I understand that M4A is only a container for MP4 encode, and have even tried changing the file extensions to MP4, with no luck.

These files play with no issues on all of the music players included in Linux Mint (Rythmbox, MPV Media Player, etc.). They even play in my Honda!

That is why I cannot understand why they do not work with NOSON.

I have attached a sample, and was wondering if you might be able to tell me what is wrong with the encode. (I have changed the extension due to this platform does not accept an M4A file.)

Thank you.

https://github.com/user-attachments/assets/8dca7342-9dc5-4a79-80f9-feb08230afad

janbar commented 4 months ago

I am making some test on the file ...

janbar commented 4 months ago
parse: found chunk 66747970 size 24
parse: processing chunk
ftypparse: ERROR: bad magic header in file test.m4a [mp42]

I check for magic string "M4A" or "M4B". Here I found "mp42". Adding this magic string, the file is now valid:

parse: found chunk 66747970 size 24
parse: processing chunk
ftypparse: found chunk 6d6f6f76 size 82877
parse: processing chunk
moovparse:
info:true
complete:true

ALBUM       = A Momentary Lapse Of Reason
TITLE       = A New Machine - Part 1
ALBUMARTIST = 
GENRE       = Psychedelic Rock
ARTIST      = Pink Floyd
COMPOSER    = 
TRACKNO     = 7
janbar commented 4 months ago

So, I have to add the magic string "mp42" as valid for audio.

droj73 commented 4 months ago

Thank you, many times, for looking into this, Jean-Luc!

Since this is an encoder that comes with the fre:ac application, was sure that this problem would surface sooner or later.

Thank you, again. :)

janbar commented 4 months ago

Yo here, the SONOS device doesn't manage this stream type. MP42 differs from M4A or M4B. So that was the reason I added a check on the codec type.

I have few audio files AAC,, the codec is M4A and they works without issue. So I think the solution is to encode your audio files using as possible a supported standard. In my opinion I would prefer FLAC. But if you prefer compressed audio, then use mp3 320kbs. Sure they will work.

droj73 commented 4 months ago

Thank you, Jean-Luc.

Will do.