Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Anyone still scrobbling in 2022?
« previous next »
  • Print
Pages: [1] 2

Author Topic: Anyone still scrobbling in 2022?  (Read 3074 times)

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 875
Anyone still scrobbling in 2022?
« on: March 25, 2022, 09:21:12 AM »
I've decide to make the scrobbler a plugin
that means removing the settings for it and the code from core

We have the ablility to run plugins at start-up so you could simply run scrobbler at start up
(Settings > General Settings > Startup/Shutdown > Start Screen > Open Plugin:
[apps/lastfm_scrobbler]


I wonder is anyone still even using this in 2022?

Comments welcome -
« Last Edit: March 26, 2022, 02:52:25 AM by Bilgus »
Logged

Offline music_

  • Member
  • *
  • Posts: 1
Re: Anyone still scrobbling in 2022?
« Reply #1 on: April 19, 2022, 04:38:42 AM »
Hello, Bilgus!
Yes, I still use scrobbling in 2022 with my Sansa Clip +
Logged

Offline Duceboia

  • Member
  • *
  • Posts: 39
Re: Anyone still scrobbling in 2022?
« Reply #2 on: April 19, 2022, 10:07:32 AM »
Still using scrobbles
Logged

Offline doomsquirrel

  • Member
  • *
  • Posts: 10
Re: Anyone still scrobbling in 2022?
« Reply #3 on: April 22, 2022, 03:30:24 AM »
I'm still using scrobbling in 2022 with my Fiio M3K, and Sansa Clip+

It's not a must have, and I won't be distraught if it is a plugin (or even if it was completely removed). But it is somewhat nice to keep a history of my listening habits rabbits.
Logged

Offline soap

  • Member
  • *
  • Posts: 1679
  • Creature of habit.
Re: Anyone still scrobbling in 2022?
« Reply #4 on: May 02, 2022, 09:54:06 AM »
Scrobbling on my gen5
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 875
Re: Anyone still scrobbling in 2022?
« Reply #5 on: May 11, 2022, 08:32:53 AM »
http://qtscrob.sourceforge.net/
Logged

Offline doomsquirrel

  • Member
  • *
  • Posts: 10
Re: Anyone still scrobbling in 2022?
« Reply #6 on: May 16, 2022, 09:49:47 AM »
I've noticed an unfortunate problem when using the [apps/lastfm_scrobbler] plugin from Startup/Shutdown > Start Screen. After you disconnect the USB cable (when it was connected to your computer for data trasfer), the lastfm_scrobbler stops working. You have to restart the player to get it working again. Not a major problem, but can be annoying if you forget to restart the player.
My device is Fiio M3K. I'm using the latest daily build 2f71571c0a.
« Last Edit: May 19, 2022, 08:51:22 AM by Bilgus »
Logged

Offline dhugas

  • Member
  • *
  • Posts: 17
Re: Anyone still scrobbling in 2022?
« Reply #7 on: May 18, 2022, 04:10:38 PM »
Yes, I'm still using it to keep my last.fm profile accurate. Yesterday I updated to xDuoo X3ii last daily build and now I was wondering why there was no log on songs I've listened today. I will check the lastfm_scrobbler plugin.

[Edit]
I have a problem with [lastfm_scrobbler] producing a panic when USB is unplugged and the plugin is running. I've written at the plugins/viewers section of the forum: https://forums.rockbox.org/index.php/topic,54230.0.html
« Last Edit: May 18, 2022, 04:52:17 PM by dhugas »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 875
Re: Anyone still scrobbling in 2022?
« Reply #8 on: May 19, 2022, 08:53:25 AM »
the plugin shouldn't stop when USB is plugged, doomsquirrel
With the scrobbler plugin running..
after USB unplug if you restart the plugin by browsing to plugin/apps/lastfm_scrobbler does it splash  message about 'Scrobble cache flushed'?
« Last Edit: May 19, 2022, 09:07:16 AM by Bilgus »
Logged

Offline doomsquirrel

  • Member
  • *
  • Posts: 10
Re: Anyone still scrobbling in 2022?
« Reply #9 on: May 19, 2022, 06:24:16 PM »
It does splash the message about 'Scrobble cache flushed'.

To be specific, I can't really say if the plugin stops, but it does stop writing played track info to the scrobbler.log file.

Quote from: Bilgus on May 19, 2022, 08:53:25 AM
the plugin shouldn't stop when USB is plugged, doomsquirrel
With the scrobbler plugin running..
after USB unplug if you restart the plugin by browsing to plugin/apps/lastfm_scrobbler does it splash  message about 'Scrobble cache flushed'?
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 875
Re: Anyone still scrobbling in 2022?
« Reply #10 on: May 19, 2022, 11:26:04 PM »
doomsquirrel here is a build with some polling of the USB status after the initial connection
ATM i'm thinking we are missing the notifications but it might be that they never get sent
Code: [Select]
static void poll_usb_wait_for_disconnect(struct event_queue *q)
{
    struct queue_event ev;
    while(rb->usb_inserted() == true)
    {
        rb->queue_wait_w_tmo(q, &ev, HZ);
        int id = ev.id;
        if (id == SYS_POWEROFF || id == SYS_REBOOT || id == SYS_USB_DISCONNECTED)
        {
            rb->queue_post(q, ev.id, ev.data); /* repost */
            return;
        }
    }
    rb->queue_post(q, SYS_USB_DISCONNECTED, 0); /* we missed the disconnect ?? */
}

baremetal mips:
https://www.mediafire.com/file/86d44osh61ql1pq/FioM3kBaremetal_scrobbler.zip

Or are you using the hosted port??
hosted:
http://www.mediafire.com/file/3psu8ojpp6knm47/FioM3kHosted_scrobbler.zip

first verify which port you are using (rockbox-info.txt CPU: hosted or CPU: mips)
unzip to your device after renaming the current .rockbox directory as a backup



Logged

Offline doomsquirrel

  • Member
  • *
  • Posts: 10
Re: Anyone still scrobbling in 2022?
« Reply #11 on: May 20, 2022, 02:31:47 AM »
That seems to have fixed it.

Now, after I unplug the USB, it writes the track info to scrobbler.log.

There is a situation where it didn't write the track info to scrobbler.log. This happens when it resumes play on a track that is the last track it has written into scrobbler.log. I'm assuming this is so that it doesn't write the same track too many times when you stop playing (and the device powers down) in the middle of a track. If this is intentional, I'm happy about it. I always wanted this to be the behavior, instead of having to manually remove duplicates in the scrobbler.log file or in last.fm.

I'm using the baremetal mips port

P.S. Would it be possible to have the device resume playback after the [lastfm_scrobbler] plugin is started from the Start Screen? Maybe a setting somewhere to enable such behavior? This is not a major issue, but I would like it the most if the device automatically resumes playback when powered on (and after starting the [lastfm_scrobbler] plugin)
« Last Edit: May 20, 2022, 03:00:54 AM by doomsquirrel »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 875
Re: Anyone still scrobbling in 2022?
« Reply #12 on: May 20, 2022, 08:44:18 AM »
I have been toying with making the TSR plugins persistent but I haven't decided how yet

EDIT , oh I see you meant start playback that shouldn't be too difficult but I'm not going to have time for it for a while

yes it tries not to write the same track 2x..

I'm not sure what is actually going on with the USB events, maybe it will become apparent once
dhugas' issue is figured out

 
« Last Edit: May 20, 2022, 08:52:53 AM by Bilgus »
Logged

Offline amachronic

  • Developer
  • Member
  • *
  • Posts: 269
Re: Anyone still scrobbling in 2022?
« Reply #13 on: May 21, 2022, 10:25:01 AM »
bilgus, re IRC yesterday, I'm not sure why usb events wouldn't be propagated. It seems to be working for me but maybe my testing is too simple. This is what I did (with a clean RB install):

1. start up scrobbler and play a few tracks
2. plug in USB, I can see the tracks in the scrobbler log
3. unplug USB and play a few more tracks
4. plug in USB again, new tracks show up in scrobbler log

I added a USB TSR test plugin g#4555 to debug connection issues but it seems to be getting both connect & disconnect as expected.

doomsquirrel if you can think of any more specific thing I can try to trigger the bug i'd appreciate it.
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 875
Re: Anyone still scrobbling in 2022?
« Reply #14 on: May 21, 2022, 11:57:09 AM »
It tests the same for me..
amachronic I added a foreground mode so we can test both

Code: [Select]
/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 * $Id$
 *
 * Copyright (C) 2022 Aidan MacDonald
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ****************************************************************************/

#include "plugin.h"
#include "logf.h"

#undef DEBUGF
#define DEBUGF(...)
//#define DEBUGF printf

#define EV_EXIT MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 0xFF)

unsigned char stack[DEFAULT_STACK_SIZE];
struct event_queue queue;
int thread_id;
const char* state = "none";
const char* prev_state = "none";

static void main_loop(void)
{
    bool exiting = false;
    struct queue_event ev;

    while(true) {
        rb->queue_wait(&queue, &ev);

        /* events that are handled whether exiting or not */
        switch(ev.id) {
        case EV_EXIT:
            return;
        }

        if(exiting)
            continue;

        /* events handled only when not exiting */
        switch(ev.id) {
        case SYS_USB_CONNECTED:
            prev_state = state;
            state = "connected";
            logf("test_usb: connect ack %ld", *rb->current_tick);
            DEBUGF("test_usb: connect ack %ld\n", *rb->current_tick);
            rb->usb_acknowledge(SYS_USB_CONNECTED_ACK);
            break;

        case SYS_USB_DISCONNECTED:
            prev_state = state;
            state = "disconnected";
            logf("test_usb: disconnect %ld", *rb->current_tick);
            DEBUGF("test_usb: disconnect %ld\n", *rb->current_tick);
            break;

        case SYS_POWEROFF:
        case SYS_REBOOT:
            prev_state = state;
            state = "exiting";
            exiting = true;
            break;
        }
    }
}

static void kill_tsr(void)
{
    rb->queue_post(&queue, EV_EXIT, 0);
    rb->thread_wait(thread_id);
    rb->queue_delete(&queue);
}

static bool exit_tsr(bool reenter)
{
    MENUITEM_STRINGLIST(menu, "USB test menu", NULL,
                        "Status", "Stop plugin", "Back");

    while(true) {
        int result = reenter ? rb->do_menu(&menu, NULL, NULL, false) : 1;
        switch(result) {
        case 0:
            rb->splashf(HZ, "State: %s", state);
            rb->splashf(HZ, "Prev: %s", prev_state);
            break;
        case 1:
            rb->splashf(HZ, "Stopping USB test thread");
            kill_tsr();
            return true;
        case 2:
            return false;
        }
    }
}

static void run_fg(void)
{
    rb->queue_init(&queue, true);
    thread_id = rb->create_thread(main_loop, stack, sizeof(stack),
                                  0, "test_usb"
                                  IF_PRIO(, PRIORITY_USER_INTERFACE)
                                  IF_COP(, CPU));
    rb->splashf(HZ, "Thread started");

    while(true)
    {
        if (rb->button_get_w_tmo(HZ) != BUTTON_NONE)
        {
            kill_tsr();
            rb->splashf(HZ, "Thread Exiting");
            return;
        }
    }
}

static void run_tsr(void)
{
    rb->queue_init(&queue, true);
    thread_id = rb->create_thread(main_loop, stack, sizeof(stack),
                                  0, "test_usb TSR"
                                  IF_PRIO(, PRIORITY_BACKGROUND)
                                  IF_COP(, CPU));
    rb->plugin_tsr(exit_tsr);
}

enum plugin_status plugin_start(const void* parameter)
{
    (void)parameter;
    MENUITEM_STRINGLIST(menu, "USB test menu", NULL,
                        "Start TSR", "Start Foreground", "Quit");
    while(true) {
        switch(rb->do_menu(&menu, NULL, NULL, false)) {
        case 0:
            run_tsr();
            rb->splashf(HZ, "Thread started");
            return PLUGIN_OK;
        case 1:
            run_fg();
            continue;
        case 2:
            return PLUGIN_OK;
        default:
            return PLUGIN_ERROR;
        }
    }
}


doomsquirrel here is a build with the test plugin if you could test both the TSR and fg mode with your Fio
https://www.mediafire.com/file/bbq07r2nj8lpcxe/rockbox_TestUSB_FioM3k_bm.zip/file
Logged

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Anyone still scrobbling in 2022?
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.085 seconds with 16 queries.