You have your music files on a remote computer, and you share these files via samba/windows file sharing. The shared files may be read only or writeable by you, and you have them mounted on your local filesystem. You can access the files just fine there and play them, but they cannot be added to the collection. Adding silently fails, is very slow, or music gets added but cannot be played.
The solution depends on how the music is shared.
mount -t cifs -o file_mode=0444,dir_mode=0555,guest //server/share /path/to/mount-point
You may have to add some sort of user authentication if your share needs a password. fmask=444 gives owner, group and other read permissions and dmask=555 gives them read and execute permissions for directories. guest mounts the share without any authentication. If you need to authenticate for acces, replace guest with username=remote-user. Pressing enter will prompt you for a password. You can change the ownership of the mount by adding uid=localuser,gid=groupname behind 'guest'.
mount -t cifs -o file_mode=0666,dir_mode=0777,guest //server/share /path/to/mount-point
mount -t cifs -o file_mode=0644,dir_mode=0755,uid=localuser,gid=groupname,guest //server/share /path/to/mount-point
Above results were found a trial-and-error basis. It seems that the Amarok indexer reads the permissions for the owner of the file, even if your user is not the owner. It expects these permissions to work and proceeds accordingly. The filesystem returns different permissions because you are not the owner. You can solve this by making sure that everybody has the same permissions as the owner. Of course, these permissions have to work out on the server as well, so if you mounted the share rw for everybody but you actually only have read access, things will not work. The last solution offered is the most elegant, because only your user has the permissions which are needed.
If the above worked for you, you probably don't want to mount the share every time you start you computer. You should add the appropriate information to /etc/fstab. This file defines which filesystems are mounted at boot. Fstab had the following layout:
devicename mountpoint filetype options dump pass
devicename is your //server/share
mountpoint is your /path/to/mount-point
filetype is cifs
option is everything that follows -o in the examples earlier, for example
fmask=644,dmask=755,guest,uid=your-user-name,gid=groupname,guest. If you need to provide a password for the share, create a file with username = your-user-name on the first line and password = your-password on the second line. Change the permissions on this file so that only you can read it (and therefore the password), and specify credentials=filename as one of the options.
dump and pass can be set 0 0.
Add all the information on a new line in /etc/fstab, like so:
//server/share /path/to/mountpoint cifs uid=localusername,gid=users,guest,fmask=444,dmask=555 0 0
Replace the server, share, etc as appropriate, and make sure the above is on one line in the file.
On Windows 2k/XP/Server shares it is important to mount them as cifs. cifs can handle much more files in directories and interacts better with the Microsoft software. Moreover it is important to set iocharset=utf8 because Windows uses Unicode for their filesystem since Windows 2000. This way you are able to use special characters abroad ASCII in your filenames without running into problems. An example line for /etc/fstab:
//server/share /path/to/mountpoint cifs iocharset=utf8,uid=localusername,gid=users,guest,file_mode=0444,dir_mode=0555 0 0