Announcement

Collapse
No announcement yet.

Accessing an Mp3 player

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Accessing an Mp3 player

    Ok, so I've done a bit of searching to try to find out how to get my mp3 player recognised, and most of what I've learned is that its hard, and varies a lot based on the mp3 player. Still, I'd appreciate any pointers that anyone can give.

    So I've got a Samsung YP-T9 mp3 player (Yes, its old. Yes, its crap. But it was free, and its got my music on it now...) I plug it in to my brand new install of Kubuntu 9.10 with its USB cable, and I see in dmesg:

    Code:
    [ 5099.431278] usb 1-4: new high speed USB device using ehci_hcd and address 5
    [ 5099.584066] usb 1-4: configuration #1 chosen from 1 choice
    (I do NOT see any message about it using drivers or mounting anything at this point, which quite a few posters of similar questions have reported seeing.) lsusb tells me that it sees the USB device:

    Code:
    Bus 007 Device 003: ID 046d:0a0b Logitech, Inc.
    Bus 007 Device 002: ID 046d:c016 Logitech, Inc. M-UV69a/HP M-UV96 Optical Wheel Mouse
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 006 Device 002: ID 413c:2003 Dell Computer Corp. Keyboard
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 005: ID 04e8:507f Samsung Electronics Co., Ltd
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    solid-hardware tells me (as I understand it) that hal has seen my device, and recognised it as of type PortableMediaPlayer:

    Code:
    $ solid-hardware query "IS PortableMediaPlayer"        
    udi = '/org/freedesktop/Hal/devices/usb_device_4e8_507f_ed3fc920000000f1_if0'
    
    $ solid-hardware nonportableinfo /org/freedesktop/Hal/devices/usb_device_4e8_507f_ed3fc920000000f1_if0                               
    udi = '/org/freedesktop/Hal/devices/usb_device_4e8_507f_ed3fc920000000f1_if0'            
     camera.libgphoto2.name = 'Samsung YP-T9' (string)                         
     camera.libgphoto2.support = true (bool)                              
     info.capabilities = {'portable_audio_player'} (string list)                    
     info.category = 'portable_audio_player' (string)                         
     info.parent = '/org/freedesktop/Hal/devices/usb_device_4e8_507f_ed3fc920000000f1' (string)    
     info.product = 'YP-T9' (string)                                  
     info.subsystem = 'usb' (string)                                  
     info.udi = '/org/freedesktop/Hal/devices/usb_device_4e8_507f_ed3fc920000000f1_if0' (string)    
     info.vendor = 'Samsung' (string)                                 
     linux.hotplug_type = 2 (0x2) (int)                                
     linux.subsystem = 'usb' (string)                                 
     linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1a.7/usb1/1-4/1-4:1.0' (string)        
     portable_audio_player.access_method = 'user' (string)                       
     portable_audio_player.access_method.drivers = {'libmtp'} (string list)              
     portable_audio_player.access_method.protocols = {'mtp'} (string list)               
     portable_audio_player.libmtp.protocol = 'mtp' (string)                      
     portable_audio_player.output_formats = {'audio/mpeg', 'audio/x-ms-wma'} (string list)       
     portable_audio_player.type = 'mtp' (string)                            
     usb.bus_number = 1 (0x1) (int)                                  
     usb.can_wake_up = false (bool)                                  
     usb.configuration_value = 1 (0x1) (int)                             
     usb.device_class = 255 (0xff) (int)
     usb.device_protocol = 0 (0x0) (int)
     usb.device_revision_bcd = 256 (0x100) (int)
     usb.device_subclass = 0 (0x0) (int)
     usb.interface.class = 255 (0xff) (int)
     usb.interface.number = 0 (0x0) (int)
     usb.interface.protocol = 255 (0xff) (int)
     usb.interface.subclass = 255 (0xff) (int)
     usb.is_self_powered = true (bool)
     usb.linux.device_number = 5 (0x5) (int)
     usb.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1a.7/usb1/1-4/1-4:1.0' (string)
     usb.max_power = 100 (0x64) (int)
     usb.num_configurations = 1 (0x1) (int)
     usb.num_interfaces = 1 (0x1) (int)
     usb.num_ports = 0 (0x0) (int)
     usb.product = 'USB Vendor Specific Interface' (string)
     usb.product_id = 20607 (0x507f) (int)
     usb.serial = 'ed3fc920000000f1' (string)
     usb.speed = '480' (string)
     usb.vendor = 'Samsung Electronics Co., Ltd' (string)
     usb.vendor_id = 1256 (0x4e8) (int)
     usb.version = '2' (string)
    I set up a rule for Device Manager to do... something... when it detects a PortableMediaPlayer:

    Code:
    $ cat ~/.kde/share/apps/solid/actions/Samsung-MP3.desktop
    [Desktop Action open]
    Exec=echo "%i" > /tmp/thing
    Icon=unknown
    Name=Samsung MP3
    X-Ubuntu-Gettext-Domain=desktop_kdebase-workspace
    
    [Desktop Entry]
    Actions=open;
    Type=Service
    X-KDE-Action-Custom=true
    X-KDE-Solid-Predicate=IS PortableMediaPlayer
    ...and this seems to work, inasmuch as Device Manager now pops up when I plug in the device, and clicking on the icon it brings up does in fact write to /tmp/thing. I chose the action as something fairly foolproof, because I just wanted to test out the detection. %i is the only variable that I could find which is set to anything - it is set to the uri used by solid-hardware.

    Thanks in advance for any advice you can offer.

    My question is; now what? Is there a way I can mount the device somehow? Or otherwise make it available for access by one of the various players already on the machine?

    - rob.

    #2
    Re: Accessing an Mp3 player

    When plugged in, does it show in Devices in Dolphin? Can you access it via Dolphin?
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: Accessing an Mp3 player

      My experience is such that when it shows in the notification window, click on it and it will open in dolphin. At that point it is mounted.

      You should be able to then drag and drop files from the hard drive or other storage onto the music player. The player is of course set to "MSC - Mass Storage" or something similar? I have had issues with MTP even with MTP Tools installed.
      Kubuntu 11.10<br />KDE 4.7.3<br />Athlon XP 2000<br />512 MB RAM<br />ATI 64MB Video<br />~11 year old system still kicking :&gt

      Comment


        #4
        Re: Accessing an Mp3 player

        Originally posted by Snowhog
        When plugged in, does it show in Devices in Dolphin? Can you access it via Dolphin?
        No, when plugged in its still not visible to Dolphin.

        Originally posted by Marlin
        My experience is such that when it shows in the notification window, click on it and it will open in dolphin. At that point it is mounted.

        You should be able to then drag and drop files from the hard drive or other storage onto the music player. The player is of course set to "MSC - Mass Storage" or something similar? I have had issues with MTP even with MTP Tools installed.
        Its only started showing in the notification window since I made a separate rule for devices of type PortableMediaPlayer; I don't think its being recognised as a Mass Storage device at all, so its not being recognised by dolphin. I did try to make my custom rule for PortableMediaPlayer run dolphin, but since I don't get a file path to a device name in any variable that I can find (just the udi used by solid-hardware that I mentioned in the original post) I didn't know what to point the file browser at.

        Comment


          #5
          Re: Accessing an Mp3 player

          I had an additional thought or two: could I write a script to manually mount the device myself, and run that script from my custom Device Manager rule?

          Grabbing a path to the device from the output of solid-hardware nonportableinfo, I find it apparently at:

          /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-4/1-4:1.0

          I've tried mounting this path (read-only) as a couple of different filesystem types, but I get nothing intelligible. You can probably tell I'm a bit out of my depth at this point; is this just a totally stupid approach? Or is there something I could do that might make this pan out?

          Comment


            #6
            Re: Accessing an Mp3 player

            Have you installed kubuntu-restricted-extras? This package:
            Description: Commonly used restricted packages
            This package depends on some commonly used packages in the Kubuntu
            multiverse repository.
            .
            Installing this package will pull in support for MP3 playback and decoding,
            Java runtime environment, Flash plugin, DVD playback, and LAME (to create
            compressed audio files).
            .
            Please note that this does not install libdvdcss2, and will not let you play
            encrypted DVDs. For more information, see
            https://help.ubuntu.com/community/Re...ts/PlayingDVDs
            .
            Please also note that packages from multiverse are restricted by copyright
            or legal issues in some countries. See
            http://www.ubuntu.com/ubuntu/licensing
            for more information.
            Windows no longer obstructs my view.
            Using Kubuntu Linux since March 23, 2007.
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment


              #7
              Re: Accessing an Mp3 player

              Originally posted by Snowhog
              Have you installed kubuntu-restricted-extras?
              Yep.

              Comment


                #8
                Re: Accessing an Mp3 player

                Does your mp3 player have the ability to switch between MSC (USB Mass Storage device Class) and MTP (Media Transfer Protocol) mode? If it does, set it to MSC.
                Windows no longer obstructs my view.
                Using Kubuntu Linux since March 23, 2007.
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Re: Accessing an Mp3 player

                  my Mp3 player read's as storage.........but in synaptic doing a seartch for mtp I see

                  mtpfs
                  mtp-tools
                  libmtp8
                  and
                  qlix

                  all for mtp device acsess

                  VINNY
                  i7 4core HT 8MB L3 2.9GHz
                  16GB RAM
                  Nvidia GTX 860M 4GB RAM 1152 cuda cores

                  Comment


                    #10
                    Re: Accessing an Mp3 player

                    mtpfs
                    Description: FUSE filesystem for Media Transfer Protocol devices
                    MTPfs is a FUSE filesystem that supports reading and writing from MTP (Media
                    Transfer Protocol) devices, such as MP3 players, video players or digital
                    cameras.
                    .
                    In addition to revealing media files on the connected device, MTPfs exposes a
                    virtual directory called "/Playlists" which contains the device's playlists as
                    m3u files.
                    Which, if the mp3 player runs only in MTP mode, is likely a package you want to install, if it isn't already.
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Re: Accessing an Mp3 player

                      Thanks much guys; mtpfs is exactly what I was looking for, a way to mount the device.

                      Comment


                        #12
                        Re: Accessing an Mp3 player

                        well let us know if it works
                        as I sead mine reads as stoage but it would be nice to know I could use somthing elce to.
                        VINNY
                        i7 4core HT 8MB L3 2.9GHz
                        16GB RAM
                        Nvidia GTX 860M 4GB RAM 1152 cuda cores

                        Comment


                          #13
                          Re: Accessing an Mp3 player

                          With my Sansa e280, set to MTP mode, the Device Notifier doesn't see it when plugged in, nor is it seen in Dolphin. It does however, appear in Amarok (and works fine there). If I set it to MSC and plug it in, the Device Notifier sees and reports it, and it's seen in Dolphin. I appears in Amarok as a plugged media device (not as the Sansa e280 reported by Amarok in MTP mode), and has to be 'read' - right-click 'Read' - so that it is scanned. Once that is done, all the albums/music are shown and can be moved to the Play List and works just fine.
                          Windows no longer obstructs my view.
                          Using Kubuntu Linux since March 23, 2007.
                          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                          Comment


                            #14
                            Re: Accessing an Mp3 player

                            ya mines a PHILIPS gogear SA3020/37 but reads as USB storage so no problem adding files

                            the vid on the other hand is in .smv format ............. I did finaley find a converter that uses mencoder to do the work made by Yuri Chernyavsky cald smv_gui & smv_encode.

                            that he made a .deb for 8.04 ubuntu........I instaled it wile I was sill runing Kubuntu 9.04 and it survived the on line upgrade to 9.10 and still works just fine.

                            VINNY

                            i7 4core HT 8MB L3 2.9GHz
                            16GB RAM
                            Nvidia GTX 860M 4GB RAM 1152 cuda cores

                            Comment


                              #15
                              Re: Accessing an Mp3 player

                              Yep, works a treat.

                              Installed mtpfs and start it automatically on system boot. You could start it as part of the device manager action when it detects the device being plugged in (see below), but I found that it doesn't unmount the device properly when I unplug it, so any second or subsequent time you plugged it in the mount would already be set up, and you'd get an error. Easier just to fire it up on boot. For my own purposes I found it useful to use the following options:

                              mtpfs /mp3 -o uid=1000 -o gid=1000 -o umask=0x755

                              where the uid and gid are those of my account.

                              If you want the Device Manager to recognise the player in MTP mode when you plug it in, and give you the option to run something, you just need to create a custom device action. Unfortunately the GUI for doing this under System settings seems to break if you have only a single predicate in the rule; I just created the file myself:

                              1) Create a file with whatever name you want it to use (e.g. "MP3 Player") in the directory ~/.kde/share/apps/solid/actions.

                              2) In that file, put:
                              Code:
                              [Desktop Action open]
                              Exec=amarok
                              Icon=unknown
                              Name=Samsung MP3
                              X-Ubuntu-Gettext-Domain=desktop_kdebase-workspace
                              
                              [Desktop Entry]
                              Actions=open;
                              Type=Service
                              X-KDE-Action-Custom=true
                              X-KDE-Solid-Predicate=IS PortableMediaPlayer
                              ...replacing "amarok" with whatever app you want to run.

                              Comment

                              Working...
                              X