Simple guide to making the Samsung YP-P2 player usable in Linux as a UMS device.
This simple guide will show you how to make your Samsung YP-P2 MP3 player with video playback work as a UMS (USB Mass Storage) device in Linux (and other operating systems). This will also let you make use of the Ogg Vorbis support the device offers which can be tricky or downright impossible if you stick to using the MTP (Media Transfer Protocol) support that is all it offers out of the box.
Shopping for a Linux usable music player with Ogg Vorbis support
I went shopping the other day for a portable music player. I only had two requirements. The device had to be able to play Ogg Vorbis files since I have all my CD's ripped to this format. And I wanted to be able to transfer music to the device from Linux since that's the only operating system I use.
I needed the device rather quickly, so instead of ordering something online I wanted to purchase something from a brick-and-mortar store right away. I knew the iPod would not work, so despite a lot of sales people trying to push that device I turned them down. I finally found a store with a sales person who was willing to do a little research for me on the players they sold and he reached the conclusion that the Samsung YP-P2 4GB player should work for me, and even offered to give me my money back if it did not. So I bought the player and took it home.
MTP and Ogg troubles
After I brought the player home I connected it to my Linux box and it was instantly detected as a USB device and device name, manufacturer and the like was shown by the kernel in dmesg and lsusb. I was pleased, things were looking good so far.
My joy didn't last long. I soon discovered that the player was not usable as a USB disk, which made it rather difficult to transfer files to it. After a little online searching I found that the YP-P2 used a protocol known as MTP
(Media Transfer Protocol), protocol invented by Microsoft for transfering media files (an extension to the PTP protocol).Limited MTP support in linux is available via the libmtp library, but the version I had available in Slackware Linux (0.3.3) did not support this particular device, so I was a bit stuck. I really needed this device to function as a USB/MSC Mass Storage device class unit.
I borrowed a Windows XP laptop to see if the device would at least play Ogg
Vorbis files if they were transfered to it from a Windows maching. If they
were, then I could perhaps get something going with
Wine and some Windows
software (I'd rather not, but it might be my only option).
It turned out that I could transfer MP3 files to the player just fine, but
trying to transfer Ogg files gave me error messages saying the format was
not unsupported. At this point I was feeling rather disappointed with my
purchase.
I decided to search the internet for information on the player and see what
experiences other people had had with it. It turned out that he device was
being sold with UMS support in the US and EU, but in Korea the exact same
player was sold with UMS support and people were playing Ogg files on it
after having transfered them via UMS.
This was good news. At least the hardware was capable of doing what I needed
it to do, I was being limited by software only.
Some people reported success in installing the Korean version of the
firmware on the device and in that way enabling UMS support and also
reported that the firmware could be changed back and upgraded later on and
the UMS support would "stick". This sounded promising so I decided
to give it a try.
New firmware, a missing config file and UMS support
Most reports I could find on how to change the firmware on the YP P2 focused on the fact that the Korean version was UMS and they also reported that you needed an old version of the firmware (like version 1.11 or there about) in order to do it, since newer firmware packages lacked a config.dat file which needed to be changed. I didn't really want to first downgrade my firmware and at the same time make it speak Korean (I'd be lost if it got stuck in Korean mode) and although the config.dat file was no longer present in newer firmware packages I though I'd just try and create a file similar to the one found in older firmware packages, add it in and see what happened.
So, what I ended up doing was to download an old firmware package I found online, extracted it (it's just a ZIP archive), modify the config.dat file that was in the ZIP file so it stated that it was a EU player that should support UMS mode. Then I downloaded the latest firmware from Samsung (at this time that is version 4.13), extracted the ZIP file, copied my modified config.dat and the other two firmware files (YPP2.rom and YPP2.RSC) to the players Internal Storage directory (this is the documented way by Samsung to update the firmware) via MTP on the Windows box. Then I unplugged the device and turned it on. It showed a few messages about the firmware being updated and then powered down again.
Here is what the config.dat file I used looks like. It contains just two lines, both using only uppercase letters, at the end of the first line is a Windows CR-LF sequence, the second line is not thus terminated. The file is 16 bytes in size :
YP-P2 EU EU UMS
When I plugged the player back into the USB port of my borrowed Windows
Laptop it no longer showed up as a "P2 device" but instead it
showed up as a regular USB disk - promising. I found that I could browse all
the same folders on the device in this manner that I had previously had
access to via MTP, so things were looking good.
To test if it would now play Ogg files (and still play MP3 for that matter)
I copied a few Ogg and MP3 files to it and unplugged the device after it
said it was done transfering data.
Linux and Ogg
Success, the player played both my Ogg Vorbis files as well as my test MPEG3 files. There were absolutely no problems and sound quality was excellent. I was happy as a clam. Now all I needed was to see whether or not it would work in Linux.
Plugging the player into my Linux box resulted in the best possible result I
could have hoped for. A new disk device (/dev/sdb in my case) was instantly
detected and when I mounted it I could access all the same directories as
had been visible from Windows.
I tried copying a few more Ogg files to it with cp and then
unmounted it. Everything worked. The player showed my new files in its
library, had indexed them by artist, album, title and so on and they played
perfectly.
Final words
The Samsung YP-P2 music player (adverticed as MP3 player) is a sleek device.
The touch screen is very easy to operate. The sound quality is excellent.
The screen is a little small for video playback, but it's really crisp and
fluent which makes up for the small size a bit.
With a little work, very little once you know how, it works perfectly with Linux
and open formats, such as Ogg Vorbis. I can only wonder why Samsung chose to
sell it only with MTP support in US and EU, but at least they left the UMS
capabilities of the device intact for us to enable (thanks).
Now that UMS and Ogg works for me I'm very happy with this player and I can
recommend it to other Linux users out there (as long as a firmware update
and custom written config.dat doesn't scare you).
Just so you can compare the details of your player with those of mine before
you decide whether to attempt this or not, here is the exact model found on
the back of my player:
YP-P2JAB/XEE 4GB
There are no partitions on the UMS/MSC device the player exports, you simply
mount the device itself. In my case I simply mount it like this:
# mount /dev/sdb /mnt/memory
copy my files and umount it like this:
umount /mnt/memory
and everything just works.
I take absolutely no responsability for what happens to your device if you follow these instructions. I'm merely telling you what I did and how it worked for me. If you turn your player into a brick, void your warrenty or something equaly unpleasant, then that's your problem, not mine. In short - if it breaks you get to keep the pieces.