Thank you for your donation!


Siriusxm support?
#1
Is it possible to use Moode to log into and listen to Siriusxm? I am a subscriber and have a username and password.
Reply
#2
(08-14-2021, 07:15 PM)jmperagine Wrote: Is it possible to use Moode to log into and listen to Siriusxm? I am a subscriber and have a username and password.

There is no support for SiriusXM built into moOde. Indeed, as far as I know there is no open-source implementation of a SiriusXM client available for any player.

However, you should be able to run an official SiriusXM app on your phone, tablet, laptop, or desktop and stream the output to your moOde player via Bluetooth or Airplay just as can be done with the vendor apps for Primephonic, Qobuz, Tidal, etc.

Regards,
Kent
Reply
#3
Hi Kent & Tim,
Found this SXM-Player here: https://sxm-player.readthedocs.io/en/latest/readme.html

I managed to change the default Python to 3.x and install it.
I can "log in" with my credentials, via SSH, and I do get this:

2021-10-13 20:14:28 moode sxm_player[2604] INFO Attempting to connect SXM Client (next in 10 seconds)
2021-10-13 20:14:30 moode sxm_player.sxm[3310] INFO sxm has started on http://127.0.0.1:9999
2021-10-13 20:14:31 moode sxm_player[2604] INFO SXM Client started. 313 channels available

but I have no idea what to do next or to get it to play from Mode. I was hopping I could setup some presets similar to the internet radio stations.

Any help would be much appreciated. This is so far over my head, my neck hurts from looking up. Smile
Reply
#4
@jmperagine

Sorry, this is not the player you are hoping for despite its name sxm-player. By itself it acts as a local proxy for the remote SiriusXM servers. 

Someone has to write a "Player Class" module akin to the existing CLIPlayer or sxm-discord classes in order to provide the functionality you want vis-a-vis SiriusXM and moOde. 

I didn't find the documentation very enlightening although I was able to follow it well enough to use the CLIPlayer module to record a channel to an ever-growing mp3 file. I could stop the process and then play the mp3 file via moOde but that's not a satisfying mode of operation.

Based on what I thought I learned from the docs and the above experience I tried but failed to play a channel via the proxy using VLC, the Swiss-Army knife of players.

I think that's about as far as I'm going to go. It was pure serendipity that my SO and I signed up for a free trial subscription for her car just a week ago so I had credentials to test with but I seriously (doh!) doubt we'll carry it into a paid subscription.

Good hunting.

Regards,
Kent
Reply
#5
@jmperagine

Retraction: it turns out that my experiment with VLC failed, not because of sxm-player, but because the Chromium browser on my laptop was interfering with VLC. This morning I tried again while the coffee was brewing. Starting with no other apps running I found myself listening to an HLS stream accessed via the sxmplayer.

Buoyed by this success, I then set up a new radio station in moOde which plays the same SiriusXM channel.

So, here's what I did.

1) installed sxm-player on my moOde player and started it from the command line with the default host option (127.0.0.1 aka localhost)

Code:
pi@rpi4b2:~ $ sxm-player -U <my sxm username> -P <my sxm password>
2021-10-14 09:28:10 rpi4b2 sxm_player[17883] INFO Attempting to connect SXM Client (next in 10 seconds)
2021-10-14 09:28:11 rpi4b2 sxm_player.sxm[17910] INFO sxm has started on http://127.0.0.1:9999
2021-10-14 09:28:12 rpi4b2 sxm_player[17883] INFO SXM Client started. 412 channels available

2. In moOde's Radio Directory, created a new radio station for the SiriusXM "Octane" channel and give it an URL pointing to the appropriate HLS playlist file
  
Code:
http://localhost:9999/octane.m3u8

or

http://127.0.0.1:9999/octane.m3u8

3. Play the new radio station and check m>Audio info
 
Code:
Audio Information


INPUT / OUTPUT
Source       http://localhost:9999/octane.m3u8
Encoded at   VBR compression
Decoded to   24 bit, 44.1 kHz, Stereo, 258 kbps
Output rate  16 bit, 48 kHz, Stereo, 1.536 Mbps
Output mode  ALSA Default (plughw)
Output chain MPD -> plughw -> Device

(It transcoded to 48 kHz because of my output device)

Fortunately, Tim compiles MPD with HLS protocol support enabled so this works out of the box.

4. Finally, so that sxm-player starts when moOde boots, I inserted a line to /etc/rc.local and rebooted

Code:
# moOde startup and job processor daemon
/var/www/command/worker.php > /dev/null 2>&1

# start the SiriusXM proxy
/usr/local/bin/sxm-player -U <my sxm username> -P <my sxm password> &

exit 0
 
Sorry I was so misled by my initial test.

You can define a set of stations for your desired channels. You'll probably want some catchy cover art for each (like all those SomaFM stations). Note that we're creating URLs here. If one wants, say, the "Classsic Vinyl" channel, then the space must be properly encoded, eg, 

Code:
http://localhost:9999/classic%20vinyl.m3u8


Regards,
Kent
Reply
#6
OMG, I can't wait to get outta work and try this. THANK YOU!

IT WORKS!

THANK YOU!
Reply
#7
A few postnotes:

1. I suggested running the sxm-player proxy on the moOde player with default settings, which include binding it to the localhost address. This works only for a client (here, MPD) running on the same host. If one wants to play SiriusXM streams through players on other hosts then one has several options:
  • use the -h / --host option to bind the proxy to an IP or hostname by which the host is known on the LAN. Then all clients on the LAN can stream from it using appropriate station URLs.
  • obviously, this means sxm-player could be used on some other, possibly more muscular host on the LAN---a NAS for example
  • AFAICT one can run only one instance of sxm-player with the same credentials on the LAN without problems so plan ahead.
2. It turns out that if one uses "localhost" in the station URLs instead of "127.0.0.1", then MPD wastes a few CPU cycles trying first the IPv6 local address (::1) defined in /etc/hosts---which doesn't succeed because the proxy isn't listening to IPv6---before trying the IPv4 address. No harm done but wasteful.

3. Only the station name is being displayed in playback. Supposing that SiriusXM includes title/artist metadata in its streams, I think the proxy itself is discarding it because other clients I've used with the proxy such as VLC don't receive track title/artist either. However, the MPD log shows a curiosity. There are repeated occurrences of messages like "Oct 17 12:09 : ffmpeg/aac: Stripped 73 HLS ID3 bytes". I haven't figured out what's in those bytes, always 73 of them.

4. AFAICT one has to have a SiriusXM subscription which allows online access in addition to, or instead of, satellite access.

5. As I mentioned before, I don't plan to convert my free starter subscription at the end of the trial period. However, I did experiment with creating station logos to see how it would go (and because it was raining yesterday afternoon Rolleyes ). 
  • I could find a decently sized JPEG image of the SiriusXM logo in one place and I could extract individual channel logos (in SVG format) from the SiriusXM channel guide. 
  • Armed with Inkscape (to convert the SVG vector graphics to PNG) and GIMP I composed the attached examples for the few stations I've defined in moOde. 

Not the greatest, perhaps, but definitely better than using the default moOde image everywhere. The sxm-player log says there are 412 channels available so I've only scratched the surface and I'm definitely not offering a service!

Regards,
Kent


Attached Files Thumbnail(s)
                   
Reply
#8
(10-17-2021, 07:43 PM)TheOldPresbyope Wrote: A few postnotes:

1. I suggested running the sxm-player proxy on the moOde player with default settings, which include binding it to the localhost address. This works only for a client (here, MPD) running on the same host. If one wants to play SiriusXM streams through players on other hosts then one has several options:
  • use the -h / --host option to bind the proxy to an IP or hostname by which the host is known on the LAN. Then all clients on the LAN can stream from it using appropriate station URLs.
  • obviously, this means sxm-player could be used on some other, possibly more muscular host on the LAN---a NAS for example
  • AFAICT one can run only one instance of sxm-player with the same credentials on the LAN without problems so plan ahead.
2. It turns out that if one uses "localhost" in the station URLs instead of "127.0.0.1", then MPD wastes a few CPU cycles trying first the IPv6 local address (::1) defined in /etc/hosts---which doesn't succeed because the proxy isn't listening to IPv6---before trying the IPv4 address. No harm done but wasteful.

3. Only the station name is being displayed in playback. Supposing that SiriusXM includes title/artist metadata in its streams, I think the proxy itself is discarding it because other clients I've used with the proxy such as VLC don't receive track title/artist either. However, the MPD log shows a curiosity. There are repeated occurrences of messages like "Oct 17 12:09 : ffmpeg/aac: Stripped 73 HLS ID3 bytes". I haven't figured out what's in those bytes, always 73 of them.

4. AFAICT one has to have a SiriusXM subscription which allows online access in addition to, or instead of, satellite access.

5. As I mentioned before, I don't plan to convert my free starter subscription at the end of the trial period. However, I did experiment with creating station logos to see how it would go (and because it was raining yesterday afternoon Rolleyes ). 
  • I could find a decently sized JPEG image of the SiriusXM logo in one place and I could extract individual channel logos (in SVG format) from the SiriusXM channel guide. 
  • Armed with Inkscape (to convert the SVG vector graphics to PNG) and GIMP I composed the attached examples for the few stations I've defined in moOde. 

Not the greatest, perhaps, but definitely better than using the default moOde image everywhere. The sxm-player log says there are 412 channels available so I've only scratched the surface and I'm definitely not offering a service!

Regards,
Kent

wow, thanks again Kent for all this.

I am having a bit of trouble starting the sxm-player when Moode boots.

I added
# start the SiriusXM proxy
/usr/local/bin/sxm-player -U <my sxm username> -P <my sxm password> &   (using my credentials of course)

I get a compatibility error, literal screen shot attached 
or not, picture not uploading.

[FAILED] Failed to start /etc/rc.local Compatibility.

and then the whole thing fails to boot up the rest of the way.

I can SSH in and start sxm-player and then load a channel via the Moode interface, Firstwave, Tom Petty Radio, etc. all work and sound very good.

and I can then switch to regular internet radio like JazzGroove.org and back. It's just the loading at boot that is not working.
Reply
#9
(10-18-2021, 09:01 PM)jmperagine Wrote:
(10-17-2021, 07:43 PM)TheOldPresbyope Wrote: A few postnotes:

...blah blah blah...

wow, thanks again Kent for all this.

I am having a bit of trouble starting the sxm-player when Moode boots.

I added
# start the SiriusXM proxy
/usr/local/bin/sxm-player -U <my sxm username> -P <my sxm password> &   (using my credentials of course)

I get a compatibility error, literal screen shot attached 
or not, picture not uploading.

[FAILED] Failed to start /etc/rc.local Compatibility.

