adafruit / pi_video_looper

Application to turn your Raspberry Pi into a dedicated looping video playback device, good for art installations, information displays, or just playing cat videos all day.
GNU General Public License v2.0
451 stars 239 forks source link

Issue with copy mode not copying all files from USB drive #144

Closed Lunal-Tic closed 2 years ago

Lunal-Tic commented 2 years ago

Ran this issue past the folks over on the Adafruit forum but appear to have hit a wall so thought I'd post here. Please let me know if is any additional information required. I am new to this so it is likely I've omitted things.

I'm running a Rpi 3B+, Samsung EVO 64GB sdcard, and Video Looper v2.5 from https://videolooper.de/ The files are being copied from a 32GB USB drive with 233 video files (24.9GB). The system is planned to display 12 hours a day however the Rpi will not be turned off only the monitor will be shutdown by timer.

The idea was to use copy mode to get videos to the SD card since I've got the room there. However it will only copy 6 videos of 200+ to the SD card and then goes into a boot/copy loop after showing the status bar partially completing the 6th video. If I stop the process and run the system without the USB drive it will loop the videos it copied.

Here is the way I have it set:

# Note that you still need to change the directory by modifying the setting in
# the [directory] section below.  The default is usb_drive.
#file_reader = usb_drive
#file_reader = directory
file_reader = usb_drive_copymode

and

# Directory file reader configuration follows.
[directory]

# The path to search for movies when using the directory file reader.
path = /home/pi/video

I am unsure if there are other settings that I missed or if I should change the setting to file_reader = directory once the USB files are copied. Also I tried both with and without a password setting for the USB.

Additionally I've used different USB drives, different SD cards, and different numbers of video files to copy. When I only had 10 video files it would copy 3. The system will run fine if the videos are on the USB drive. I've fresh installed video looper each time I tried a new variable which is why I'm pretty sure it's working OK when it runs from a USB drive with an unmodified video_looper.ini file. (only let it run for about 10 videos)

Two questions:

  1. Is there some way to copy as many videos as is there is space on the SD card?
  2. Should I even be using the SD card to play the videos? I've seen a thread that claims some issue doing that.

TIA -LT

tofuSCHNITZEL commented 2 years ago

Hi, thanks for sharing this issue.. To be honest I have never tested the copymode with that many videos or this big of a total size...

I will try to create a similar test scenario with lots of files and some gigabytes of files... can you please share the supervisor log output as described in the readme?

thanks

Lunal-Tic commented 2 years ago

Thank you for the quick reply. I've over written the SD card with a stock version of looper so I will have to recreate it from my end as well. I'll take a look at the readme and post the supervisor log once I'm able to get it back to that state.

I'm in Tokyo so apologies for any delay in replying due to time zones.

Cheers, -LT

Lunal-Tic commented 2 years ago

I am unable to find information about the supervisor log in the 3 readme files on the SD. (videolooper_README.txt, dietpi-README.md, and overlays\README)

The videolooper_README.txt has only this information:


