Yio Remote Community

Spotify integration

Hi all,

We are working on media player integrations, and Spotify is one of them. I have started putting together the basics for it and so far so good. It works :slight_smile:

Here is a screenshot:

If anyone wants to help out with the development, here is the repo:

2 Likes

Slowly making progress with the Spotify integration. Here is a preview of the search functionality and the performance. Still needs a lot more work, but something at least to show:

@ChristianRiedl check out the spotify integration. I have used the abstractmodel code you wrote and expanded it a bit. It’s still far from being done, but you can see how it performs with the Listview. And the CPU is even scaled down for this video to 60%.

2 Likes

@marton
Really amazing :+1: how Qt deals with the few resources on Pi Zero.

In the meanwhile I was thinking about the mediaplayer functionality and found out that I am no typical user. I play 95% from my local music library. For me hierarchy browsing is most important. But now most people are streaming from SPOTITY, TIDAL etc.

When I make music “research” on TIDAL I can’t imagine to do it on a smartphone or on a remote like YIO. I need at minimum an iPad, maybe because my fingers a broad and my eyes week. And when I find something interesting I put it to favorites. Do you plan to store search results on the YIO ?

With the virtual keyboard layout I have seen on your video, the YIO is as comfortable as a smartphone, and displaying the result is surely fast enough.

I am looking forward to combining your design with my ROON integration.

2 Likes

Yeah, it’s great! I think we can further improve on the speed, but as a start I think we’re in a good spot.

I am creating UI templates to display albums, playlists, etc. so those could be reused for browsing as well. I haven’t implemented the navigation in more levels yet, hopefully will be able to do it in the coming days.

Right now I am storing the recent searches in the session while the media player is open. It’s easy to store it for the whole runtime of the remote or even save it. Not sure the latter would make sense though.

The virtual keyboard works quite well, it even supports handwriting, but I haven’t implemented that.

1 Like

@marton

I evaluated different methods to deliver arrays of objects from integration to the remote. The QAbstractListModel is the best, in most cases in the UI ListViews are used to display the arrays of objects. I also tried QQmlListProperty, but it is more complicated and requires arrays of QObjects derived items which have a big overhead, I have learned.

What I did not like in my current ROON integration was the handling with QVariantMaps (using member names) and I found a good alternative. I can not get used to the fact that you realize at runtime that you have mistyped a name. For flat objects (maybe also for nested) objects QObject* is a good alternative. QML deals perfect witch such objects.

In the media browser I need access to a list item as normal object .

Q_INVOKABLE  QObject*       getItem (int index);

Some magic (Qt Engine) frees the allocated objects. QObject* is a QModelItem derived from ModelItem. I pushed the change to my roon integration. If you need similar functionality take a look to latest integration.roon. I also removed all ROON specific things from the BrowseModel. Such things are candidates for a integration libary I think.

I will change the weather stuff also to QAbstractListModel please wait with merging.
And I will implement purging old log files in the Logger.

Thanks @ChristianRiedl! I also think QAbstractModel is the way to go with the combination of QObjects. Those are easily treated on the QML side.

Thanks for the Logger update. I will create a pull request to the dev branch soon!

@marton
I added a change in integration.h : connect and disconnect should be defined as virtual functions there.
Otherwise it works only because the integrations accidentally implemented a function with name “connect”. In the integrations it is only required to add override to this functions.

And I think that enter/leave standby should be handled in the same way. As there is already a {} implemention in integration.h it only needs to be overriden by integration if necessary.

Did you measure the power consumption of the Pi Zero ? I only found some info about 80 mA in idle mode with Wifi off. But how much does in increase with 50 % CPU load ? ROON sends in PLAYING mode continuousely data (with the time position). I want to disable it in standby mode.

Thanks @ChristianRiedl!

Standby could be done the same way. The standby control can put all integrations to standby and wake them up. However to save even more power, I’m also thinking just disconnecting the integrations while in standby.

I can’t remember exactly the power consumption, but I’ll send you the measurements when I’m back home.

Fine, I think sending enter / leave standby is the better solution, the integrations can decide what to do in which case

Right. I am just thinking if we should be more strict about it and turn off the integrations when in standby to conserve battery power.

When something is playing (movie, music) that would override this setting and would leave that integration in normal operation mode. You might want to adjust volume or skip a song without having to wait a second until it’s connected again. You want to change volume instantly.

1 Like

Here is the first alpha version of the Spotify integration running on the remote:

There is room for improvements. Especially how the images are handled. But I think it’s a good start :slight_smile:

@ChristianRiedl you can also check out the code on github!

1 Like

Looks good !! I’m looking forward to my Roon Integration getting married with your UI. But I already switched my Roon integration to the new version with the enums for feature and command. Unfortunately, that’s all in the feature/weather branch. I have to wait until this monster branch is merged.
I have now a better idea about teamworking via github, I know now how to avoid such situation.

Great! I am going to look at trying to merge the feature/weather branch tomorrow. If I can’t get it to work, I might reach out and ask for your help!

Of course, if I can do something tell me

@marton

remote-software :
I took a look to the changes you merged in entities :

  • entities.* OK

  • Mediaplayer entity, in the feature/weather branch you will merge I allready added the new features

    • MEDIADURATION, MEDIAPROGRESS
      SEARCHMODEL, BROWSEMODEL
  • and I removed BROWSERESULT, we will not use it

spotify integration

In Integration feature/update-interface I pushed the neccary changes to be compatible with feature/weather

  • Category logging, the change is required to control logging from Logger class
  • PluginInterface
  • Enums
  • enter/leave standby ?
  • Integration::setup sets up m_entities, id and friendly name

Hello,
@marton

Can you integrate Deezer?

hi @Tucker,

as far as I know Deezer has an API. Have to check in detail.
Could you open a feature request here?

It might happen that someone who also interested in this integration will pick it up and start developing :slight_smile:

Thanks,
Marton