Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

MediaTomb and PS3 - all fine apart from MP3

Help
2008-06-14
2013-05-30
1 2 > >> (Page 1 of 2)
  • Hello there

    I downloaded and installed MediaTomb using the Synaptic Package Manager in Ubuntu 8.04 LTS (Hardy Heron) today. I have modified my /etc/mediatomb/config.xml file so that it supports the PS3.

    The PS3 picks up the files fine, but it does not play back any MP3's. It will display photo's like JPG and PNG fine, but PS3 brings back a message that the file may have been deleted from the server.

    When I try to download the file using the MediaTomb web interface it brings back a message like this:

    2008-06-14 21:33:24   ERROR: FileIOHandler::open: failed to open: /home/family/Music/DJ Lloyd C/June 2008/02 Track 02.mp3

    The file definitely exists because I can browse to it and play it in Rhythmbox, so what is the problem?

     
    • Jin
      Jin
      2008-06-14

      Your direcory with the MP3 files is set to inotify scan, right?

      This is a known problem, taglib opens the files in rw mode (we use taglib to read the album art), because of this inotify gets an IN_CLOSE_WRITE event which causes an update of the file in the database.

      Currently there is no possibility to open the files in read only mode using taglib, so the only thing I can suggest - set this directory to timed scan or disable the inotify feature for the directories that contain MP3 files with album art.

      Kind regards,
      Jin

       
    • Thanks for your advice Jin.

      This folder has already been set to a timed scan with the recursive option enabled.

      Do you have any other suggestions?

      Cheers,
      Aaron

       
    • Update:

      I have investigated further and found a way to workaround the issue but it is not acceptable for use on a family PC (there are users that will not be able to follow this workaround)...

      1: When starting the machine:
      MediaTomb is supposed to start automatically - there are symbolic links in rc2.d all the way through to rc5.d pointing to /etc/init.d/mediatomb but the mediatomb service does not start

      2: Manually starting the mediatomb service after logging on to the system:
      If I go to the terminal and type in 'mediatomb', MediaTomb starts and provides me with a URL to go to. I can browse to the MP3 directory in question but when I try to download the file it fails giving the same error message as above.

      3: Manually starting the mediatomb service as a super-user after logging on to the system:
      If I go to the terminal and type in 'sudo mediatomb' then provide my password, MediaTomb starts and provides me with a URL to go to. This time when I browse to the MP3 directory, it allows me to download the files.

      So I can work around it by following option 3. Obviously this is troublesome, and I am the only super-user on the system - the family profile will not be able to start MediaTomb as a super-user. How can I make MediaTomb host these files correctly without logging on to the system or processing a command manually in the terminal?

       
    • Jin
      Jin
      2008-06-14

      How is this related to starting MT? I can't follow.

      If the directory is set to timed scan, try setting it to basic instead of full.

      If that still fails do not set this directory to autoscan at all.

       
    • This is related to starting MT because the files do not serve correctly until a super-user manually starts the mediatomb application from the command line.

      The directory needs to be set to autoscan because the files will be constantly updated by non-super-user's.

       
    • Jin
      Jin
      2008-06-14

      Regarding point 1. (about rc.d) - read the details on the download page in the Ubuntu/Debian section, it describes package specific details, also related to automated startup in deamon mode.

      You probably don't have to set all directories to autoscan - how often do your MP3 files really change? Try the basic scan mode for those, I believe it will function correctly and not suffer from the taglib related problem.

      For photos/videos inotify or full timed scan should not be a problem.

      Once the server is running non super users could also access the web UI to add stuff (unless you disable it or setup a password)

       
    • I think that the main problem here now is that it is not starting up correctly in daemon mode...

      If I restart the system, and log on as any user, when I browse to file:///var/lib/mediatomb/mediatomb.html it just shows a username/password prompt and in this state it is not serving any files.

      I have followed the instructions provided on the http://mediatomb.cc/pages/download page.

      I have reinstalled since my last message and I am still getting the same problem.

       
    • Jin
      Jin
      2008-06-14

      That's a different issue again, actually - it has been discussed in the forums, would probably be a point for the FAQ.

      If you are probably using network manager, this way the network interface is not yet ready when you try to start MT in daemon mode. Switch your server to a fixed IP and disable network manager, this will ensure that the interface is ready - then MT will start up properly.

       
    • I was using NetworkManager but I have now removed the package as it wasn't required anyway.

      My IP address was 192.168.0.15 assigned by DHCP. It is now manually set to 192.168.0.2.

      Unfortunately, I am still getting the same problem - MT is not starting when the system boots and it is not serving any files. When I browse to the file:///var/lib/mediatomb/mediatomb.html address it still just presents me with a username and password.

      The funny thing is, I have reinstalled again and immediately after a reinstallation - it works. But when the system reboots, it stops working again.

       
    • In addition to my message above - when browsing to the web page and pressing CTRL+F5 to make sure I am not using a cached version of the page, it actually refuses a connection.

      When trying to process a 'sudo /etc/init.d/mediatomb stop' command, it says that it was already stopped...

      aaron@familypc:~$ sudo /etc/init.d/mediatomb stop
      [sudo] password for aaron:
      * Stopping upnp media server mediatomb                                          * upnp media server 'mediatomb' was already stopped

       
    • I have been reading on other forums and apparently there is a bug in the /etc/init.d/mediatomb file preventing the daemon from starting correctly. I cannot find any documentation on the official MT website on how to modify this file so that the daemon mode works correctly. I hope you can point me in the right direction.

      I have been reading http://ubuntuforums.org/archive/index.php/t-602502.html - the users on this forum still have not reached a resolution and seem to be just as baffled as I am!

       
    • Jin
      Jin
      2008-06-14

      Have you looked at /var/log/mediatomb.log - any error messages there?

      The bug about the home directory that is described in this forum is fixed in 0.11, so whatever is going wrong with your setup - it's probably something different.

      My first guess was network manager/ip setup, but it seems that this is not the case.

      I can only suggest to look at the log - what is the error message? Is the server starting at all? I tried it with our ubuntu test setup and the package from the ubuntu repository works without problems for me, there is no problem with the init script here.

       
      • I have just restarted the machine to see if the daemon starts automatically, but there is no record of it in the log.

        The time now is 00:40 and the last log is at 00:21 where I tried to start it manually then shut it down again.

         
    • OK.

      I have reinstalled again and followed the installation instructions on http://mediatomb.cc/pages/download to the very letter. I have modified the files correctly and I will insert them in to this post for you...

      /etc/mediatomb/config.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <config version="1" xmlns="http://mediatomb.cc/config/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/1 http://mediatomb.cc/config/1.xsd">
        <server>
          <ui enabled="yes">
            <accounts enabled="no" session-timeout="30">
              <account user="mediatomb" password="mediatomb"/>
            </accounts>
          </ui>
          <name>MediaTomb</name>
          <udn>uuid:45a72f38-c9ba-4367-98ac-9b36221173b5</udn>
          <home>/var/lib/mediatomb</home>
          <webroot>/usr/share/mediatomb/web</webroot>
          <storage>
            <sqlite3 enabled="yes">
              <database-file>sqlite3.db</database-file>
            </sqlite3>
            <mysql enabled="no">
              <host>localhost</host>
              <username>mediatomb</username>
              <database>mediatomb</database>
            </mysql>
          </storage>
          <protocolInfo extend="yes"/><!-- For PS3 support change to "yes" -->
          <!--
             Uncomment the lines below to get rid of jerky avi playback on the
             DSM320 or to enable subtitles support on the DSM units
          -->
          <!--
          <custom-http-headers>
            <add header="X-User-Agent: redsonic"/>
          </custom-http-headers>

          <manufacturerURL>redsonic.com</manufacturerURL>
          <modelNumber>105</modelNumber>
          -->
          <!-- Uncomment the line below if you have a Telegent TG100 -->
          <!--
             <upnp-string-limit>101</upnp-string-limit>
          -->
        </server>
        <import hidden-files="no">
          <scripting script-charset="UTF-8">
            <common-script>/usr/share/mediatomb/js/common.js</common-script>
            <playlist-script>/usr/share/mediatomb/js/playlists.js</playlist-script>
            <virtual-layout type="builtin">
              <import-script>/usr/share/mediatomb/js/import.js</import-script>
            </virtual-layout>
          </scripting>
          <mappings>
            <extension-mimetype ignore-unknown="no">
              <map from="mp3" to="audio/mpeg"/>
              <map from="ogg" to="application/ogg"/>
              <map from="asf" to="video/x-ms-asf"/>
              <map from="asx" to="video/x-ms-asf"/>
              <map from="wma" to="audio/x-ms-wma"/>
              <map from="wax" to="audio/x-ms-wax"/>
              <map from="wmv" to="video/x-ms-wmv"/>
              <map from="wvx" to="video/x-ms-wvx"/>
              <map from="wm" to="video/x-ms-wm"/>
              <map from="wmx" to="video/x-ms-wmx"/>
              <map from="m3u" to="audio/x-mpegurl"/>
              <map from="pls" to="audio/x-scpls"/>
              <map from="flv" to="video/x-flv"/>
              <!-- Uncomment the line below for PS3 divx support -->
              <map from="avi" to="video/divx"/>
              <!-- Uncomment the line below for D-Link DSM / ZyXEL DMA-1000 -->
              <!-- <map from="avi" to="video/avi"/> -->
            </extension-mimetype>
            <mimetype-upnpclass>
              <map from="audio/*" to="object.item.audioItem.musicTrack"/>
              <map from="video/*" to="object.item.videoItem"/>
              <map from="image/*" to="object.item.imageItem"/>
            </mimetype-upnpclass>
            <mimetype-contenttype>
              <treat mimetype="audio/mpeg" as="mp3"/>
              <treat mimetype="application/ogg" as="ogg"/>
              <treat mimetype="audio/x-flac" as="flac"/>
              <treat mimetype="image/jpeg" as="jpg"/>
              <treat mimetype="audio/x-mpegurl" as="playlist"/>
              <treat mimetype="audio/x-scpls" as="playlist"/>
              <treat mimetype="audio/x-wav" as="pcm"/>
              <treat mimetype="video/x-msvideo" as="avi"/>
            </mimetype-contenttype>
          </mappings>
        </import>
        <transcoding enabled="no">
          <mimetype-profile-mappings>
            <transcode mimetype="video/x-flv" using="vlcmpeg"/>
            <transcode mimetype="application/ogg" using="vlcmpeg"/>
            <transcode mimetype="application/ogg" using="oggflac2raw"/>
            <transcode mimetype="audio/x-flac" using="oggflac2raw"/>
          </mimetype-profile-mappings>
          <profiles>
            <profile name="oggflac2raw" enabled="no" type="external">
              <mimetype>audio/L16</mimetype>
              <accept-url>no</accept-url>
              <first-resource>yes</first-resource>
              <accept-ogg-theora>no</accept-ogg-theora>
              <agent command="ogg123" arguments="-d raw -f %out %in"/>
              <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
            </profile>
            <profile name="vlcmpeg" enabled="no" type="external">
              <mimetype>video/mpeg</mimetype>
              <accept-url>yes</accept-url>
              <first-resource>yes</first-resource>
              <accept-ogg-theora>yes</accept-ogg-theora>
              <agent command="vlc" arguments="-I dummy %in --sout #transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25,aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,channels=2}:standard{access=file,mux=ps,dst=%out} vlc:quit"/>
              <buffer size="14400000" chunk-size="512000" fill-size="120000"/>
            </profile>
          </profiles>
        </transcoding>
      </config>

      /etc/default/mediatomb:

      # Defaults for MediaTomb initscript
      # sourced by /etc/init.d/mediatomb
      # installed at /etc/default/mediatomb by the maintainer scripts

      #
      # This is a POSIX shell fragment
      #

      # Set whether the daemon should be started. Set this value to anything
      # but 'yes' to enable the daemon
      NO_START=""

      # Additional options that are passed to the daemon.
      OPTIONS=""

      # The network interface for MediaTomb to bind to and for which the multicast
      # routing entry should be added; "" if the route shouldn't be added at all.
      # For example: INTERFACE="eth0"
      INTERFACE=""

      # The route command and arguments to be used if INTERFACE is defined.
      # These variables should normally be left unmodified.
      ROUTE_ADD="/sbin/route add -net 239.0.0.0 netmask 255.0.0.0"
      ROUTE_DEL="/sbin/route del -net 239.0.0.0 netmask 255.0.0.0"

      # The user and group that MediaTomb should be run as.
      USER="mediatomb"
      GROUP="mediatomb"

      /var/log/mediatomb.log:

      2008-06-15 00:51:00    INFO: Loading configuration from: /etc/mediatomb/config.xml
      2008-06-15 00:51:00    INFO: UUID generated: 45a72f38-c9ba-4367-98ac-9b36221173b5
      2008-06-15 00:51:00    INFO: Checking configuration...
      2008-06-15 00:51:00    INFO: Setting filesystem import charset to UTF-8
      2008-06-15 00:51:00    INFO: Setting metadata import charset to UTF-8
      2008-06-15 00:51:00    INFO: Setting playlist charset to UTF-8
      2008-06-15 00:51:00    INFO: Configuration check succeeded.
      2008-06-15 00:51:00 WARNING: Sqlite3 database seems to be corrupt or doesn't exist yet.
      2008-06-15 00:51:00    INFO: no sqlite3 backup is available or backup is corrupt. automatically creating database...
      2008-06-15 00:51:02    INFO: database created successfully.
      2008-06-15 00:51:02    INFO: Initialized port: 49152
      2008-06-15 00:51:02    INFO: Server bound to: 192.168.0.2
      2008-06-15 00:51:03    INFO: MediaTomb Web UI can be reached by following this link:
      2008-06-15 00:51:03    INFO: http://192.168.0.2:49152/
      2008-06-15 00:53:25    INFO: MediaTomb shutting down. Please wait...
      2008-06-15 00:53:26    INFO: Server terminating

      Note that in the log file, I have since restarted the machine and there is no mention of the daemon attempting to start in the log file.

      I hope that you can help.

       
    • I have restarted the computer since my last post and the daemon has started.

      Unfortunately, I am back to square one and the MP3 files are not being served correctly. The folder being scanned is /home/family and the whole directory is being recursively scanned at a basic scan level, yet the files are still not there.

      When trying to download them through the web interface, I get a 404 error and on the PS3 I get the following error message:

      The folder could not be accessed.
      This content may have been deleted from the media server.

       
    • The error message in the log says this:

      2008-06-15 01:19:08   ERROR: FileIOHandler::open: failed to open: /home/family/Music/DJ Lloyd C/June 2008/01 Track 01.mp3

       
    • I am sorry that I keep posting, but I keep getting new problems.

      I'm truly perplexed by this next one...

      As before I am getting the problem with the MP3 files - none of them are being served.

      Now, I've recently updated the image library with about 20 more pictures. I waited for the database to update because this folder was part of a timed scan (set to 300 seconds at the moment).

      None of the images in this directory will download, neither on the web interface or on the PS3. The PS3 says that there are no images in that folder and the web interface brings back a 404 error message.

       
    • This morning I have discovered that it is not just MP3 files that are not being served - it is all files that are imported from the USB memory stick I am using. This includes pictures, so it explains the error message above. I have just tried copying another couple of images over from that memory stick on to the hard drive, and although I can view them fine from within the filesystem, MT refuses to serve them out.

       
    • Now it seems that any updates made to the database are refusing to be served as I just tried importing photos from a digital camera and I am getting the same problem I was getting when importing from the USB memory stick.

      It is only working with a handful of files and not all of them.

       
    • Jin
      Jin
      2008-06-15

      Well, I have to say that you must have something very weird in your setup.

      You mentioned the USB stick, I do not know how the things are related but there must be something to it. Regarding the 404 - just try to disable the autoscan once and check. I want to know the problem is related to that at all or not, but I am starting do doubt that.

      Unfortunately I can not give you more hints at this point, I really have no ideas. One possibility would be to recompile the server with debug log, this will spit out more messages and may help in finding the real reason for the problem.

       
      • I don't see how there can be anything weird in the setup... !!

        It's been downloaded from the official Ubuntu repository and I have only modified the config.xml file to allow PS3 support and the default/mediatomb file so that the no start variable is blank.

        Regardless of how I scan these folders, whether it's on basic, full, timed or just one-off, MediaTomb refuses to serve out the files.

        After a reinstallation, it even seems to remember that these files have come from a USB storage device and it refuses to serve them still!

        Because I am quite desperate, I have opened up MT publicly for a while... please check out http://87.82.12.243:49152/ and try the following:

        Try opening an image in /home/family/Pictures/Cats and it will work
        Try opening an image in /home/family/Pictures/Hammer Development and it will fail
        Try opening an MP3 from /home/family/Music/DJ Lloyd C/June 2008 and it will fail

         
    • Jin
      Jin
      2008-06-15

      Please turn on the firewall again, running MT externally is a security risk.

      I did a few tests though and I have to say that this does not make any sense to me.

      Files can be added, but as soon as they are added they can not be downloaded. I have never seen this before and that's what I mean by weird - we have hundreds of people who use the packages from the Ubuntu repository and it works for them. So there must be something different in your setup, something that either exposes a bug on our side or something else.

      At this point I can only suggest to recompile with debug log enabled, otherwise we will not get any more info out of this.

      Don't forget to firewall the server again :>

       
    • I think I've almost sussed it...

      It looks like when importing photos and music from any external media, only the user that imports the data (the owner) can view it... The group and others permissions are by default set to 'none' but after setting them to 'read only' it seems to work!

      Now if only it could import with an everyone-can-read policy then I'll be sorted...

      I think that I can safely say there is not a problem with MediaTomb - it is a problem with my Ubuntu setup, I need to find a way so that when I import the photos in the future, it can be set to read access for all users... I'll take up this query on the Ubuntu forums.

      Thank you for all your help.

       
    • Jin
      Jin
      2008-06-15

      One more thing: the MT daemon is running under a certain user/group, if your devices are mounted under some specific group you could also add MT to that group. Just a thought.

      Basically I was suspecting something like that, however usually I would expect a "permission denied" message in the console or something similar.

      But that's what I meant by "setup", things like that can be difficult to track :)

      Glad to hear that you got closer to a solution, I'm sure you can make it work the way you want.

      Kind regards,
      Jin

       
1 2 > >> (Page 1 of 2)