__   _(_) __| | ___  ___ | | ___   ___  _ __   ___ _ __        __| | ___ 
\ \ / / |/ _` |/ _ \/ _ \| |/ _ \ / _ \| '_ \ / _ \ '__|      / _` |/ _ \
 \ V /| | (_| |  __/ (_) | | (_) | (_) | |_) |  __/ |     _  | (_| |  __/
  \_/ |_|\__,_|\___|\___/|_|\___/ \___/| .__/ \___|_|    (_)  \__,_|\___|
                                       |_|                               

Christian Sievers 2015-2022

www.videolooper.de

v2.5 (using pi_video_looper v1.0.10)
tofuSCHNITZEL commented 2 years ago

its here in the readme of the repository:

if enabled (via config file) log output can be found in /var/log/supervisor/ You can use e.g. tail -f /var/log/supervisor/* to view the logs

please post the full error log here - not just the tail.

maybe you need to install it by hand and not use the ready built image.

Lunal-Tic commented 2 years ago

I am afraid you lost me here. I do not understand "install it by hand" and I cannot find "supervisor" when searching in the 3 README files, config.txt file, or video_looper.ini. If you could provide a bit more context or information I will try to get things setup as needed to provide the data requested. As mentioned this is new to me so I lack experience and knowledge. I am using Notepad++ for editing, reading, and searching these files. If there is something better please let me know.

tofuSCHNITZEL commented 2 years ago

Follow the readme from this repository (https://github.com/adafruit/pi_video_looper) and install it on a regular legacy RPI OS Lite. or try to enable console output in the ini of your installation then SSH to the rpi and check the supervisor folder mentioned above.

foocp commented 2 years ago

You could follow the instructions in the original Adafruit tutorial: tutorial to install it manually (i.e. first install a fresh Raspberry OS, then the looper script).

A quicker way could be to SSH into your running looper system. The videolooper.de site (which is this script here on Github but packaged) gives some instructions to do that. Not sure if you can enable the supervisor log on that system, though.

Lunal-Tic commented 2 years ago

Thank you both for the info and suggestions. I'll read up on things and get back as I am able.

Lunal-Tic commented 2 years ago

It appears I might have proved that different installations are in fact different. Following the manual install method in the link provided above, without the hello_video player, I was able to get the copy mode to function correctly. It copied 231 video files (corrected from 233 above) from the USB drive to the SD and has been playing them back for the last 20 minutes. For reference the video files vary in size from ~7MB - 800MB I don't know if it would help but I could upload 10+ of the video files I'm using for testing purposes. I'm afraid I don't have online storage large enough for the entire 231.

Just to verify I took a second 64GB SD card and reinstalled Video Looper v2.5 from https://videolooper.de/ Then made the changes to video_looper.ini as mentioned above. The result was exactly the same as my initial issue. 6 files of 231 copied and then would kick out to reboot. If I pulled the USB during this time, before the system started to copy files, it would show the countdown screen and how many videos were available before playing. It appears that the issue is specifically with the Video Looper v2.5 installation (using pi_video_looper v1.0.10 as stated above). Would it be possible to see if we could get this particular installation working properly?

Additionally I was never able to find or figure out how to get the supervisor log. It is mentioned at the bottom of the Installation section here but doesn't say how to get it activated. I did find something about dtdebug here but I'm not sure that's what you are referring to.

christiansievers commented 2 years ago

It's entirely possible that the fault is with the image I provide on videolooper.de. Instead of Raspberry OS Lite I'm using DietPi, which treats the pi user's home folder differently. So copy_mode probably doesn't work as expected there. Thank you for this feedback, and I'm sorry for the hassle. I'll look into this.

tofuSCHNITZEL commented 2 years ago

Just something that came to my mind. Maybe your image @christiansievers does not expand the partition to the whole sd card and after copying some of the videos the drive is just full. If I remember it correctly from the time I tried your image out, the partition is only around 1gb big

tofuSCHNITZEL commented 2 years ago

@Lunal-Tic please ssh to your videolooper.de install and share the output of the command lsblk or if it does not work use df -h

christiansievers commented 2 years ago

@tofuSCHNITZEL That sounds like a good explanation. I'll check.

Lunal-Tic commented 2 years ago

Again many thanks for all the info. I'm afraid my ignorance is showing again however since I'm unsure how to SSH into the Rpi from my Windows machine. I'll be researching how to do that directly. Please bear with my noob-ness.

Cheers, -LT

tofuSCHNITZEL commented 2 years ago

if your windows install is new it might have ssh installed already. just try ssh pi@raspberrypi in the commandline - or download putty. make sure your pi player is connected with an ethernetcable to you network (not your pc directly)

Lunal-Tic commented 2 years ago

OK I'll have a look. Yes the Rpi is hardwired to the network. IIRC the wifi part is disabled in this install. I think that was in the config.txt maybe. I'll go swap out the v2.5 SD card and see what I can see. Using an older Windows install as my main but do have a laptop with Win10 on it if needed.

tofuSCHNITZEL commented 2 years ago

okay then just use putty - not sure if windows will display you the partition correctly but yes maybe you will see there that it does not fill the whole sd card. but to expand it you will need to ssh to pi while the sd is in there.

Lunal-Tic commented 2 years ago

Got putty, connected to the Rpi but don't know the default login info. Suggestions?

tofuSCHNITZEL commented 2 years ago

its all documented here: https://videolooper.de/ "video"

Lunal-Tic commented 2 years ago

Thank you. I was using the wrong password "videopi". Here's the info:

pi@raspberrypi:~ $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT mmcblk0 179:0 0 59.5G 0 disk ├─mmcblk0p1 179:1 0 256M 0 part /boot └─mmcblk0p2 179:2 0 1.6G 0 part /

pi@raspberrypi:~ $ df -h Filesystem Size Used Avail Use% Mounted on /dev/root 1.6G 1.6G 0 100% / devtmpfs 404M 0 404M 0% /dev tmpfs 436M 0 436M 0% /dev/shm tmpfs 436M 5.8M 431M 2% /run tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 436M 0 436M 0% /sys/fs/cgroup tmpfs 1.0G 8.0K 1.0G 1% /tmp tmpfs 50M 20K 50M 1% /var/log /dev/mmcblk0p1 253M 52M 201M 21% /boot

christiansievers commented 2 years ago

so it's really this:

Just something that came to my mind. Maybe your image @christiansievers does not expand the partition to the whole sd card and after copying some of the videos the drive is just full. If I remember it correctly from the time I tried your image out, the partition is only around 1gb big

tofuSCHNITZEL commented 2 years ago

yes indeed, so I remembered correctly. expanding it later should work via dietpi-config right? @Lunal-Tic please call sudo dietpi-config via ssh and look in the menu there if you can find an "expand filesystem" or similar and then run lsblk again and check if the size of "mmcblk0p2" is more than 1,6GB @christiansievers: you you think you can include autoexpansion on first boot into you image?

christiansievers commented 2 years ago

sounds like a plan!

Lunal-Tic commented 2 years ago

Under Advanced Options Swap file or APT cache/info storage? pi menu 1

tofuSCHNITZEL commented 2 years ago

in the original raspi-config its under „Advanced Options -> Expand Filesystem“

Lunal-Tic commented 2 years ago

Is there a way to get to the original raspi-config if it's using DietPi? This is what I've got under Advanced options.

pi menu 2

christiansievers commented 2 years ago

DietPi is really different and sometimes hard to wrap your head around. I'm really sorry but I can't fire up my own copy here right now. I'll report back when I can. In the meantime I'm glad we found the mistake.

Lunal-Tic commented 2 years ago

No worries on my end. Just let me know if there's something else I can do or info you need.

tofuSCHNITZEL commented 2 years ago

@christiansievers thanks for your efforts! @Lunal-Tic: no the "original" tool does not exist on dietpi, and it seems the option is missing - so the only way is the manual way: I found this thread: https://dietpi.com/phpbb/viewtopic.php?t=298 but please be careful otherwise you would need to flash the image again. maybe I have some time later to fire up a testinstall and provide you with the commands... but if I would need to "blindly" guess now I would run:

sudo parted /dev/mmcblk0 -s resizepart 2 100%
sudo resize2fs /dev/mmcblk0p2
Lunal-Tic commented 2 years ago

Yeah, that DietPi thread is ugly. It's from 2016 and one of the first links referenced is 404. It also looks like they're using ext4 rather than FAT32 or exFAT. FWIW my SD is FAT32.

If I'm reading it right there are 3 separate runs to accomplish the goal. I'm thinking I might ought to wait on trying this until one of you has a closer look at it. I don't mind screwing up but I'm not certain I could explain the mess I'd make so as to be of use for you to analyze. Apologies.

christiansievers commented 2 years ago

thanks for finding that, I'll look into it. Right now I'll leave a note that copymode doesn't work reliably on the image provided because of lack of free space. And to install it manually on Raspberry OS if you need it ¯_(ツ)

Lunal-Tic commented 2 years ago

As a follow-up as mentioned in the OP I've seen some comments about running this off the SD rather than USB drive not being ideal. Are there any substantial cons to running off the SD fully vs video files on a USB drive? Does one wear out faster, run hotter, etc?

tofuSCHNITZEL commented 2 years ago

never had any issue with it so far.

Lunal-Tic commented 2 years ago

Thanks. Since the plan is to run it 24/7 and I'm not using active cooling I was curious if there were issues.

tofuSCHNITZEL commented 2 years ago

should not be a problem

christiansievers commented 2 years ago

I just uploaded a newer version of the image file. This fixes this problem by automatically expanding the file system if necessary. As a bonus it's now using v1.0.11.

tofuSCHNITZEL commented 2 years ago

Great, thanks @christiansievers!

Lunal-Tic commented 2 years ago

I just uploaded a newer version of the image file. This fixes this problem by automatically expanding the file system if necessary. As a bonus it's now using v1.0.11.

Fantastic! Many, many thanks. Off to pluck a couple SD cards. :)

christiansievers commented 2 years ago

@Lunal-Tic Let me know how it goes, and which version of Raspberry you're using. Thanks @tofuSCHNITZEL for the fix - it was really the unexpanded filesystem.

Lunal-Tic commented 2 years ago

@christiansievers Absolutely will do. I'm running a Rpi 3B+ that was able to find recently that has the wi-fi/bluetooth built-in and I'm using the 64GB SD card in it. (they've been really hard to find over here in Tokyo, the Pi not the SD)

However I also have an older 3B+ that does not have wi-fi/bluetooth built-in (don't know what version that would be) however that one is running an 8GB SD and old Buffalo "silicon drive" for the content. It's been running well so I'm tempted to leave it alone. If you'd like me to run some tests on it I think I've got a large spare SD around here somewhere.

Lunal-Tic commented 2 years ago

Here's the update. v. 2.6 was installed and setup for USB copy mode on Samsung 64GB SD. 254 MP4 files (26.7GB) were copied from a Sandisk 64GB USB drive in about 40 minutes. System was rebooted without the USB and it has been running the videos for the last 15 minutes.

Odd thing is that during the copy, boot and first video playback I was getting low voltage warnings. Never remember seeing that previously on the exact same hardware setup using the Legacy version of Raspberry Pi OS Lite install as recommended above.