Go to advanced search

by subatomicglue
Mon Feb 03, 2020 5:27 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

I'm moving a little slow, but I developed this nice command to copy modules over to an initramfs root directory that I can package up later: find /lib/modules/$(uname -r)/kernel | egrep -i "(dwc2|usb_f_midi|usb_f_ecm|libcomposite|snd-rawmidi|snd-seq-device|u_ether|udc_core).ko" | sudo cpio -pmdv /us...
by subatomicglue
Mon Feb 03, 2020 3:08 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

What is your kernel version maybe I can make one and test it out? This is me: $ uname -r 4.19.97+ And I have one of these directories: /lib/modules/4.19.97+/kernel and dmesg confirms it: [ 0.000000] Linux version 4.19.97+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g84606...
by subatomicglue
Sun Feb 02, 2020 10:53 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

DarkElvenAngel said This seems like a bug in the initramfs-tools the article about initramfs should be helpful in making your own initramfs without using initramfs-tools. This might be the best way to sort out this issue. The article's instructions dont work out of the box, at least not with Buster...
by subatomicglue
Sun Feb 02, 2020 5:35 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

tqhien: I got the same (bad) result using balena etcher. Just the rainbow screen, and nothing else. At this point, I'm thinking either my image is corrupt, or my hardware is different than your somehow. I had to add # setup for adafruit HDMI 800x480 touchscreen hdmi_force_hotplug=1 # force a specif...
by subatomicglue
Fri Jan 31, 2020 5:38 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Regarding initrd/initramfs, and getting lsmod and modprobe to work, I tried this, this morning. (typing into the hdmi display with my tiny keyboard .... is slow and tedious): ``` (initramfs) depmod -a depmod: can't change directory to 'lib/modules/4.19.75-v71+': No such file or directory # so this d...
by subatomicglue
Thu Jan 30, 2020 7:48 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Thanks for the verify, I'll try etcher then.
Must be something wrong with how I am using "dd" to burn the image...
Maybe my calculation works for official buster, but is off for other sizes...
by subatomicglue
Mon Jan 27, 2020 3:34 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

ah, I do not have a serial cable I did try [email protected].168.200.2 with USB cable on the left hand USB port on the pizero... I tried with a USB ethernet dongle as well... It was strange that the HDMI display only showed a rainbow... never went to text I'll try burning with etcher or without the calculatio...
by subatomicglue
Mon Jan 27, 2020 5:40 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Allright I added break=init to the /boot/cmdline.txt, and using my HDMI display, I can see it drop into the (initramfs) command prompt, right after my script ran. If I type lsmod nothing is listed... (initramfs) lsmod Module Size Used by Not tainted (initramfs) If I type modprobe dwc2; modprobe libc...
by subatomicglue
Mon Jan 27, 2020 4:45 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Thanks, reading about the rescue shell now
https://wiki.debian.org/InitramfsDebug
by subatomicglue
Mon Jan 27, 2020 3:56 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

I added a sleep 5 in the script before it creates the /sys/kernel/config/usb_gadget/ directory... I'd have expected 5 seconds to be plenty to have those load... but same error as before mkdir -p /sys/kernel/config/usb_gadget/ mkdir: can't create directory '/sys/kernel/config/usb_gadget/': No such fi...
by subatomicglue
Mon Jan 27, 2020 3:53 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

I added in lsmod | grep dwc2 lsmod | grep libcomposite modprobe dwc2 modprobe libcomposite lsmod | grep dwc2 lsmod | grep libcomposite In both the init-top and in the init-bottom for init top, I see only dwc2 and libcomposite loaded for init-bottom, I see dwc2, libcomposite, usb_f_midi, usb_f_ecm, u...
by subatomicglue
Mon Jan 27, 2020 3:42 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

I already modprobe in this script

Code: Select all

modprobe dwc2 # if not already loaded in /etc/modules
modprobe libcomposite
Are you thinking it may need some time between the calls to modprobe, and the mkdir?
by subatomicglue
Mon Jan 27, 2020 3:22 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

I added a few diagnostics to the script, and I can confirm that /sys/kernel/config/ does exist. while /sys/kernel/config/usb_gadget/ does not. Nor can it be created (using mkdir) mkdir -p /sys/kernel/config/usb_gadget/ mkdir: can't create directory '/sys/kernel/config/usb_gadget/': No such file or d...
by subatomicglue
Mon Jan 27, 2020 3:12 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Thanks for the init script source, that helps. From that, I think init-bottom runs dead last. Regardless init-premount seems to happen after the sys stuff... I tried my script there, and still the same errors starting with: mkdir -p /sys/kernel/config/usb_gadget/ mkdir: can't create directory '/sys/...
by subatomicglue
Mon Jan 27, 2020 2:29 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

I have been using the lsinitramfs command, so I know what is inside the image...

I also know the /dev and /sys directories are virtual and aren't included... Which is why I'm trying to mount them....
by subatomicglue
Mon Jan 27, 2020 2:28 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

This is the "runme" script I'm running from initramfs $ cat /etc/initramfs-tools/scripts/init-premount/runme #!/bin/sh # Example usb gadget boot script PREREQ="" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac echo /sbin/mdev > /proc/sys/kernel/hotplug # Mount the /proc and /...
by subatomicglue
Mon Jan 27, 2020 1:29 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Ok, since neither the built images from tqhien nor my own buildroot was working for me, I worked more on the initrd approach from before. So I added a script, /etc/initramfs-tools/scripts/init-premount/runme, intended to initialize the USB gadget and midi stuff... and then I noticed that dmesg doesn...
by subatomicglue
Mon Jan 27, 2020 1:21 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Not just my build from buildroot, but also the 2 builds that tqhien built...
I'd like to get those 2 working first - since they should just work... (tested by tqhien)...

(for my build, I followed: https://www.blaess.fr/christophe/articl ... buildroot/)
by subatomicglue
Sun Jan 26, 2020 7:48 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Zipped file image is 47Mo and only 512Mo minimum SD Card is required : boot partition is 34Mo, rootfs is 255Mo (with plenty of space in it...) and it is available here : https://drive.google.com/open?id=1LFPRR ... FM0xSXSiio root password is rpi and there's an autologin for user rpi / password rpi ...
by subatomicglue
Thu Jan 23, 2020 5:34 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

I like the idea of simply moving MIDI (and my daemon) up in the init list (or getting an optimization with initrd to accomplish that). If "time to midi" could happen in <10 seconds with this method, I wouldn't mind if the rest of default raspbian kept initializing after that... That said. you're pro...
by subatomicglue
Wed Jan 22, 2020 7:57 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Somewhat related, found this PDF about optimizing boot times... Nice summary. Light on implementation details. But interesting to read through

https://www.nxp.com/files-static/traini ... UXBOOT.pdf
by subatomicglue
Wed Jan 22, 2020 7:56 pm
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

So, I built a custom Buildroot system for a RpiZero for you, to demonstrate how fast it is. Wow, thanks! I'll take a look. If I'm reading that correctly, it's an image to burn (Not seeing scripts or instructions to build that). I'd love to learn how to generate it. Is that quick to learn? Got any p...
by subatomicglue
Tue Jan 21, 2020 5:18 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

Once the module is loaded into the kernel it stays loaded even after the initramfs is freed from memory. I hope that answers your question, the work isn't gone it's just finished. That’s reassuring. Sounds like I need to execute my midi service inside the initrd section (between start and free), th...
by subatomicglue
Tue Jan 21, 2020 3:22 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

All the initrd is doing is loading the modules the kernel needs and then once it's done it hands off to the main os. I don't think your getting the performance increase because you need to do more than just load the modules. Looking at your code it looks as though the midi part could be run seperat...
by subatomicglue
Mon Jan 20, 2020 1:00 am
Forum: Advanced users
Topic: Help me Fast Boot my pi-Zero MIDI "USB Gadget"
Replies: 62
Views: 4352

Re: Help me Fast Boot my pi-Zero MIDI "USB Gadget"

[ 0.312651] Trying to unpack rootfs image as initramfs... [ 1.451233] Freeing initrd memory: 8776K This is really interesting... If it's freed, I take that to mean we are not benefitting from it... Questions this evokes: - Wouldn't we want this to remain in memory? - Do I need to init my service in...

Go to advanced search