Hmmm. This is systemd saying it has a problem with the contents or permissions of the /etc/rc.local file. (The use of rc.local is a throwback to old-school SystemV Unix. It's now handled by a compatibility mechanism in systemd.)

Quote:and then the whole thing fails to boot up the rest of the way.

I'm not sure what "the rest of the way" means.

Quote:I can SSH in and start sxm-player and then load a channel via the Moode interface, Firstwave, Tom Petty Radio, etc. all work and sound very good.

and I can then switch to regular internet radio like JazzGroove.org and back. It's just the loading at boot that is not working.

This suggests moOde did boot 'the rest of the way".

1. check the ownership/permissions of /etc/rc.local. They should look like
Code:
pi@rpi3bp:~ $ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 1202 Oct  2 07:57 /etc/rc.local

2. post the /etc/rc.local file contents

3. test that the file is basically ok
Code:
sudo killall sxm-player
sudo /etc/rc.local

In the above, the first line makes sure there are no copies of sxm-player running. The second line should run without errors, ending with a cleared screen showing lines like
Code:
2021-10-19 09:37:42 rpi4b2 sxm_player[8457] INFO Attempting to connect SXM Client (next in 10 seconds)
2021-10-19 09:37:44 rpi4b2 sxm_player.sxm[8478] INFO sxm has started on http://127.0.0.1:9999
2021-10-19 09:37:45 rpi4b2 sxm_player[8457] INFO SXM Client started. 412 channels available

You'll have to hit <enter> to regain the command line prompt.

If you get this far, then

4. reboot

5. capture and post the command-line output from
Code:
sudo systemctl status rc-local

As an example of this last, here's the output for me on an moOde 7.4.1 player running on an RPi4B.
Code:
pi@rpi4b2:~ $ sudo systemctl status rc-local
Warning: The unit file, source configuration file or drop-ins of rc-local.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● rc-local.service - /etc/rc.local Compatibility
  Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled)
 Drop-In: /usr/lib/systemd/system/rc-local.service.d
          └─debian.conf
          /etc/systemd/system/rc-local.service.d
          └─ttyoutput.conf
  Active: active (running) since Mon 2021-10-18 22:45:21 EDT; 3min 8s ago
    Docs: man:systemd-rc-local-generator(8)
 Process: 522 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
   Tasks: 29 (limit: 4323)
  CGroup: /system.slice/rc-local.service
          ├─ 530 /usr/bin/udisks-glue --config=/etc/udisks-glue.conf
          ├─ 559 /usr/bin/php /var/www/command/worker.php
          ├─ 563 /usr/bin/python3 /usr/local/bin/sxm-player -U xxxxx -P xxxxx
          ├─ 752 /usr/bin/python3 /usr/local/bin/sxm-player -U xxxxx -P xxxxx
          ├─ 753 /usr/bin/python3 /usr/local/bin/sxm-player -U xxxxx -P xxxxx
          ├─1140 sudo /usr/local/bin/shairport-sync -a rpi4b2 Airplay -- -d _audioout
          ├─1142 sudo librespot --name rpi4b2 Spotify --bitrate 160 --format S16 --initial-volume 0 --volume-ctrl log --cache /var/local/www/spotify_cache --disable-aud
          ├─1144 /usr/local/bin/shairport-sync -a rpi4b2 Airplay -- -d _audioout
          ├─1146 librespot --name rpi4b2 Spotify --bitrate 160 --format S16 --initial-volume 0 --volume-ctrl log --cache /var/local/www/spotify_cache --disable-audio-ca
          ├─1189 /bin/bash /var/www/command/watchdog.sh
          └─2136 sleep 6

Oct 18 22:45:19 rpi4b2 systemd[1]: Starting /etc/rc.local Compatibility...
Oct 18 22:45:21 rpi4b2 systemd[1]: Started /etc/rc.local Compatibility.
Oct 18 22:45:25 rpi4b2 rc.local[522]: 2021-10-18 22:45:25 rpi4b2 sxm_player[563] INFO Attempting to connect SXM Client (next in 10 seconds)
Oct 18 22:45:26 rpi4b2 rc.local[522]: 2021-10-18 22:45:26 rpi4b2 sxm_player.sxm[753] INFO sxm has started on http://127.0.0.1:9999
Oct 18 22:45:27 rpi4b2 rc.local[522]: 2021-10-1

(Take care not to post your SiriusXM credentials)

Another possibility is that on your system the rc.local commands are being executed too early in the boot sequence. This can happen because systemd starts processes in parallel whereas the old SystemV initialization started them serially. Hence the rc.local commands are no longer guaranteed to be performed after all the other init processes. We'll wait to cross this bridge until we get to it.

If we do get to it, you probably should post the output from
Code:
moodeutl -i

so we can see your system hardware/software configuration.

Regards,
Kent
Reply


Forum Jump: