Bug 449701 - Length of audio tracks should be shown not in MB, but in minutes/seconds
Summary: Length of audio tracks should be shown not in MB, but in minutes/seconds
Status: RESOLVED NOT A BUG
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 21.12.2
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-06 14:37 UTC by Armin Mohring
Modified: 2022-02-23 07:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of Dolphin (181.07 KB, image/png)
2022-02-12 06:18 UTC, Armin Mohring
Details
Screenshot of Dolphin showing Duration column (45.22 KB, image/png)
2022-02-21 18:07 UTC, tagwerk19
Details
System Settings > Search > File Search (51.59 KB, image/png)
2022-02-22 07:45 UTC, tagwerk19
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Armin Mohring 2022-02-06 14:37:03 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT
Length of audio tracks are shown in MB

EXPECTED RESULT
Length of audio tracks should be shown in minutes, seconds. E.g.: wav files

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: kernel 5.15.19
KDE Plasma Version: 5.90
KDE Frameworks Version: 
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Nicolas Fella 2022-02-12 02:10:30 UTC
Could you please make a screenshot showing the problem?
Comment 2 Armin Mohring 2022-02-12 06:18:44 UTC
Created attachment 146620 [details]
Screenshot of Dolphin
Comment 3 Nicolas Fella 2022-02-12 13:10:22 UTC
What is shown here is the size of the audio file. The file size column is shown for all files, regardless of whether it's an audio file or not. You can additionally display the length/duration by right-clicking on the column header and checking Audio > Duration
Comment 4 Armin Mohring 2022-02-12 19:12:17 UTC
When I try to set the length with "Audio>Duration" nothing is shown there.
Comment 5 tagwerk19 2022-02-12 21:41:42 UTC
(In reply to Armin Mohring from comment #4)
> When I try to set the length with "Audio>Duration" nothing is shown there.
This is on a separate disc?

As far as I remember, Dolphin gets its information about embedded tags (such as the Duration which is I think in the ID3 metadata) by asking Baloo. If you are looking at just one file, Dolphin can get the information itself, if you want the infor for all the files in a folder, Dolphin asks Baloo.

You can check whether Baloo has indexed the file with

    $ balooshow -x '/data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav'

If the file's indexed, you'll get a list of information.

You might find you have to configure Baloo to index the /data/Musik folders (with "Content Indexing" as Baloo has to read the files to get to the embedded info)
Comment 6 Nicolas Fella 2022-02-12 21:46:13 UTC
Correct, the metadata columns require Baloo with content indexing to be enabled
Comment 7 Armin Mohring 2022-02-16 20:08:21 UTC
If I start baloo (with balooctl enable), then the duration of the audio tracks is not shown.
Comment 8 tagwerk19 2022-02-16 23:43:41 UTC
(In reply to Armin Mohring from comment #7)
> If I start baloo (with balooctl enable), then the duration of the audio
> tracks is not shown.
Are you sure that Baloo is indexing the folder? As per comment 5, what does
    $ balooshow -x '/data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav'
give you?

Baloo does not automatically index everything, it's quite likely that it would need to be told about /data (I'm assuming /data is a separate local disk in your machine)
Comment 9 tagwerk19 2022-02-17 07:55:53 UTC
(In reply to tagwerk19 from comment #8)
> $ balooshow -x '/data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav'
Perhaps worth a mention, if you've got something that automatically builds filenames, watch out for the hyphens. I've noticed that sometimes a longer "dash" is used instead of a "minus" sign.

I don't think this affects Baloo indexing/searching, but might catch you out if you are typing in filenames.
Comment 10 Armin Mohring 2022-02-17 08:03:36 UTC
I have started baloo with balloctl enable, but there is no entry from the music files.
/data is another SSD for storage.

How can I scan the music files with baloo "manually" ?
Comment 11 tagwerk19 2022-02-17 08:24:43 UTC
(In reply to Armin Mohring from comment #10)
> ... /data is another SSD for storage ...
You can tell baloo to index it via System Settings GUI

    System Settings > Search > File Search

and

    Add folder configuration

You get given the options of including/excluding folders...

    Start indexing a folder

and then you can select it.

(In reply to Armin Mohring from comment #10)
> ... How can I scan the music files with baloo "manually" ? ...
Not sure whether there's a way of doing a "one off" indexing of a set of files but you can index individual files through the command line:

    balooctl index YourFiles
Comment 12 Armin Mohring 2022-02-17 08:44:41 UTC
I have enabled baloo in the system settings, then activated index search.
But: in dolphin there was no duration of the music files (settings -> audio -> duration).
Comment 13 tagwerk19 2022-02-17 16:02:57 UTC
(In reply to Armin Mohring from comment #12)
> ... But: in dolphin there was no duration of the music files (settings -> audio -> duration).
Did you get anything from?
    $ balooshow -x '/data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav'
Comment 14 tagwerk19 2022-02-19 07:59:49 UTC
Post the results if you find anything, thanks!
Comment 15 Armin Mohring 2022-02-19 08:17:00 UTC
I have started the indexing baloo.

balooshow -x ... shows:
data/Musik/Bryan: Keine gültige URL oder Dokument-Kennung
Adams: Keine gültige URL oder Dokument-Kennung
-: Keine gültige URL oder Dokument-Kennung
Reckless/01: Keine gültige URL oder Dokument-Kennung
-: Keine gültige URL oder Dokument-Kennung
One: Keine gültige URL oder Dokument-Kennung
Night: Keine gültige URL oder Dokument-Kennung
Love: Keine gültige URL oder Dokument-Kennung
Affair.wav: Keine gültige URL oder Dokument-Kennung
Comment 16 tagwerk19 2022-02-19 08:51:44 UTC
(In reply to Armin Mohring from comment #15)
>  $ balooshow -x '/data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav'
>  ... gives:
> data/Musik/Bryan: Keine gültige URL oder Dokument-Kennung
> Adams: Keine gültige URL oder Dokument-Kennung
>  ...
Looks like something is messing up with your single quotes here.

What you are looking for is something like this:
    2d7bf00000028 40 186303 /data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav
            Mtime: 1645259880 2022-02-19T09:38:00
            Ctime: 1645259880 2022-02-19T09:38:00
which says Baloo has knows about the file, or
    /data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav: Not a valid URL or document ID
where Baloo's not found it.

Spaces in filenames can be awkward and annoying :-)
Comment 17 Armin Mohring 2022-02-19 18:32:50 UTC
Now, I have managed to start baloo -x ...

1b0004c00000801 2049 28311628 /data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav
	Mtime: 1644062184 2022-02-05T11:56:24
	Ctime: 1644062511 2022-02-05T12:01:51
	Cached properties:
		Bitrate: 1411000
		Kanäle: 2
		Dauer: 273
		Abtastrate: 44100

Interne Information
Begriffe: Maudio Mwav Mx T2 X1-1411000 X2-2 X3-273 X5-44100 
Dateinamen-Begriffe: F01 Faffair Flove Fnight Fone Fwav 
XAttr Begriffe: 
duration: 273
channels: 2
sampleRate: 44100
bitRate: 1411000
Comment 18 Armin Mohring 2022-02-19 18:34:31 UTC
But, if I set Audio -> Duration in Dolphin, then the time of the music files is not displayed.
Comment 19 tagwerk19 2022-02-20 09:05:57 UTC
(In reply to Armin Mohring from comment #18)
> But, if I set Audio -> Duration in Dolphin, then the time of the music files
> is not displayed.
That is most wierd.

Maybe try the simplest things first, log out and back in again on the hope that Dolphin is caching an "old" view without the Duration info.

If you press F11, the Information Panel should show the same info as the "balooshow" (this comes direct from the disc, not from the baloo index) - You'd see this same information if you right click and look at the File Properties > Details.

After that, I suppose it's worth finding and copying a .mp3 into the folder and checking whether you see the Duration for that and maybe copying the wav file to /data/Musik/testfile.wav to see if there's any strangeness with hyphens or spaces in filenames.

You can see I'm guessing a bit here; a bit like throwing spaghetti at the wall to see if anything sticks :-/
Comment 20 Armin Mohring 2022-02-20 09:08:43 UTC
If I set 'settings -> Audio -> duration', log out from the session, login, then there is nothing displayed in the column.
Comment 21 tagwerk19 2022-02-21 18:07:22 UTC
Created attachment 147011 [details]
Screenshot of Dolphin showing Duration column
Comment 22 tagwerk19 2022-02-21 18:13:02 UTC
(In reply to Armin Mohring from comment #20)
> If I set 'settings -> Audio -> duration', log out from the session, login,
> then there is nothing displayed in the column.
Sorry, I am out of ideas.

I've tried setting up a Manjaro system (as a KVM guest, with a separate disc mounted under /data). I've downloaded a 'test' wav file from:

    https://file-examples-com.github.io/uploads/2017/11/file_example_WAV_1MG.wav

and copied it to:

    /data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav

I've set up baloo to index $HOME and /data/Musik and the indexing works:

    $ baloosearch Love
    /data/Musik/Bryan Adams – Reckless/01 – One Night Love Affair.wav

    $ baloosearch Duration:33
    /data/Musik/Bryan Adams – Reckless/01 – One Night Love Affair.wav

    ... The test .wav file is 33 sec long

I'm pretty sure this follows the setup you are using - and I get the Duration for the track shown in Dolphin (when Dolphin is told to display an "Audio > Duration" column). I get the columns looking like:

    https://bugs.kde.org/attachment.cgi?id=147011

I'm not sure what more I can try.
Comment 23 tagwerk19 2022-02-22 07:45:41 UTC
Created attachment 147038 [details]
System Settings > Search > File Search
Comment 24 tagwerk19 2022-02-22 08:03:13 UTC
(In reply to tagwerk19 from comment #22)
> I'm not sure what more I can try.
Ah. I missed a possible step.

I can get an empty "Duration" column in Dolphin if I'm running Baloo without content indexing. The System Settings > Search > File Search" would need to look like:
    https://bugsfiles.kde.org/attachment.cgi?id=147038

If, for some reason, the "Also index file content" is not ticked, you'd need to tick it and apply. Then to ensure all the files are indexed it's best to run "balooctl purge" to clean the index and reindex (it's possible to run "balooctl monitor" from a separate command line to see the files as they are indexed). Last step, close Dolphin and restart it (an F5 refresh is not enough)

These steps work on my test machine.

The odd bit is that your "balooshow -x" (as per your Comment 17) did give you a duration. It's tricky to see how that fits together.
Comment 25 Armin Mohring 2022-02-22 17:27:26 UTC
balooshow -x ...

shows

1b0004c00000801 2049 28311628 /data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav
	Mtime: 1644062184 2022-02-05T11:56:24
	Ctime: 1644062511 2022-02-05T12:01:51

Interne Information
Begriffe: Maudio Mwav Mx T2 
Dateinamen-Begriffe: F01 Faffair Flove Fnight Fone Fwav 
XAttr Begriffe:
Comment 26 Armin Mohring 2022-02-22 17:29:28 UTC
Second try of balooshow -x...

1b0004c00000801 2049 28311628 /data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav
	Mtime: 1644062184 2022-02-05T11:56:24
	Ctime: 1644062511 2022-02-05T12:01:51

Interne Information
Begriffe: Maudio Mwav Mx T2 
Dateinamen-Begriffe: F01 Faffair Flove Fnight Fone Fwav 
XAttr Begriffe: 
1b0004c00000801 2049 28311628 /data/Musik/Bryan Adams - Reckless/01 - One Night Love Affair.wav
	Mtime: 1644062184 2022-02-05T11:56:24
	Ctime: 1644062511 2022-02-05T12:01:51
	Cached properties:
		Bitrate: 1411000
		Kanäle: 2
		Dauer: 273
		Abtastrate: 44100

Interne Information
Begriffe: Maudio Mwav Mx T2 X1-1411000 X2-2 X3-273 X5-44100 
Dateinamen-Begriffe: F01 Faffair Flove Fnight Fone Fwav 
XAttr Begriffe: 
sampleRate: 44100
duration: 273
channels: 2
bitRate: 1411000
Comment 27 Armin Mohring 2022-02-22 17:32:31 UTC
Starting indexing and also file content, add column ’duration’ to dolphin.
Then I log out and login.
Now it works.
Comment 28 tagwerk19 2022-02-23 07:26:53 UTC
(In reply to Armin Mohring from comment #27)
> ... I log out and login.
> Now it works ...
Wonderful :-)

I think I'll close this as "Not a Bug" as, well, it just needed the right magic (and no code fixes :-)