Contents

SourceForge Logo
Linux-Karma
Lkarmafs

What is it?

A GNU-linux user-space filesystem for the Rio Karma (RK) player based on libkarma and FUSE. Libkarma supports the RK PEARL protocol over TCPIP (Ethernet). In addition, starting with version 0.0.4, libkarma also supports the new mounted-disk (USB-OMFS) interface. Therefore, lkarmafs provides transparent access to the RK disk contents through both interfaces.

Lkarmafs implements a directory structure based on the RK file properties, most of which are extracted from the id3 tags of the tune files. In addition, each tune file is shown with a suffix determined from its "codec" property (.flac, .mp3, .ogg, etc.). An example of the default hierarchy is as follows:

        lkfs snapshot

Lkarmafs provides most usual filesystem calls, including statfs(), readdir(), getattr(), open(), read(), write(), unlink() (delete), etc. In particular, it provides multiple, concurrent READ/WRITE support. Once the RK is lkarmafs-mounted you can, for instance, have your PC player (e.g., mp3blaster, xmms or amarok) play some tunes and, simultaneously, have your favourite streamer stream (other) tunes through the LAN. And meanwhile, you can read some text files of the taxi subdir or copy arbritrary files from the RK to your PC. Moreover, if the RK is mounted through the Ethernet interface with the non-blocking-write option (-L), you may keep the RK itself playing other tunes through the earphones or the RCA lines. By default, write support is provided only for the taxi directory; but this can be optionally disabled with the '-T' option, which also adds the fake directory 'mountDirectory/upload', were tune files can be copied and they will automatically appear under tune/ with directory and file names derived fron the tune tags.

Based on FUSE, lkarmafs is mainly intended for single-user use. Using "chmod", taxi file permissions can be arbitrarily changed by the owner. Read-only access can be allowed to other users, under the additional control of standard file access permissions.

Basic properties of the whole filesystem are provided through statfs(). Therefore "df" shows the total disk size and used space. File properties such as size, access permissions, creation and access times, are shown as regular file attributes. For all the other properties, extended attributes are used. Therefore, using the appropriate GNU-Linux tools (e.g., "getfattr", "setfattr") full access to all the RK metadata associated to each file is granted.

Usage:

  • Invocation:
       lkarmafs [fuse-mount_opts] [-h] [-H|?] 
                [-B] [-F] [-G] [-L] [-T] [-U] [-V] [-W] [-X] [-Y]
                [-A path|hostname|IP] [-C userCodeset] [-D dummy-name]
                [-E tr-string1] tr-string2] [-P passwd]  mountDirectory
    
  • Options:
       -H : Show the specific lkarmafs options
       -h : Show the fuse and generic mount options.
       -f : (Non-daemon). Enables showing possible error messages.
       -B : Get properties from ??1 files rather than "smalldb" (USB-OMFS interface)
       -F : Force files to be written even if they are (different name) duplicates
       -G : Disable the "genre" level under "tune" in the filesystem hierarchy
       -L : Don't use permanent write-lock (simultaneous read-write may fail)
       -T : Allow moving/writing/deleting non-taxi files
       -U : Don't update play_last (access time) for tune files
       -V : Show currrent version
       -W : Don't write "smalldb" upon unmounting (USB-OMFS interface)
       -X : Don't use extended attributes (for tune properties such as play_count)
       -Y : Directory view of playlists
       -A IP|hostname|path : RK interface; default: USB-OMFS/TCPIP auto-discovery
       -C userCodeset : your choice of local codeset; default: from locale
       -D dummy-name : name for needed missing property values (def. "-UnKnown-")
       -E tr-string1 tr-string2 : tr-like pathname editing (man (1) tr)
       -P password : password of your RK, if set
    
  • Examples:

    See several invocation examples in the included README file. Here is a very simple one:

       lkarmafs -T -Y myKarmaDir
    

    Finds whether the RK is accessible: either USB-OMFS-mounted somewhere or connected through the Ethernet interface. If it is accessible, mounts the RK disk on myKarmaDir/. It is mounted daemon-mode and with the default (FUSE) access permission control.

    It is assumed that no Ethernet password has been set and the codeset is taken from the locale. Any occurrence of the character "/" in property values needed for path formation (artist, title, etc.) is replaced with "|" and any occurrence of "|" is shown as "\|". If some path-formation property value is missing, it is assigned the default dummy name "-UnKnown-". A special pseudo-file "myKarmaDir/options" is provided to allow changing some options at run time (i.e., without having to unmount and remount the filesystem).

    Because of -T, the RK disk is mounted with (limited) write permissions enabled for non-taxi files. A fake directory myKarmaDir/upload/ is provided where tunes can be copied so they will appear under myKarmaDir/tune/ with path names derived fron the tune tags. The -T option also enables tune renaming and deleting and other things such as `cat ~/myMusic/myArtist/myTune.mp3 > myKarmaDir/tune/A/B/C.mp3'. This sets the genre, artist, source, title and codec properties to 'A', 'B', 'C' and 'mp3', respectively. In this case, the RK will show this tune with these very same property names, ignoring the tune tags.

    The -Y option expands myKarmaDir/playlist/* files, leading to a directory-structured presentation of playlists.

    * To unmount:

       fusermount -u myKarmaDir
    
    or
       echo End > myKarmaDir/options
    

Warning!

OMFS unlink() was broken in omfs-0.5.6 and earlier versions. Use omfs-0.6.1 or later to avoid the risk of possible massive corruption of the RK disk.

More (up to date) info:

Download the current lkarmafs version and read the included README and Changelog files.