Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22
  1. #11
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,421

    Hook for player metadata

    > I don’t have anything on GitHub yet. I have the part that pushes small
    > artwork to players using a slimproto message. That works nicely. But I’m


    Screenshot, screenshot! :-D

    > still struggling to find the best way to get artwork in the Perl
    > environment. Calling artworkRequest, afaik is not doing an http call,
    > it’s just a higher level call than getImage but ends up calling
    > getImage.


    Ok, true. Did you try /music/current as the path? I don't know this
    stuff by heart, but I think that would automatically call the image
    proxy for remote artwork. Otherwise read the coverid from the track and
    get the info there.

    Alas it obviously only does work for the currently playing title.

    --

    Michael

  2. #12
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    5,704
    Quote Originally Posted by mherger View Post
    > I don’t have anything on GitHub yet. I have the part that pushes small
    > artwork to players using a slimproto message. That works nicely. But I’m


    Screenshot, screenshot! :-D

    Michael
    This is a 128x128x16 gray-levels OLED display

    Name:  IMG_5533.jpg
Views: 51
Size:  39.5 KB
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  3. #13
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    5,704
    Quote Originally Posted by mherger View Post
    Ok, true. Did you try /music/current as the path? I don't know this
    stuff by heart, but I think that would automatically call the image
    proxy for remote artwork. Otherwise read the coverid from the track and
    get the info there.

    Alas it obviously only does work for the currently playing title.

    --

    Michael
    The /music/current/ trick works pretty well, thanks! except for the ICY streams that do not seem to send a "newmetadata" message

    [edit]: I think I found it. I need, in the player's object, to serve the "directMetadata" method

    [edit2]: that's interesting ... it seems that Slim::Player::Protocol::HTTP:arseMetadata does the parsing and is called by Slim::Player::Squeezebox2::directMetadata when the handler is a HTTP handler. But, the HTTP:arseMetadata does not (forgot?) to call Slim::Control::Request::notifyFromArray( $client, [ 'newmetadata' ] ). So my overloaded method just does:
    Code:
    	my $client = shift;
    	$client->SUPER::directMetadata(@_);
    	Slim::Control::Request::notifyFromArray( $client, [ 'newmetadata' ] );
    Last edited by philippe_44; 2020-03-17 at 22:10.
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  4. #14
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    5,704
    I've pushed the code to the SqueezeESP32 repo and it works well. What is strange is that although I've subscribed to [newmetadata], some events seems to not be captured. I'm not sure at that point, but it seems that it's upon LMS startup. I mean, when it works, it works, otherwise I need to restart LMS. The [playlist] events are well captured all the time.
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  5. #15
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    5,704
    Quote Originally Posted by philippe_44 View Post
    I've pushed the code to the SqueezeESP32 repo and it works well. What is strange is that although I've subscribed to [newmetadata], some events seems to not be captured. I'm not sure at that point, but it seems that it's upon LMS startup. I mean, when it works, it works, otherwise I need to restart LMS. The [playlist] events are well captured all the time.
    Answering my own question ... I was subscribing using the same callback but without a client (there is none). So looking at LMS code, of course, the 2nd subscription was replacing the first one as there was no way to differentiate them.
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  6. #16
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,421

    Hook for player metadata

    > Answering my own question ... I was subscribing using the same callback
    > but without a client (there is none). So looking at LMS code, of course,
    > the 2nd subscription was replacing the first one as there was no way to
    > differentiate them.


    Oh my... that's something I wasn't aware of myself. I bet I have the
    same situation in some places... thanks for the heads up!

    --

    Michael

  7. #17
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,421

    Hook for player metadata


  8. #18
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    5,704
    Quote Originally Posted by mherger View Post
    Cool, one less!

    BTW, have you seen this question I had a few days ago

    The ICY streams do not seem to send a "newmetadata" message. The Slim::Player::Protocol::HTTP:arseMetadata does the parsing and is called by Slim::Player::Squeezebox2::directMetadata when the handler is a HTTP handler. But, the HTTP:arseMetadata does not (forgot?) to call Slim::Control::Request::notifyFromArray( $client, [ 'newmetadata' ] ). So my overloaded method just does:

    Code:
    	my $client = shift;
    	$client->SUPER::directMetadata(@_);
    	Slim::Control::Request::notifyFromArray( $client, [ 'newmetadata' ] );
    I'm not sure of my conclusion, maybe I missed the call somewhere else
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  9. #19
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,421

    Hook for player metadata

    > It seems that Slim::Player::Protocol::HTTP:arseMetadata does the
    > parsing and is called by Slim::Player::Squeezebox2::directMetadata when
    > the handler is a HTTP handler. But, the HTTP:arseMetadata does not
    > (forgot?) to call Slim::Control::Request::notifyFromArray( $client, [
    > 'newmetadata' ] ). So my overloaded method just does:


    Are you saying you'd consider this a bug? I'd have to look into this.
    Because it might be a "hot" function being called often. And we don't
    want to always trigger a newmetadata event when it's not really new.

    > my $client = shift;
    > $client->SUPER::directMetadata(@_);
    > Slim::Control::Request::notifyFromArray( $client, [ 'newmetadata' ] );


    Isn't this called more often than we have new metadata?


    --

    Michael

  10. #20
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    5,704
    Quote Originally Posted by mherger View Post
    > It seems that Slim::Player::Protocol::HTTP:arseMetadata does the
    > parsing and is called by Slim::Player::Squeezebox2::directMetadata when
    > the handler is a HTTP handler. But, the HTTP:arseMetadata does not
    > (forgot?) to call Slim::Control::Request::notifyFromArray( $client, [
    > 'newmetadata' ] ). So my overloaded method just does:


    Are you saying you'd consider this a bug? I'd have to look into this.
    Because it might be a "hot" function being called often. And we don't
    want to always trigger a newmetadata event when it's not really new.

    > my $client = shift;
    > $client->SUPER::directMetadata(@_);
    > Slim::Control::Request::notifyFromArray( $client, [ 'newmetadata' ] );


    Isn't this called more often than we have new metadata?


    --

    Michael
    From what I see, directMetaData is called from slimproto.pm in _http_metadata_handler which is a function called when the player is handling http streams directly and so gets metadata directly in the stream (which is the case for ICY). Then the player sends a "META" message back to LMS which then invokes that function. I can't trace another call except in streamingcontroller and these seems to only be called upon real metadata change.

    Now, directMetaData calls HTTP:arseMetadata and this where I think the call to "newmetadata" is missing, but I might get that wrong and that call might happen somewhere deeper during execution of HTTP:arseMetadata.

    [edit]: (hope you can see this one) I looked a bit further and indeed HTTP:arseMetadata calls setCurrentTitle which "normally" calls "playlist newsong". In the beginning, I was not subscribing to "playlist newsong" and so I was missing the update, hence I thought the "newmetadata" should be called but indeed the information comes through another channel
    Last edited by philippe_44; 2020-03-20 at 11:30.
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

Posting Permissions

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