WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Hi thank all for your help with the script issue - I have now been able to make a set-up script for the piCoPlayer. It will build a menu, where you can choose different options.

PS. I have update the first post with a link to the new version

I will post it here so other beginners like myself can learn:

Code: [Select]
#!/bin/sh
echo  "Remember to use menu 5 (save your changes) before leaving this menu"

echo " "
echo " "
showMenu () {
echo "1) Download and update Squeezelite Player"
echo "2) Use Audio from 3.5 jack"
echo "3) Insert USB DAC and press ENTER to get a list of available ALSA device"
echo "4) Use USB DAC - on next screen give the start options you will use"
echo " "
echo "5) IMPORTANT save your changes NOW before reboot"
echo "6) Reboot - in order to use the changes you have made"
echo "7) Exit menu program"




}

 
 
 while [ 1 ]
 do
 showMenu
 read CHOICE
 case "$CHOICE" in
 
 
 "1")
 echo "Download and Update Squeezeplayer"
 wget http://squeezelite.googlecode.com/files/squeezelite-armv6hf -P /mnt/mmcblk0p2
 ;;
 
 
 
 "2")
 echo "Use analog audio from 3.5 jack"
 sed -i '/squeezelite/d' /opt/bootlocal.sh
 sudo echo mnt/mmcblk0p2/tce/squeezelite-armv6hf -n piCoPlayer -a 80:4 -m ab:cd:ef:12:34:01 >> /opt/bootlocal.sh
 ;;
 
 
 
 "3")
 echo "Insert USB DAC and pres ENTER to get a list of available ALSA device"
 sudo /mnt/mmcblk0p2/tce/squeezelite-armv6hf -l
 ;;

 
 
 
 "4")
 echo "Please write the commands you would like to use for starting Squeezelite"
 echo "Important you MUST use -a 80:4 and then add additional settings like -o front:CARD=Set,DEV=0 -n piCoPlayer -m ab:cd:ef:12:34:56"
 read START_STRING
 echo "$START_STRING - Will be used"
 while true; do
 read -p "Do you wish to use these settings? y/n" yn
 case $yn in
 [Yy]* ) sed -i '/squeezelite/d' /opt/bootlocal.sh; sudo echo mnt/mmcblk0p2/tce/squeezelite-armv6hf "$START_STRING" >> /opt/bootlocal.sh; break;;
 [Nn]* ) exit;;
 * ) echo "Please answer yes or no.";;
 esac
 done
 #break;;
 ;;
 
 
 
 
 "5")
 echo "IMPORTANT save your changes NOW before reboot"
 filetool.sh -b
 ;;
 
 
 
 
 
 "6")
 echo "Reboot"
 # here it ask for a reboot
 while true; do
 read -p "Do you wish to reboot? y/n" yn
 case $yn in
 [Yy]* ) sudo reboot; break;;
 [Nn]* ) exit;;
 * ) echo "Please answer yes or no.";;
 esac
 done
 ;;
 
 
 
 
 "7")
 exit
 ;;
 esac
 done
 


This script (picoplayer) was made like this:
sudo vi /usr/local/sbin/picoplayer

Then change the permission so it can be executed:
sudo chmod -R 755 /usr/local/sbin/picoplayer

Finally edit opt/.filetool.lst so that you add the line
usr/local/sbin/picoplayer

Then save the changes with
filetool.sh -b


Regards
Steen
« Last Edit: January 19, 2013, 11:59:29 AM by sbp »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11678
Hi sbp
Code tags make it easier for readers to copy code, I added them to your post. They also serve as visual markers
between what you are trying to say and code (or other information) you are posting. To use code tags, click
the  #  icon when you are writing your post.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Code tags make it easier for readers to copy code, I added them to your post. They also serve as visual markers between what you are trying to say and code (or other information) you are posting. To use code tags, click the  #  icon when you are writing your post.
All true with graphical browsers supporting javascript, but a different story when using text browsers and/or without javascript...
« Last Edit: January 19, 2013, 03:09:14 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11678
Hi tinypoodle
As far as I can tell, the only thing JavaScript does is highlight the text in the code box for copying. The box itself
still shows up when I turn JavaScript off.


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
True, but no # icon to click on.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Hi

Just for your info, I just update the piCorePlayer for Raspberry - I don't know if any of you are using a Squeezebox system for music? If you are then please try it now, it can be used as an inexpensive player for this system.

Steen

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Thanks to bmarcus and his new kernel (3.6.11) I have updated the piCorePlayer:

Hi All piCorePlayer users.

I have just updated to piCoPlayer version 07.

Now the wifi and USB is much better for me - so I hope it will good for you too.
Version 07:
1. Kernel upgraded to 3.6.11 which has fixed many USB problems.
2. Tuned the USB sound by adding "options snd-usb-audio nrpacks=1" to the /etc/modprobe.conf file.
3. Added an Empty " /etc/asound.conf" file. You can now tweak the ALSA profile using this file.
EDIT REMOVED THIS AGAIN 4. Added dwc_otg.speed=1 to the cmdline.txt file (to get rid of some USB problems)
5. Overclocked to 800(otherwise I couldn't use USB-wifi and USB-DAC at the same time)
6. Reduced size to 25 MB


You can get it from here:

You can get it from here:
http://rapidshare.com/files/27225515...Player_V07.img
http://rapidshare.com/files/40140835...eplayerV07.txt

Steen
« Last Edit: April 09, 2013, 02:56:21 PM by sbp »

Offline bricolodu13

  • Newbie
  • *
  • Posts: 18
Squeezelite on piCore with SSH
« Reply #22 on: May 06, 2013, 05:38:38 AM »
Hello,

I tried before to attempt to make my own version of Squeezelte on TinyCore to make one for i386

It is running however i have problems with Dropbear as each time i make a reboot it losses the tc password ???

I have to first changed the tc password and then  I can connect through ssh

other thing it generates new rsa-ssh keys each time

i did the following :


1) install Dropbear
2) added these three lines to opt/filetool.lst
etc/passwd
etc/shadow
etc/dropbear
3) added in bootlocal.sh
 /usr/local/etc/init.d/dropbear start     
3) cd /optI
4) passwd
5) backup:
filetool.sh -b
6) reboot.

What is wrong ?

Offline courtjester

  • Newbie
  • *
  • Posts: 6
Just for your information...I played with picoreplayer today. I upgraded the kernel to 3.8.11 and added support for my wireless USB dongle, an RT5370 based adapter. The RT5370 needed a  module (crc-ccitt.ko) not included in the standard picoreplayer image and the firmware file (rt2870.bin). I was hoping that 3.8.11 might address the problems with running a USB wifi adapter and a USB sound card. However, the problem still remains. Using a wifi adapter and a USB sound card results in garbled sound. Using either WIFI with the built in sound, or wire ethernet with the USB sound results in crystal clear audio.

Doug.

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Hi, thanks for your Info on the 3.8.11 kernel. Sorry to hear that the USB issues still are not solved.

Did you try to increase the alsa buffer to something like 200?

Just out of interest how did you manage to update the kernel? I'm still trying to learn.

Offline courtjester

  • Newbie
  • *
  • Posts: 6
Hi Steen,

From your "How to use a newer kernel?" thread it appears you were able to successfully compile the kernel for tc so I won't go into details about that. Where you are stuck is how to handle the modules. Just a bit of background, modules are drivers that can be loaded at runtime rather than being built into the the kernel image. Modules for tinycore can be found in two places, either in the initramfs (also called initrd) or in tc extensions. In your case the initramfs file is piCore3611a.gz. Examples of extensions containing modules are alsa-modules-3.6.11-piCore.tcz and wireless-3.6.11-piCore.tcz. Modules contained in initramfs are usually those that are required for the kernel to boot and provide basic functions such filesystem, mouse and keyboard. Modules found in the extensions are usually those used for specific environments.

It looks like you were able to compile the modules. Those are the files with the .ko extension. The next step is to extract piCore3611a.gz and replace the module files in piCore3611a.gz with the modules from your compile kernel. Here is what I did.

1. Grab a copy of  piCore3611a.gz and place it in a working folder
2. In the working folder, execute the following commands (I am assuming your new initramfs is called piCore3611m.ga)

mkdir piCore3611m
cd piCore3611m
zcat ../piCore3611a.gz | sudo cpio -i -H newc -d

Now you will have the extracted piCore3611a. The modules will be found in lib/modules/3.6.11-piCore. You can see which ones are include by executing
find . -name '*ko'. You will need to replace those files with the modules from your compiled kernel. In fact, all the files in lib/modules need to come from you newly compiled kernel. The folder name in lib/modules/ needs to match the version number of your new kernel. In my case it was 3.8.11-piCore.

Once you have replace the appropriate files, you then need to create a new initramfs. You do this with the following set of commands:
From the folder containing your extracted files execute the following:

sudo find | sudo cpio -o -H newc | gzip -2 > ../piCore3611m.gz
cd ..
advdef -z4 piCore3611m.gz

You new initramfs will be called piCore3611m.gz. You need to get the size of this file in hex but that is needed for cmdline.txt. You can get it with the following command

printf '0x%x\n' $(stat -c%s piCore3611m.gz )

Copy piCore3811m.gz to your USB image, and edit cmdline.txt replacing the second hex number in initrd=0xa00000,0x3c02a7 with the number obtained above. Also edit config.txt and change kernel= and ramfsfile= as appropriate.

Note that the actual kernel image is found in arch/arm/boot and is called Image. You can rename Image to whatever you want but make sure you edit the entry in config.txt appropriately.

That should get you enough to be able to boot your new kernel. You will still need to address replacing the modules in the extensions. I'll cover that in another post if you still help.

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Hi courtjester

Thank you very much for your very detailed instruction, it helped me a lot in better understanding what needs to be done.

It looks like you were able to compile the modules. Those are the files with the .ko extension. The next step is to extract piCore3611a.gz and replace the module files in piCore3611a.gz with the modules from your compile kernel. Here is what I did.

I wanted to try the new fiq_split version that gsh have been working on. It was release a day ago, and should have improved the USB issue a lot. After compiling it shows up as 3.8.12+

In short I fetched the files from github like this:
mkdir linux-rpi-fig.split
cd linux-rpi-fig.split
git init
git fetch git://github.com/raspberry/linux.git fiq_split:refs/remotes/origin/fiq_split
git checkout fiq_split

This seemed to work, it fetched all the files and they were OK on my Debian Cross compile computer

Next I did
make mrproper

Then I copied the .config file from the running tinycore 3.6.11 to linux-rpi-fig.split

Then I did:
make ARCH=arm -j 3

And the I responded to the questions the best I could (new options etc) and then it started compiling

And I found the arch/arm/boot/Image and renamed it to kernel3611a.img (so that I did not need to change anything in the config.txt fil)


NEXT the modules:


1. Grab a copy of  piCore3611a.gz and place it in a working folder
2. In the working folder, execute the following commands (I am assuming your new initramfs is called piCore3611m.ga)

mkdir piCore3611m
cd piCore3611m
zcat ../piCore3611a.gz | sudo cpio -i -H newc -d

Now you will have the extracted piCore3611a. The modules will be found in lib/modules/3.6.11-piCore. You can see which ones are include by executing
find . -name '*ko'. You will need to replace those files with the modules from your compiled kernel. In fact, all the files in lib/modules need to come from you newly compiled kernel. The folder name in lib/modules/ needs to match the version number of your new kernel. In my case it was 3.8.11-piCore.

Once you have replace the appropriate files, you then need to create a new initramfs. You do this with the following set of commands:
From the folder containing your extracted files execute the following:

sudo find | sudo cpio -o -H newc | gzip -2 > ../piCore3611m.gz
cd ..
advdef -z4 piCore3611m.gz

You new initramfs will be called piCore3611m.gz. You need to get the size of this file in hex but that is needed for cmdline.txt. You can get it with the following command

printf '0x%x\n' $(stat -c%s piCore3611m.gz )

Copy piCore3811m.gz to your USB image, and edit cmdline.txt replacing the second hex number in initrd=0xa00000,0x3c02a7 with the number obtained above. Also edit config.txt and change kernel= and ramfsfile= as appropriate.

Thanks I build the modules and found then in root/modules/lib/modules. Here was a directory called 3.8.12+-picore with a subdirectory called kernel which contained the following directories
-arch
-crypto
-drivers
-fs
-lib
-net
-sound
And the ko files were present in these directories.

So I untarred the old picore3611a and deleted the directory lib/modules/3.6.11-piCore and placed the 3.8.12+-piCore here instead. Then:
sudo find | sudo cpio -o -H newc | gzip -2 > ../piCore3611m.gz
cd ..
advdef -z4 piCore3611m.gz

And copied this to the SD-card

I also copied new bootcode.bin, fixup.dat, fixup_cd.dat, fixup_x.dat, start.elf, start_cd.elf and start_x.elf to the card. Obtained from here: https://github.com/raspberrypi/firmware/tree/fiq_split/boot

I changed the size of the new piCore3611m.gz in the config.txt file

BUT when I boot on the new card it results in kernel panic:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block (1,0)
unwind_backtrace+0x0/0xf0) from [>c0525d38>9 mount_block_root+0x21c/0x280)
and 4 more lines
and then:
PANIC VFS: Unable to mount root fs on unknown block (1,0)

Entering kdb (current=0xcd82ac80, pid 1) due to Keyboard Entry
Kdb>

So do you see where I do something wrong?

Steen
« Last Edit: May 10, 2013, 10:53:01 AM by sbp »

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Hi courtjester, tinypoodle, Rich and bmarcus - I want to thank you all for your help and kind teaching a beginner how to build a new kernel for picore.

Finally I managed to build a new kernel which could boot. The last piece was how to make the modules - which courtjester described in a way, so that I could manage it.

The prolem described above with the kernel panic, was because I put in the size of the picore.gz in hex, the wrong place. I had put it in the config.txt file:

ramfsaddr= which is wrong, I should ave put it in the cmdline.txt (as also written by courtjester).

So in short. I now can boot with kernel 3.8.12+

But there seems to be some problems with ALSA - which I need to figure out.

Thank you for your patience and help

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Sorry I still need some help.

The two TCE's: ALSA and Wifi which contain a specific 3.6.11 part will not install on my newly build kernel (I now know that it is because the uname is 3.8.12-picore+ whereas it should be 3.6.11-picore).

Therefore I extracted the alsa-modules-3.6.11-piCore.tcz;
In this extracted tcz I renamed \lib\modules\3.6.11-piCore\     to \lib\modules\3.8.12-piCore+\

Then I updated all the files in the original \lib\modules\3.6.11-piCore\kernel\sound\   with the same files from the newly build modules from the 3.8.12 version.

Then I repacked the alsa-modules-3.6.11-piCore.tcz as alsa-modules-3.8.12-piCore+.tcz

I did the same to the

But it does not work - after a reboot this error occurs:
amixer: Mixer attach default error: No such file or directory
/opt/bootlocal.sh line 5: usr/local/bin/wifi.sh; not found
[00:00:17.868869] test_open: 159 playback open error; No such device
[00:00:17.869556] output_init: 1359 unable to open output device

However the Dropbear is working fine. So my kernel seems OK, it is now just a matter of fixing the ALSA and Wireless, so that they allow using a newer kernel.

Any advice?

Steen

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Doublecheck on matching cases (upper/lower).
Also, never ever substitute slashes by backwards slashes.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)