Cannot browse my USB-mounted library

Bug #974685 reported by Mike O'Donnell
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
RJ Skerry-Ryan
1.10
Won't Fix
Low
RJ Skerry-Ryan
1.11
Fix Released
Low
RJ Skerry-Ryan

Bug Description

I cannot take the file browser into my external USB drive. It gets mounted as /media/de85dc0a-bd4f-430d-aa21-ab449fff2f01. So the long file name is a possible problem. In the browser, I see de85dc0a-bd4f-430d-aa21-ab449fff2f01, but there is no arrow to open up the tree further, and if I select it as a file it shows no contents (the contents are all subdirectories---I haven't yet tested the result of placing a sound file right at the root of de85dc0a-bd4f-430d-aa21-ab449fff2f01).

My library is at /media/de85dc0a-bd4f-430d-aa21-ab449fff2f01/Archive/Sounds/Music/ and Mixxx gets to the library through that path for all library functions. So, browsing is behaving differently than library access.

I tried setting a symbolic link from my user file space, which is browsable. I got the same result for that link.

I'm running Mixxx 1.10.0 on Xubuntu Oneiric.

This may be related to Bug #91146, in which the browser would not show files or directories with non-ASCII characters. I'm pretty sure that the directory name is all ASCII, but if the name length is the problem it could be a different trigger for some name processing code that makes too many assumptions. In any case, the code for file path processing in the browser appears to be different from the code for path processing in access to the library, and they should probably invoke the same code.

Tags: browse library

Related branches

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Hm, I agree that that path looks like all ASCII. Did you navigate to de85dc0a-bd4f-430d-aa21-ab449fff2f01 by going to the root and then media or did you use the 'Devices' node in the browse view?

Changed in mixxx:
milestone: none → 1.10.1
tags: added: browse library
Revision history for this message
Mike O'Donnell (michael-odonnell) wrote :

RJ Ryan wrote: Did you navigate to de85dc0a-bd4f-430d-aa21-ab449fff2f01 by going to the root and then media or did you use the 'Devices' node in the browse view?

I tried it both ways, with the same result.

Revision history for this message
Jan-Erik Meyer-Luetgens (mail-wz6bkyhu4uqpfausw0ege9b0y33ege6o4wzvqwe1gy1) wrote :

I've the same problem. I can't access my raid-system which is mounted under /raid
(no arrow/triangle in front of the raid entry)

$ grep raid /etc/fstab
/raid /net/export/raid none noauto,bind,noatime 0 0

$ ls -ld /raid
drwxrwxrwx 19 draco root 13k 16. Jul 15:41 raid/

$ ls -l /raid
drwxrwxrwx 19 draco draco 4.1k Jul 16 16:09 todo/

$ touch /raid/hello.wav
$ mkdir /raid/music
$ ls -l /raid
-rw-r----- 1 draco draco 0 16. Jul 16:15 hello.wav
drwxr-x--- 2 draco draco 1 16. Jul 16:17 music/
drwxrwxrwx 19 draco draco 4,1k 16. Jul 16:09 todo/

When I click on the raid directory in mixxx the hello.wav is displayed but not the music sub-dir
(still no arrow in front of the raid dir entry)

arch-linux, kernel 3.4.4
mixxx version 1.10.0 and self compiled trunk

Revision history for this message
Jan-Erik Meyer-Luetgens (mail-wz6bkyhu4uqpfausw0ege9b0y33ege6o4wzvqwe1gy1) wrote :

I put a wrong line in the coment

Once again (full output)

$ grep raid /etc/fstab
LABEL=DATA /raid jfs noauto,noatime 0 0
/raid /net/export/raid none noauto,bind,noatime 0 0

(simply you can ignore the last one, it's for NFSv4 export)

Revision history for this message
Jan-Erik Meyer-Luetgens (mail-wz6bkyhu4uqpfausw0ege9b0y33ege6o4wzvqwe1gy1) wrote :

I tracked down the Bug.

The FolderTreeModel::hasChildren method is buggy.
(File: src/library/browsefoldertreemodel.cpp)

It uses the readdir call, but it works only on some file systems.

entry->d_type is DT_DIR for direcories on these file systems.
on the other (non working) file systems entry->d_type is DT_UNKNOWN

See the readdir(3) man page.

My raid file system is JFS and I asume Mike's USB-Drive file system is NTFS or VFAT, so we are
out of luck.

Revision history for this message
Jan-Erik Meyer-Luetgens (mail-wz6bkyhu4uqpfausw0ege9b0y33ege6o4wzvqwe1gy1) wrote :

BTW, the hasChildren method is triggered when you move
the mouse pointer in the directory tree view, many times.
Is this intended?

Revision history for this message
RJ Skerry-Ryan (rryan) wrote : Re: [Bug 974685] Re: Cannot browse my USB-mounted library

Thanks a lot for debugging this Jan-Erik.

Qt will indeed call hasChildren on item-models potentially very frequently.
I think nobody realized this when this feature was added. We should memoize
the result of hasChildren to save on this expensive lookup.

It's unfortunate that the type information isn't present for some
filesystems. Maybe we can detect if it isn't working (all children are
always of type UNKNOWN) and then fall back on using QFileInfoList to check
for directories.

On Mon, Jul 16, 2012 at 1:21 PM, Jan-Erik Meyer-Luetgens <
<email address hidden>> wrote:

> BTW, the hasChildren method is triggered when you move
> the mouse pointer in the directory tree view, many times.
> Is this intended?
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/974685
>
> Title:
> Cannot browse my USB-mounted library
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/974685/+subscriptions
>

Changed in mixxx:
status: New → Confirmed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: 1.10.1 → none
status: Confirmed → In Progress
assignee: nobody → RJ Ryan (rryan)
importance: Undecided → Low
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I've committed a fix to cache the filesystem checks for whether a directory has subdirectories in lp:mixxx/1.11 r3318. I've written the following patch which checks if all the entries returned by readdir are of type DH_UNKNOWN and if so, falls back on QDir::entryInfoList to check for subdirectories.

Jan-Erik -- are you building from source? Can you test this patch and verify if it fixes the issue for you? If so I will commit it.

Thanks,
RJ Ryan

Revision history for this message
Jan-Erik Meyer-Luetgens (mail-wz6bkyhu4uqpfausw0ege9b0y33ege6o4wzvqwe1gy1) wrote :

Sure, but I can't apply the patch to r3317

/data/dist/mixxx/1.11$ patch -p0 <jfs_fix.patch
patching file mixxx/src/library/browse/foldertreemodel.cpp
Hunk #1 FAILED at 88.
1 out of 1 hunk FAILED -- saving rejects to file mixxx/src/library/browse/foldertreemodel.cpp.rej

Jan-Erik

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Hi Jan-Erik,

Can you try updating to or past r3318? I made some changes in that revision
that would cause the patch to not apply cleanly before it.

Thanks,
RJ

On Wed, Jul 18, 2012 at 5:03 PM, Jan-Erik Meyer-Luetgens <
<email address hidden>> wrote:

> Sure, but I can't apply the patch to r3317
>
> /data/dist/mixxx/1.11$ patch -p0 <jfs_fix.patch
> patching file mixxx/src/library/browse/foldertreemodel.cpp
> Hunk #1 FAILED at 88.
> 1 out of 1 hunk FAILED -- saving rejects to file
> mixxx/src/library/browse/foldertreemodel.cpp.rej
>
> Jan-Erik
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/974685
>
> Title:
> Cannot browse my USB-mounted library
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/974685/+subscriptions
>

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I went ahead and committed the patch to lp:mixxx/1.11 because it's pretty
non-controversial. Could you pull the latest version of lp:mixxx/1.11 and
give it a shot?

On Wed, Jul 18, 2012 at 5:17 PM, RJ Ryan <email address hidden> wrote:

> Hi Jan-Erik,
>
> Can you try updating to or past r3318? I made some changes in that
> revision that would cause the patch to not apply cleanly before it.
>
> Thanks,
> RJ
>
>
> On Wed, Jul 18, 2012 at 5:03 PM, Jan-Erik Meyer-Luetgens <
> <email address hidden>> wrote:
>
>> Sure, but I can't apply the patch to r3317
>>
>> /data/dist/mixxx/1.11$ patch -p0 <jfs_fix.patch
>> patching file mixxx/src/library/browse/foldertreemodel.cpp
>> Hunk #1 FAILED at 88.
>> 1 out of 1 hunk FAILED -- saving rejects to file
>> mixxx/src/library/browse/foldertreemodel.cpp.rej
>>
>> Jan-Erik
>>
>> --
>> You received this bug notification because you are a member of Mixxx
>> Development Team, which is subscribed to Mixxx.
>> https://bugs.launchpad.net/bugs/974685
>>
>> Title:
>> Cannot browse my USB-mounted library
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/mixxx/+bug/974685/+subscriptions
>>
>
>

Revision history for this message
Jan-Erik Meyer-Luetgens (mail-wz6bkyhu4uqpfausw0ege9b0y33ege6o4wzvqwe1gy1) wrote :

Ok, I tested it.

- Now, I can browse my file system
- The hasChildren method is not triggered anymore by moving the mouse
  over the tree view

- But when I create new directory, the view not updated by a single click.
  You have to collapse and expand the parent directory.

Jan-Erik

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Thanks for testing Jan-Erik. I've filed a new bug, Bug #1056559, to eliminate the need to open/close the section to refresh whether it has subfolders or not. Marking this fixed since your USB-mounted library is now browseable.

Changed in mixxx:
status: In Progress → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/6345

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.