Thank you for your donation!


Solved: Unable to get Google music (gmusicapi) working.
#1
Hey all, new user here and I'm sure like a lot of you it only took a few minutes of using moOde to decide this is the music app for me. Big thanks to all involved!! 

I hope to get Google music streaming directly from moOde (not via bluetooth) and believe that installing/configuring gmusicapi is the way to get there. I have gmusicapi installed however am not seeing any difference on any of the moOde config screens.

As root, I installed gmusicapi with the following command (pip3 install gmusicapi), I used pip3 as gmusicapi no longer supports python2:
Code:
root@moode:~# pip3 show gmusicapi
Name: gmusicapi
Version: 12.1.1
Summary: An unofficial api for Google Play Music.
Home-page: http://pypi.python.org/pypi/gmusicapi/
Author: Simon Weber
Author-email: simon@simonmweber.com
License: Copyright (c) 2018, Simon Weber
Location: /usr/local/lib/python3.7/dist-packages
Requires: six, python-dateutil, requests, mock, oauth2client, MechanicalSoup, proboscis, protobuf, gpsoauth, validictory, decorator, future, appdirs, mutagen
Required-by:
root@moode:~#

I have a populated gmusicapi directory:
Code:
root@moode:~# ls -ld /usr/local/lib/python3.7/dist-packages/gmusicapi
drwxr-sr-x 8 root staff 4096 Feb 24 19:38 /usr/local/lib/python3.7/dist-packages/gmusicapi

root@moode:~# du -hs /usr/local/lib/python3.7/dist-packages/gmusicapi
1.4M    /usr/local/lib/python3.7/dist-packages/gmusicapi

I have rebooted the OS several times since the gmusicapi installation and still no difference in the moOde config screens. I am not seeing the reference to Google music as shown in the first screenshot in this thread: http://moodeaudio.org/forum/showthread.php?tid=729

What am I missing or needing to do?

Below is some additional info on my install, also I have not patched the OS this was a fresh install of the most recent moOde image. I do see "Google Play music service" listed in the output of moodeutil -a but only checked it after installing so I do not know if it was there before.
Code:
pi@moode:~ $ moodeutl -a
1    y    Kernel architecture
2    y    Airplay renderer
4    y    DLNA server
8    y    MPD audio scrobbler
16    y    Squeezelite renderer
32    y    UPnP client for MPD
64        Require squashfs for software update
128    y    Google Play music service
256    y    Local display
512    y    Input source select
1024        UPnP volume sync
2048    y    Spotify Connect renderer
4096    y    GPIO button handler
8192    y    UPnP media browser
16384    y    Bluetooth renderer

pi@moode:~ $ moodeutl -l
20200225 164134 worker: -- Start
20200225 164134 worker: Successfully daemonized
20200225 164134 worker: Integrity check (passed)
20200225 164134 worker: Session loaded
20200225 164134 worker: Debug logging (off)
20200225 164134 worker: Device raw: (0:sndrpihifiberry|1:empty|i2s:HiFiBerry DAC+ Pro)
20200225 164134 worker: Device cfg: (HiFiBerry DAC+ Pro|0|0|Digital|0)
20200225 164134 worker: ALSA volume set to (0%)
20200225 164134 worker: -- System
20200225 164135 worker: Host name     (moode)
20200225 164135 worker: moOde release (6.4.2 2020-02-12)
20200225 164135 worker: Raspbian OS   (10.2)
20200225 164135 worker: Linux kernel  (4.19.97-v7+ #1293)
20200225 164135 worker: Platform      (Pi-3B 1GB v1.2)
20200225 164135 worker: Architecture  (armv7l)
20200225 164135 worker: MPD version   (0.21.16)
20200225 164135 worker: CPU governor  (ondemand)
20200225 164135 worker: USB boot not enabled yet
20200225 164135 worker: File system expanded
20200225 164135 worker: HDMI port on
20200225 164136 worker: File check (OK)
20200225 164136 worker: -- Network
20200225 164136 worker: eth0 exists
20200225 164136 worker: eth0 wait 0 for IP address
20200225 164139 worker: eth0 wait 1 for IP address
20200225 164142 worker: eth0 wait 2 for IP address
20200225 164145 worker: eth0 wait 3 for IP address
20200225 164148 worker: eth0 wait 4 for IP address
20200225 164151 worker: eth0 address not assigned
20200225 164151 worker: wlan0 exists
20200225 164151 worker: wifi country (US)
20200225 164151 worker: wlan0 trying SSID (irveje)
20200225 164152 worker: IP addr (192.168.1.248)
20200225 164152 worker: Netmask (255.255.255.0)
20200225 164152 worker: Gateway (192.168.1.1)
20200225 164152 worker: Pri DNS (2605:a601:ac00:c300::1)
20200225 164152 worker: Domain  (192.168.1.1)
20200225 164152 worker: -- Audio
20200225 164152 worker: ALSA outputs unmuted
20200225 164152 worker: ALSA card number (0)
20200225 164152 worker: Audio output (I2S audio device)
20200225 164152 worker: Audio device (HiFiBerry DAC+ Pro)
20200225 164153 worker: Audio formats (S16_LE, S24_LE, S32_LE)
20200225 164153 worker: ALSA mixer name (Digital)
20200225 164153 worker: MPD volume control (hardware)
20200225 164153 worker: Hdwr volume controller exists
20200225 164153 worker: Max ALSA volume (100%)
20200225 164153 worker: -- Services
20200225 164153 worker: Reset renderer active state
20200225 164153 worker: MPD conf updated
20200225 164154 worker: MPD started
20200225 164154 worker: MPD accepting connections
20200225 164154 worker: Configure MPD outputs
20200225 164154 worker: MPD output 1 ALSA default (on)
20200225 164154 worker: MPD output 2 ALSA crossfeed (off)
20200225 164154 worker: MPD output 3 ALSA parametric eq (off)
20200225 164154 worker: MPD output 4 ALSA graphic eq (off)
20200225 164154 worker: MPD output 5 ALSA polarity inversion (off)
20200225 164154 worker: MPD output 6 ALSA bluetooth (off)
20200225 164154 worker: MPD output 7 HTTP stream (off)
20200225 164154 worker: MPD crossfade (off)
20200225 164154 worker: Audio source (Local)
20200225 164154 worker: Output device (Local)
20200225 164154 worker: USB auto-mounter (udisks-glue)
20200225 164154 worker: -- Music sources
20200225 164155 worker: USB sources (none attached)
20200225 164155 worker: NAS and UPnP sources (none configured)
20200225 164155 worker: -- Miscellaneous
20200225 164155 worker: Saved MPD vol level (0)
20200225 164155 worker: Preamp volume level (0)
20200225 164155 worker: MPD volume level (50) restored
20200225 164155 worker: ALSA volume level (83%)
20200225 164155 worker: Auto-play (Off)
20200225 164155 worker: Auto-shuffle service (Off)
20200225 164155 worker: Maintenance interval (3 hrs)
20200225 164155 worker: Screen saver activation (Never)
20200225 164155 worker: Session permissions (OK)
20200225 164155 worker: Watchdog started
20200225 164155 worker: Ready
Reply
#2
@JeffD

Thanks for catching the Python2 vs Python3 thing. I just checked the gmusicapi site:

Quote:Status and Updates:

- January 2020: Python 2 support dropped.


Building it now so I can dig into your issue.

Regards,
Kent
Reply
#3
@JeffD

Temp fix:

In /var/www/upp-config.php, lines 73-75 currently read

Code:
// GOOGLE MUSIC
$_gmusicapi_msg = 'hide';
$result = sysCmd('/var/www/command/util.sh check-dir "/usr/local/lib/python2.7/dist-packages/gmusicapi"');

Edit that third line to read ".../python3.7/..." instead of ".../python2.7/..." and reboot (probably not absolutely necessary but it's good to start with a clean slate).

Now you'll see the Google Play section in UPnP Config you expect.

True confession: I played with Google Music in the past but haven't been using it in some time. I'll have to dig up my credentials before I can make sure this API still works with moOde 6.4.2.

Regards,
Kent
Reply
#4
Thanks for the tip. After making the modification I did see the login/passwd etc under UPnP.

I was able to get things working, I think. It appears that the native Google Music app (on Android and macOS) is unable to control the render. I installed BubbleUPnP on Android and am somewhat able to get Google music working, I can play playlists and stuff in my library through BubbleUPnP but cant seem to do anything for getting new music using it, it appears that it would have to be done through the Google Music app saved and then refreshed on BubbleUPnp... not very seamless. My understanding was that BubbleUPnP would add the "Moode UPNP" renderer in the Google Music app and I could select it as a device to "cast to", apparently Google no longer allows this.

As a solution I signed up for a Spotify trial account and have that working. I'll likely end up switching from Google Music and seeing if I can get moode-spotify-connect-web working. Smile

Please let me know if I am totaling missing something with how Google Music is/does work with MoOde.

Thanks alot,
JeffD
Reply
#5
I remember having that issue with Google Music/Bubble when I used it a while ago. Bubble had to keep loading the library afresh and it got a bit tedious.
Reply
#6
@JeffD

Thanks for confirming that the GPM login process works with this fix.

Looking back through my notes, I finally remembered I cancelled my Google Play Music subscription last summer because I wasn't using it enough to justify the monthly fee.

For some years now, we've been told again and again that GPM is going to be retired in favor of YouTube Music. Last year, Google was saying "by the end of 2019". Obviously that still hasn't happened but the uncertainty leaves me not wanting to start up my subscription again.

Perhaps some other user who is using moOde's gmusicapi feature can comment on your findings about its current functionality. [added as I type: I see @jonners already has.]

AFAIK, there's no published API for YourTube Music [1], despite repeated pleas on its forum and elsewhere, nor yet any reverse-engineered implementation of it. Unless and until that happens, moOde and other opensource players will be left out in the cold when the switch-over actually occurs.

Regards,
Kent

[1] - note that YouTube and YouTube Music are two different animals.
Reply
#7
I had to use this to get it to install, even after upgrading (so I thought) python. It was a fresh install from the current image.

sudo pip3 install gmusicapi


Not much hassle in the daylight, but last night, well.... Smile Thanks to JeffD for posting it! 

moOde release = 6.5.0 2020-04-24

Raspbian OS = 10.3

Linux kernel = 4.19.115-v7+ #1305
Platform = Pi-3B 1GB v1.2

It would be great if the Info text was updated to reflect the above command or the python version in the image was changed.
Reply
#8
(04-25-2020, 07:17 PM)LaserGecko Wrote: I had to use this to get it to install, even after upgrading (so I thought) python. It was a fresh install from the current image.

sudo pip3 install gmusicapi
...

It would be great if the Info text was updated to reflect the above command or the python version in the image was changed.

Yup. This is an artifact of Raspbian being shipped with both Python 2 and Python 3 binaries and libraries, with /usr/bin/python linked to the latest Python 2.7.16 binary. I guess they do this because so many users' scripts would break if they changed it to link to the Python 3.7.3 binary. The same holds for pip and pip3.

I agree that the Info text should be updated.


You can always change the link yourself, or learn how to use the "update-alternatives" command.

Regards,
Kent
Reply
#9
Thanks, Kent.

I still have to "hunt and peck and ask" in Linux to find what I need to do. Odd thing. I made the change you mentioned above, but it still gave the same error when I tried to install it.
Reply


Forum Jump: