Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Senior Member
    Join Date
    Jul 2008
    Posts
    106

    Alpine Linux on Dell M300

    I first saw the Dell / Kace M300 appliance mentioned in this thread and thought it was a cool little device at a great price on ebay ($14 shipped!). They are older armel based SBC's inside, circa 2011 but they do have 1Gbps ethernet and a SATA port.

    Alpine doesn't have an armel port but they do have the scripts and framework built into their aports system for porting Alpine to different architectures, so I've been messing around with that on and off for the last couple of months. I now have a working base load and enough extra packages built that I was able to run squeezelite on it last night. Next up is LMS. I already have Perl built, it only took about 4 hours to compile natively on the M300. (!)

    Picked up an Apple USB-C DAC dongle for $8 on Amazon (because of this write-up and comments, and the price) and used that for the squeezelite testing, connected with a USB-C to USB-A adapter. Working and sounds pretty good though I can hear occasional pops and clicks which has me a little concerned. I don't hear them when using the dongle in my laptop.

    You can fit a 2.5" drive straight into the onboard sata connector but I elected to buy an extension cable and configured a two m.2 ssd software raid 1.

    It's been fun and a little bit challenging. I'll let you know when I've got LMS up and running.
    Attached Images Attached Images  
    Last edited by sodface; 2020-02-25 at 20:29.

  2. #2
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,387
    Quote Originally Posted by sodface View Post
    Alpine doesn't have an armel port but they do have the scripts and framework built into their aports system for porting Alpine to different architectures, so I've been messing around with that on and off for the last couple of months. I now have a working base load and enough extra packages built that I was able to run squeezelite on it last night. Next up is LMS. I already have Perl built, it only took about 4 hours to compile natively on the M300. (!)
    Would you be willing to share a tarball of your Alpine armel root filesystem? I have several armel based systems that I'd like to use with Alpine linux.

    Quote Originally Posted by sodface View Post
    Picked up an Apple USB-C DAC dongle for $8 on Amazon (because of this write-up and comments, and the price) and used that for the squeezelite testing, connected with a USB-C to USB-A adapter. Working and sounds pretty good though I can hear occasional pops and clicks which has me a little concerned. I don't hear them when using the dongle in my laptop.
    Make sure your squeezelite process has permissions to raise the thread priority, or just run it as root.

    Try adding -a 120 to the squeezelite command line. If you still experience the pops/clicks then try -a 16384:4096
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  3. #3
    Senior Member
    Join Date
    Jul 2008
    Posts
    106
    Quote Originally Posted by ralphy View Post
    Would you be willing to share a tarball of your Alpine armel root filesystem? I have several armel based systems that I'd like to use with Alpine linux.
    You bet. I'll follow up later today with some links.


    Make sure your squeezelite process has permissions to raise the thread priority, or just run it as root.

    Try adding -a 120 to the squeezelite command line. If you still experience the pops/clicks then try -a 16384:4096

    Will test and report back, thanks!

  4. #4
    Senior Member
    Join Date
    Jul 2008
    Posts
    106
    @ralphy, here's a link to download the basic root filesystem:

    [Link Removed]

    Let me know when you have it and I'm going to take the link down. I was going to post all this stuff up and put a repo online etc. but I wasn't quite ready to go just yet. A few notes on the tar ball:

    - root password is alpine
    - the fstab is setup for my m300, a small partition for /boot on /dev/sda1 and / on /dev/sda2
    - I was having the script create a 1GB swapfile but I disabled that for this download and commented it out in the fstab creation
    - I didn't add any kernel modules
    - no kernel or initramfs

    Here's the list of packages in the download:

    Code:
    chroot:/home/sodface/aports/scripts# ./m300_genrootfs.sh 
    (1/39) Installing musl (1.1.24-r0)
    (2/39) Installing busybox (1.31.1-r8)
    (3/39) Installing alpine-baselayout (3.2.0-r3)
    (4/39) Installing openrc (0.42.1-r0)
    (5/39) Installing alpine-conf (3.8.3-r4)
    (6/39) Installing libcrypto1.1 (1.1.1d-r3)
    (7/39) Installing libssl1.1 (1.1.1d-r3)
    (8/39) Installing ca-certificates-cacert (20191127-r0)
    (9/39) Installing libtls-standalone (2.9.1-r0)
    (10/39) Installing ssl_client (1.31.1-r8)
    (11/39) Installing zlib (1.2.11-r3)
    (12/39) Installing apk-tools (2.10.4-r5)
    (13/39) Installing busybox-suid (1.31.1-r8)
    (14/39) Installing busybox-initscripts (3.2-r2)
    (15/39) Installing scanelf (1.2.4-r0)
    (16/39) Installing musl-utils (1.1.24-r0)
    (17/39) Installing libc-utils (0.7.2-r0)
    (18/39) Installing alpine-keys (2.1-r2)
    (19/39) Installing alpine-base (3.11.2-r0)
    (20/39) Installing libblkid (2.34-r1)
    (21/39) Installing libcom_err (1.45.4-r0)
    (22/39) Installing e2fsprogs-libs (1.45.4-r0)
    (23/39) Installing libuuid (2.34-r1)
    (24/39) Installing e2fsprogs (1.45.4-r0)
    (25/39) Installing jitterentropy-rngd (1.1.0-r0)
    (26/39) Installing jitterentropy-rngd-openrc (1.1.0-r0)
    (27/39) Installing mdadm (4.1-r1)
    (28/39) Installing openssh-keygen (8.1_p1-r0)
    (29/39) Installing ncurses-terminfo-base (6.1_p20191130-r0)
    (30/39) Installing ncurses-terminfo (6.1_p20191130-r0)
    (31/39) Installing ncurses-libs (6.1_p20191130-r0)
    (32/39) Installing libedit (20191211.3.1-r0)
    (33/39) Installing openssh-client (8.1_p1-r0)
    (34/39) Installing openssh-sftp-server (8.1_p1-r0)
    (35/39) Installing openssh-server-common (8.1_p1-r0)
    (36/39) Installing openssh-server (8.1_p1-r0)
    (37/39) Installing openssh (8.1_p1-r0)
    (38/39) Installing openssl (1.1.1d-r3)
    (39/39) Installing sudo (1.8.29-r0)
    OK: 23 MiB in 39 packages
    I don't know if this is of any use to you in this form, maybe for initial testing? I've got 400+ packages built so far but like I said I'm sort of still in the process of organizing the stuff and prepping the website. I've also put myself in a silly spot because I cross compiled a bunch of packages on my laptop with one public/private key pair and compiled a bunch more packages natively on the m300 with a different public/private key pair. I think I've figured out a way to re-sign all the packages to be under one key but I haven't done it yet. Still need to test it some more.

    In the meantime, let me know if there's something specific you need.

    Also, I tried the squeezelite settings you posted and the -a 120 didn't seem to help (or hurt) but the -a 16384:4096 made it way worse, basically unlistenable.
    Last edited by sodface; 2020-02-27 at 15:37.

  5. #5
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,387
    Quote Originally Posted by sodface View Post
    Let me know when you have it and I'm going to take the link down.
    Thank you. I've grabbed the file.

    Quote Originally Posted by sodface View Post
    I was going to post all this stuff up and put a repo online etc. but I wasn't quite ready to go just yet.
    Guess I jumped the gun! Something to look forward to.

    Quote Originally Posted by sodface View Post
    I didn't add any kernel modules
    no kernel or initramfs
    That's no problem. Kernels tend to be device specific and I already have a couple kernels for the devices I want to try.

    Quote Originally Posted by sodface View Post
    in the meantime, let me know if there's something specific you need.
    Thanks.

    Quote Originally Posted by sodface View Post
    Also, I tried the squeezelite settings you posted and the -a 120 didn't seem to help (or hurt) but the -a 16384:4096 made it way worse, basically unlistenable.
    Try turning mmap off -a 120:::0 and if still no difference try increasing 120 to 200, 300 and 400 just to see if you can get clean audio with -a. Beyond 200ms is really much higher than should be needed. Could be a specific decoder issue as well, try several different audio formats if possible.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  6. #6
    Senior Member
    Join Date
    Jul 2008
    Posts
    106
    Quote Originally Posted by ralphy View Post
    Try turning mmap off -a 120:::0 and if still no difference try increasing 120 to 200, 300 and 400 just to see if you can get clean audio with -a. Beyond 200ms is really much higher than should be needed. Could be a specific decoder issue as well, try several different audio formats if possible.
    Will continue to test. I was originally only planning on using this as an LMS / file server but it would be a nice bonus to have working audio out too.

    I've learned a lot working on this. One thing that almost made me give up was issues I had with Alpine's apk package manager. It took me a while to get to the point where I had a bootable base system and then the one application that I wanted to work correctly, the package manager, didn't.

    If you are interested, you can read about it here:
    https://lists.alpinelinux.org/~alpine/apk-tools

    Subject is "APK Package Name Issue on armel port". The developers were great and commited some patches to fix the problem (fixes included in the tar ball you got.) It was down to unaligned memory access, which after I knew what I was looking for I was able to read up about but I wouldn't have figured it out without the Alpine dev diagnosing it.

    I haven't quite figure out why yet, but, Alpine on the pi zero w defaults /proc/cpu/alignment to 2 (fixup) and I don't even think unaligned access is an issue on that architecture (not sure) but on the armel port I'm working on it was defaulting to 0 (ignore) which basically caused all the weird stuff with the package manager. I'm setting alignment=2 now as a kernel boot param, even though they fixed it in apk's code, just in case there are other apps that might cause problems.

    I tried to convince the guys over at the doozan forum where they were working on this device (I used the .dts and kernel config there as a starting point) that it was a potential problem on their Debian loads but I don't think I was able to get my point across. Not even 100% sure I'm right but I think I am.

    See starting here and on:
    https://forum.doozan.com/read.php?2,...6059#msg-96059

    Anyway, just food for thought and if you have any opinions on anything I'd like to hear them!

  7. #7
    Senior Member
    Join Date
    Jul 2008
    Posts
    106
    Quote Originally Posted by ralphy View Post
    Try turning mmap off -a 120:::0
    Quick testing indicates this may have fixed it! In fact, just :::0 seems to fix it also. Thanks ralphy.

    //edit, spoke too soon, just tried a flac and had to add back in the 120, so, 120:::0 as you originally suggested seems necessary.
    Last edited by sodface; 2020-02-28 at 05:02.

  8. #8
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,387
    Quote Originally Posted by sodface
    Quick testing indicates this may have fixed it! In fact, just :::0 seems to fix it also. Thanks ralphy.

    //edit, spoke too soon, just tried a flac and had to add back in the 120, so, 120:::0 as you originally suggested seems necessary.
    That's great!

    I have alpine linux running on a dockstar using bodhi's 5.5.1 kirkwood kernel and the latest u-boot.

    Code:
    U-Boot 2017.07-tld-1 (Oct 24 2017 - 22:32:36 -0700)
    Seagate FreeAgent DockStar
    gcc (Debian 6.3.0-18) 6.3.0 20170516
    GNU ld (GNU Binutils for Debian) 2.28
    Hit any key to stop autoboot:  0 
    starting USB...
    USB0:   USB EHCI 1.00
    scanning bus 0 for devices... 3 USB Device(s) found
           scanning usb for storage devices... 
    Use USB retry period from the environment: 15 second(s)
    1 Storage Device(s) found
    
    Partition Map for USB device 0  --   Partition Type: DOS
    
    Part	Start Sector	Num Sectors	UUID		Type
      1	2048      	6291456   	c140d5b1-01	83
      2	6293504   	1533952   	c140d5b1-02	82
    
    loading envs from usb 0 ...
    99 bytes read in 999 ms (0 Bytes/s)
    importing envs ...
    running scan_disk ...
    Scan device usb
    device usb 0:1
    1 bytes read in 814 ms (0 Bytes/s)
    Found bootable drive on usb 0
    loading uImage ...
    5202928 bytes read in 1096 ms (4.5 MiB/s)
    loading uInitrd ...
    7661797 bytes read in 1253 ms (5.8 MiB/s)
    loading DTB /boot/dts/kirkwood-dockstar.dtb ...
    10058 bytes read in 1046 ms (8.8 KiB/s)
    ## Booting kernel from Legacy Image at 00800000 ...
       Image Name:   Linux-5.5.1-kirkwood-tld-1
       Created:      2020-02-27  20:50:42 UTC
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    5202864 Bytes = 5 MiB
       Load Address: 00008000
       Entry Point:  00008000
       Verifying Checksum ... OK
    ## Loading init Ramdisk from Legacy Image at 01100000 ...
       Image Name:   initramfs-5.5.1-kirkwood-tld-1
       Created:      2020-02-27  20:50:43 UTC
       Image Type:   ARM Linux RAMDisk Image (gzip compressed)
       Data Size:    7661733 Bytes = 7.3 MiB
       Load Address: 00000000
       Entry Point:  00000000
       Verifying Checksum ... OK
    ## Flattened Device Tree blob at 01c00000
       Booting using the fdt blob at 0x1c00000
    
    Starting kernel ...
    
    $ ssh -l root dockstar
    Welcome to Alpine!
    
    The Alpine Wiki contains a large amount of how-to guides and general
    information about administrating Alpine systems.
    See <http://wiki.alpinelinux.org/>.
    
    You can setup the system with the command: setup-alpine
    
    You may change this message by editing /etc/motd.
    
    dockstar:~#
    Had to modify the rootfs to allow remote root ssh login as I don't have the serial console cable connected.

    I put boot and root on sda1 as that's how I already had u-boot configured and I set alignment=2.

    Code:
    dockstar:~# cat /proc/cmdline 
    console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) alignment=2
    
    dockstar:~# cat /proc/cpu/alignment 
    User:           0
    System:         0 (0x0)
    Skipped:        0
    Half:           0
    Word:           0
    DWord:          0
    Multi:          0
    User faults:    2 (fixup)
    A linux system using 7MB of memory, nice! Well, 17 really, but 10 is cache. Makes the 114MB available in the dockstar seem excessive.

    Code:
    dockstar:~# free
                  total        used        free      shared  buff/cache   available
    Mem:         114272       16848       87536         140        9888       97932
    Swap:        766972           0      766972
    Could you provide squeezelite and prerequisites packages? That will give me something usefull to test with until the repo is ready.
    Last edited by ralphy; 2020-02-28 at 08:36.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  9. #9
    Senior Member
    Join Date
    Jul 2008
    Posts
    106
    Quote Originally Posted by ralphy View Post
    I have alpine linux running on a dockstar
    Awesome.

    Quote Originally Posted by ralphy View Post
    Could you provide squeezelite and prerequisites packages? That will give me something usefull to test with until the repo is ready.
    I think I have a partial repo ready, and by partial I just mean everything I have built but not everything that's in the normal Alpine repos. It took me a bit to figure out a script to re-sign a lot of packages so they are all under one key without having to recompile them. I think I have it sorted.

    Add the repo:
    Code:
    m300-01:~$ cat /etc/apk/repositories 
    http://www.sodface.com/repo
    My public key is available here:
    http://www.sodface.com/repo/sodface-pub-key.tar.gz

    Extract to /etc/apk/keys/
    Code:
    m300-01:~$ sudo tar xzvf sodface-pub-key.tar.gz -C /etc/apk/keys/
    sod@sodface.com-5e51d361.rsa.pub
    Run apk update:
    Code:
    m300-01:~$ sudo apk update
    fetch http://www.sodface.com/repo/armel/APKINDEX.tar.gz
    main  [http://www.sodface.com/repo]
    OK: 501 distinct packages available
    Install squeezelite:
    Code:
    m300-01:~$ sudo apk add squeezelite
    (1/14) Installing rsync-openrc (3.1.3-r2)
    (2/14) Installing libgcc (9.2.0-r3)
    (3/14) Installing libogg (1.3.4-r0)
    (4/14) Installing libstdc++ (9.2.0-r3)
    (5/14) Installing flac (1.3.3-r0)
    (6/14) Installing alsa-lib (1.2.2-r0)
    (7/14) Installing faad2-libs (2.9.1-r0)
    (8/14) Installing faad2 (2.9.1-r0)
    (9/14) Installing mpg123-libs (1.25.13-r0)
    (10/14) Installing mpg123 (1.25.13-r0)
    (11/14) Installing libvorbis (1.3.6-r2)
    (12/14) Installing libmad (0.15.1b-r9)
    (13/14) Installing squeezelite (1.9.6.1210-r0)
    Executing squeezelite-1.9.6.1210-r0.pre-install
    (14/14) Installing squeezelite-openrc (1.9.6.1210-r0)
    OK: 30 MiB in 57 packages
    I know you know all this ralphy but just in case someone else is following the thread and just to show that I tested it at least once! Please let me know how it works for you.

  10. #10
    Senior Member
    Join Date
    Jul 2008
    Posts
    106
    Here's a tarball for a script to create a root file system from the repo:

    http://www.sodface.com/repo/armel-rootfs-x86_64.tar.gz

    It consists of the following:

    Code:
    .
    ├── apk-tools-2.10.4
    │   └── apk
    ├── armel_genrootfs.sh
    ├── busybox-links.txt
    └── keys
        └── sod@sodface.com-5e51d361.rsa.pub
    I tested this on my Fedora x86_64 laptop, the included apk is Alpine's static binary for x86_64. And by tested, I just mean that it creates the archive, I haven't booted anything from the resulting image yet. Tar does complain about something at the end but I think it's safe to ignore.

    Take a look at armel_genrootfs.sh and tweak as needed! I think you need to run it as root, not via sudo.

    //edit, I should add that if you use the script, the root password is now blank and sshd will allow root login with no password. So tighten things up accordingly after installation.
    Last edited by sodface; 2020-02-29 at 10:41.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •