{"action":"created","issue":{"url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID/issues/477","repository_url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID","labels_url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID/issues/477/labels{/name}","comments_url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID/issues/477/comments","events_url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID/issues/477/events","html_url":"https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/477","id":407667733,"node_id":"MDU6SXNzdWU0MDc2Njc3MzM=","number":477,"title":"Speedup phoniebox code","user":{"login":"laclaro","id":6398487,"node_id":"MDQ6VXNlcjYzOTg0ODc=","avatar_url":"https://avatars3.githubusercontent.com/u/6398487?v=4","gravatar_id":"","url":"https://api.github.com/users/laclaro","html_url":"https://github.com/laclaro","followers_url":"https://api.github.com/users/laclaro/followers","following_url":"https://api.github.com/users/laclaro/following{/other_user}","gists_url":"https://api.github.com/users/laclaro/gists{/gist_id}","starred_url":"https://api.github.com/users/laclaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laclaro/subscriptions","organizations_url":"https://api.github.com/users/laclaro/orgs","repos_url":"https://api.github.com/users/laclaro/repos","events_url":"https://api.github.com/users/laclaro/events{/privacy}","received_events_url":"https://api.github.com/users/laclaro/received_events","type":"User","site_admin":false},"labels":[{"id":530673580,"node_id":"MDU6TGFiZWw1MzA2NzM1ODA=","url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":530673581,"node_id":"MDU6TGFiZWw1MzA2NzM1ODE=","url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-02-07T12:05:48Z","updated_at":"2019-02-14T18:24:37Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nfirst of all: this is a great project! I don't like mopidy, because of it's bulkiness, therefore I stick to the slim MPD-version. However, on my raspberry pi nano the handling of rfid-triggering and playout is very slow (annoying lag, making it not suitable to children) and also on rpi3 I notice a lag.\r\n\r\nTherefore I dug a bit in the codes of `rfid_trigger.sh` and `playout_controls.sh`.\r\n\r\nI think we should think about the approach used in the scripts. I identified some things that decrease the speed until playout considerably.\r\n\r\n1. there are VERY many SD-card accesses. This is maybe the main issue. Maybe change the approach to read the config once, keep it in memory and only update if something changed (e.g. by python-handling).\r\n2. some tasks are not necessary for EVERY run (maybe only once, such as the initialization checks \"if directory/file exists\"). Commenting increases speed!\r\n3. Large case-statements to handle everything in one single script. Maybe introduce another command-line option to avoid having to check all cases or directly call different scripts from within python.\r\n4. strange and very complicated implementation of second-swipe-functionality (because of earlier use of vlc?).\r\n5. Cool \"resume\"-feature decreases speed on rpi nano by a lot!\r\n\r\nI tinkered a bit with the code to find this out. Is there the possibility to have a bash script run as daemon, such that all the script files are kept in memory already? Otherwise it would be clever to read all settings from python to avoid excessive I/O on swipe.\r\n\r\nBest,\r\n\r\nHenning"},"comment":{"url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID/issues/comments/463736087","html_url":"https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/477#issuecomment-463736087","issue_url":"https://api.github.com/repos/MiczFlor/RPi-Jukebox-RFID/issues/477","id":463736087,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2MzczNjA4Nw==","user":{"login":"laclaro","id":6398487,"node_id":"MDQ6VXNlcjYzOTg0ODc=","avatar_url":"https://avatars3.githubusercontent.com/u/6398487?v=4","gravatar_id":"","url":"https://api.github.com/users/laclaro","html_url":"https://github.com/laclaro","followers_url":"https://api.github.com/users/laclaro/followers","following_url":"https://api.github.com/users/laclaro/following{/other_user}","gists_url":"https://api.github.com/users/laclaro/gists{/gist_id}","starred_url":"https://api.github.com/users/laclaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laclaro/subscriptions","organizations_url":"https://api.github.com/users/laclaro/orgs","repos_url":"https://api.github.com/users/laclaro/repos","events_url":"https://api.github.com/users/laclaro/events{/privacy}","received_events_url":"https://api.github.com/users/laclaro/received_events","type":"User","site_admin":false},"created_at":"2019-02-14T18:24:37Z","updated_at":"2019-02-14T18:24:37Z","author_association":"NONE","body":"Hi,\r\n\r\nthank's for taking this serious ;) \r\n\r\nFirst of all: I did not test with the spotify-version, since I don't like mopidy too much (I found it to slow for the pi, but only tried it with a large music database).\r\nSecond: I think there is no reason to assume that it does not work, since the protocol mopidy uses is mpd's, so everything (except blocked commands like \"listall\") should work. According to the paths in mopidy's database one has maybe to prepend a \"Files/\" or similar compared to plain mpd.\r\n\r\nSince I wanted to merge all card-settings to one single file my Card_Assignments.txt contains sections for each card that read like\r\n```\r\n[231412138169]\r\ncardid = 231412138169 <-- this is essentially redundant information, but in case one wants to change the \"section\" style...\r\nuri = Tiergeräusche/Eule\r\nshuffle = 0\r\nrepeat = 0\r\nresume = 0\r\nelapsed = 0\r\nplaystatus = stop\r\n```\r\n\r\nThis is essentially the `folders.conf` and the shortcuts combined.\r\n\r\nIf we wanted to migrate slowly, I could write my code such that the daemon only handles the things `rfid_trigger.sh` took care of and then calls `playout_controls.sh` with the cardid.\r\n\r\nOnce we decided how we move forward I will do a pull request with a working version in that direction.\r\n\r\nBest,\r\n\r\nHenning"}}
{"actor":{"display_login":"laclaro"}}