WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Update: PicorePlayerV10 = Squeezelite on piCore with SSH, WiFi and set-up script  (Read 97711 times)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Hi I have updated the piCorePlayer.

PiCorePlayer is a dedicated player for the Squeezebox audio system on a raspberry pi board.

Just updated to piCorePlayer version 1.07 - Noevember 10 2013

It is updated to piCorePlayer1.0 - which now allows high resolution streaming through the HDMI connction
Look here: https://sites.google.com/site/picoreplayer/home/news


I have updated piCorePlayer to version 09:
You can get it from here:
https://sites.google.com/site/picoreplayer/home/download

 

I have updated piCorePlayer to version 07:
You can get it from here:
http://rapidshare.com/files/2968815248/piCorePlayer_V07.img
http://rapidshare.com/files/521953170/Changelog%20and%20readme%20PicoreplayerV07.txt


I have just uploaded piCorePlayer version 06 and you can get it here: http://rapidshare.com/files/56046039...eplayerV06.txt
http://rapidshare.com/files/12868434...Player_V06.img

On the basis of your feed-back I have included the "audio group" and added user "tc" to this group.
Please test it as - for me personally I have not had any problems before. But on the other hand the addition of the "audio" group has no negative consequences either- so please test it and see if it is working for you now.

PLEASE NOTE - the password has been changed: So user is tc , Password is . nosoup4u

Other changes:
CHANGELOG:
....................................
Version 06
1. Changed password, so it is the same as SqueezePlug. User=TC, Password=nosoup4u
2. Improved script (the restart of the player was not always functional)
3. Improved script - the first line was missing sometimes.
4. Added the "audio group" and user "tc" to group "audio".


Please report back

Steen

piCoPlayer is a dedicated player (like a Duet receiver) build on a small read-only linux (Microcore) and Triodes excellent Squeezelite player.
It is now even smaller than the first version (26 MB in total). There is no writing to the SD-card and therefore no risk of corruption of your card - just pull the power if you need to. After booting everything is sitting in RAM.

Out of the box, the analog audio via the 3.5" jack is working.

If you want to use a USB DAC, you will need to supply the correct squeezelite commands - for this you can use the setup menu.

The setup-script can be used in two different ways:
1. Connect via SSH (use putty from another computer on the same LAN (user=tc, password=nosoup4you)). At the command promt write; picoplayer which will start the setup-script.
2. If you have a keyboard and screen connected to your raspberry. At the command promt write: picoplayer which will start the setup-script.


The WiFi is supposed to work - I have not tested it, but I have seen a few reports that it is working on the piCore linux which is used for building this player. Please test it and report your findings.

Also suggestions in improving the set-up script is welcome.

The piCoPlayer image can be downloaded here:
http://rapidshare.com/files/2536786570/piCoPlayer_v2.img

Regards
STeen



Changes from version 1:

1. WiFi included (needs further testing)
2. Even smaller now (26 MB)
3. Is optimized for both 256 and 512 MB Raspberry boards
4. SSH access via Dropbear. User = tc Password = nosoup4you
5. Analog and USB sound is tested and is working
6. Included is a set-up menu that makes it easy to:
a. Download and update Squeezelite
b. Auto setup for analog audio from 3.5 jack
c. Detect and show the available USB devices
d. Option to easily change the squeezelite options (output, name MAC address etc)
e. Save these changes so they survive a reboot on the "read-only" microcore structure
f. Reboot to start using the changes.
...............................................................



ORIGINAL MESSAGE

Dear bmarcus.

With your help I have been able to make a small robust squeezebox player based on picore and the small squeeze lite player developed by Triode from the squeezebox community.

I have seen others asking about using squeezelite on the tinycore or microcore system in the forum here, therefore I decided to write a How-to:

It is running headless now I only needed a monitor and keyboard during installation. I did not install xorg or any other GUI programs but did everything using CLI.
So here you go:

Burn the Picore image to a CF card ( I use Win32Diskimager)

Then boot the Raspberry.

As Picore is running in read only mode om a partition called mmcblk0p1 you need to make another partition where it can have all the configuration files and the extensions and the Squeezelite player.
In order to make such a partition I did this (It was here I had the most difficulties) Each line is the commands I used:

fdisk /dev/mmcblk0
n new
p primary
2 partition number 1-4
6 first cylinder
+20M I made a 20 MB partition for this - you could choose any size you want (up to the CF-card size)
t change partition Id
83 linux file system
w to write the changes to the card

sudo reboot


Next I formated it to the ext4 format:
mkfs.ext4 /dev/mmcblk0p2

sudo reboot


Then you need to define where Picore will find your extensions, you do that by this command:
tce-setdrive

And then you choose 2= /mnt/mmcblk0p2


Download Squeezelite and put in a writeable place like mnt/mmcblk0p2, you can so that by this command

wget http://squeezelite.googlecode.com/fi...zelite-armv6hf -P /mnt/mmcblk0p2


Then I had some problems that squeezelite would not start - it turned out that I had to allow it to be executed - using this command
chmod 755 /mnt/mmcblk0p2/squeezelite-armv6hf


You need to install Alsa, flac libmad and libvorbis. You do that by using the package manager in Picore called tce. Therefor at command promt write:
tce
s search
a (a in order to search for Alsa) then Enter
select alsa.tcz (at present no 4) enter
q quit
i install


s search
f (f in order to find flac.tcz (present no 9)) Enter
9 enter
q quit
i install

s search
l (l in order to find libmad.tcz (presently no 57)) Enter
57 enter
q quit
i install

s search
l (l in order to find libvorbis.tcz (presently no 88))
88 enter
q quit
i install

sudo reboot


Then in order to automatically to start Squeezelite everytime the Raspberry reboot, you need to add this program to the bootlocal file which is used for this purpose.
As I have been doing this without GUI the only editor present is the vi editor, which also gave me a hard time. But these are the command you have to use:

sudo vi /opt/bootlocal.sh
Then pres i (for insert)
then move the cursor to the first empty line and write:
sudo /mnt/mmcblk0p2/squeezelite-armv6hf -a 80:4

Press "esc" in order to get out of "insert mode"
Then type
:wq and Enter - in order to save and exit vi


These changes is not actually written to the bootlocal.sh file (as it is in read only mode) but instead the changes is saved another place and during reboot used - so in order to get Picore to save these changes and use them the next time you reboot you have to do a manual backup.

So at command promt type
filetool.sh -b

And now you can reboot and your Raspberry should start Squeezelite. I have tried different Alsa buffer sizes and I think that 80:4 is fine - for me the Squeezelite is in perfect sync with both a Duet and A Logitech radio, if I use to high values like 500:4 or 200:4 the sync is not as perfect. Using 50:4 resulted in some stuttering in the sound


Now you have a dedicated very small Squeezelite player, which boots very rapidly, it doesn't use swap and can survive that you just pull the power plug - so it is almost as an embedded hardware player, like a Duet.

I call it the PicoPlayer

I hope this recipe can be used - please ask if there are any questions

Steen


EDIT 1:
In the next days I will try to enable SSH access, so that we can manage and update this player without the need for a keyboard and monitor.
« Last Edit: November 10, 2013, 09:49:46 AM by sbp »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picoplayer = Squeezelite on picore
« Reply #1 on: January 10, 2013, 11:10:27 AM »
Steen,

thanks a lot for sharing it!

Bela
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Picoplayer = Squeezelite on picore
« Reply #2 on: January 10, 2013, 04:34:03 PM »
Hi bmarkus.

Sorry, but I'm back for some more help.

I installed Dropbear.
I made a password for tc like this:
passwd 


Then I added these three lines to opt/.filetool.lst
etc/passwd
etc/shadow
etc/dropbear

next I used backup:
filetool.sh -b

Then reboot.

Now I start dropbear by:
sudo /usr/local/etc/init.d/dropbear start     and everything is fine I can connect via Putty by user: tc and password: (the one I supplied).

BUT my problem is how do I get dropbear to automatically start after a reboot.
I tried to add sudo /usr/local/etc/init.d/dropbear start to /opt/bootlocal.sh
And then do a backup - but somehow this does not start dropbear after a reboot?

Thanks
Steen

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11678
Re: Picoplayer = Squeezelite on picore
« Reply #3 on: January 10, 2013, 04:47:43 PM »
Hi sbp
You don't need to specify  sudo  in  bootlocal.sh  since it runs as root anyway. Your syntax looks correct. Double
check your  bootlocal.sh  to check it matches exactly.

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Picoplayer = Squeezelite on picore
« Reply #4 on: January 10, 2013, 05:14:23 PM »
Thank you

This was driving me nuts, but I had a small error in my bootlocal.sh file

So everything is sorted

Thanks

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11678
Re: Picoplayer = Squeezelite on picore
« Reply #5 on: January 10, 2013, 05:19:09 PM »
Hi sbp
You are welcome. Let me guess, an extra space character in the path?

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Picoplayer = Squeezelite on picore
« Reply #6 on: January 12, 2013, 08:25:35 AM »
Hi
Now I have it running very well with the squeezelite and dropbear. So if I want to share it I can make a img using a program like diskimager for windows. It is working - but as I have it running on a 4 GB CF-card the image is also 4 GB, even-though microcore and the extensions I have installed is not more that max 50 MB in size the rest is empty and a waste of space..

So I have two questions

1. Is there a solution to make a working image that only consists of the important parts and cuts out the empty part (it isn't even put in a partition).

2. When I look into piCore.img from the repro I can see it consists of the following files arm128_start.elf
arm192_start.elf
arm224_start.elf
arm240_start.elf.

I suppose they have something to do with the memmory setting in the raspberry. As the player I'm working on don't need any graphical interfase, I should probably be able to use the minimal amount of mem for the graphic part. Does that mean that I could delete some of these ??_start.elf files to save space?

Steen   

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picoplayer = Squeezelite on picore
« Reply #7 on: January 12, 2013, 11:27:01 AM »
Steen,

2) These files related to split up of the RAM to system/video. Better to keep them intact and change only config.txt if necessary.

1) Regarding image, create a small second ext4 partion which is big enough to keep your extensions and have same free space for additional extension later and for backap file, mydata.gz Then save it with dd specifying sectors with count=nnn option part of the first two partions.

Files making piCore-X fits to free space of the boot partion. mmcblk0p1, they are in a cde directory. Content of cde is similar to tce and system installs files from cde at boot time, if cd option used in command line (cmdline.txt). You can do the same, put your preinstalled extensions to a cde in either the boot partion or on the second.

If no second partions, like in case of piCore-X, new image is created with

Quote
dd if=/dev/mmcblk0 of=newimage.img bs=1M count=40

Please check piCore-X.
« Last Edit: January 12, 2013, 11:30:08 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Picoplayer = Squeezelite on picore
« Reply #8 on: January 12, 2013, 02:03:10 PM »
Hi bmarkus

First thank you for your continued help.

My fdisk -  results in this:

Disk /dev/mmcblk0: 7822 MB, 7822376960 bytes
247 heads, 62 sectors/track, 997 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1               1           5       38254   c Win95 FAT32 (LBA)
/dev/mmcblk0p2               6          10       38285  83 Linux

What I would like to is to use dd to save dev/mmcblk0p1 and mmcblk0p2 in a new image.

So as the whole system is less than 90 MB, I used this command:
root@box:/# dd if=/dev/mmcblk0 of=/mnt/sda1/newimage.img bs=1M count=90

And it seems to work.

I just need to confirm that the image can be burned and boot.
Thanks

Steen







Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Picoplayer = Squeezelite on picore
« Reply #9 on: January 13, 2013, 12:14:36 AM »
So as the whole system is less than 90 MB, I used this command:
root@box:/# dd if=/dev/mmcblk0 of=/mnt/sda1/newimage.img bs=1M count=90

And it seems to work.

I just need to confirm that the image can be burned and boot.
It may seem to work, but I'd consider such a procedure most untrustable, have you run a thorough fsck on the dd'ed image?
dd is agnostic towards filesystems and files and metadata and should never be used to resize or truncate a filesystem.
You could possibly resize your filesystem either before or after invoking dd.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picoplayer = Squeezelite on picore
« Reply #10 on: January 13, 2013, 01:36:29 AM »
So as the whole system is less than 90 MB, I used this command:
root@box:/# dd if=/dev/mmcblk0 of=/mnt/sda1/newimage.img bs=1M count=90

And it seems to work.

I just need to confirm that the image can be burned and boot.
It may seem to work, but I'd consider such a procedure most untrustable, have you run a thorough fsck on the dd'ed image?
dd is agnostic towards filesystems and files and metadata and should never be used to resize or truncate a filesystem.
You could possibly resize your filesystem either before or after invoking dd.

Untrustable? Not at all. There are no resizing and no truncate of file system. It is a correct solution. There are two partitions, all sectors are saved plus few of the unpartitioned area for safety (can be reduced but doesn't harm).
« Last Edit: January 13, 2013, 01:39:01 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Picoplayer = Squeezelite on picore
« Reply #11 on: January 13, 2013, 02:10:48 AM »
Oops!
Seeing fdisk showing "Disk /dev/mmcblk0: 7822 MB" and each partition 38000+ blocks I had somehow assumed the disk was partitioned into 2 equal slices of close to 4GB...
The potential existence of unpartitioned space hadn't even crossed my mind.
In that case I think the "count" parameter is not really necessary.
« Last Edit: January 13, 2013, 02:12:27 AM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picoplayer = Squeezelite on picore
« Reply #12 on: January 13, 2013, 02:39:42 AM »
We are not saving partititios but raw disk sectors. Without count= whole 4G would be saved.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Picoplayer = Squeezelite on picore
« Reply #13 on: January 13, 2013, 02:54:18 AM »
Once more my bad...
Looking at the details again, I think I finally got it now :P
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Picoplayer = Squeezelite on picore
« Reply #14 on: January 13, 2013, 07:58:20 AM »
Hi

It is working really good. I managed to make an image of this piCoPlayer which is only 33 MB in size including microcore, and dropbear.
I have announced on the raspberry forum, and made a link to Tiny Core Linux webpages, so hopefully there will be increased interest for your very good small linux system.

To connect via Putty: user=tc  Password=nosoup4you

See here http://www.raspberrypi.org/phpBB3/viewtopic.php?f=35&t=29539

Thanks for all you help.

I will try to see if I can get WiFi working also in this player - so I have just ordered a WiFi dongle.

Steen
« Last Edit: January 13, 2013, 08:41:25 AM by sbp »