User avatar
Douglas6
Posts: 4778
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: (Yet another) Vintage Pi-Radio

Mon Oct 10, 2016 10:13 pm

texy wrote:So the bad is that bluetooth now connects, displays metadata, but no sound out of on-board or USB.
Is PulseAudio loading module-bluetooth-policy?

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Mon Oct 10, 2016 10:21 pm

Douglas6 wrote:
texy wrote:So the bad is that bluetooth now connects, displays metadata, but no sound out of on-board or USB.
Is PulseAudio loading module-bluetooth-policy?
Bingo!
Yes I forgot to do this :
viewtopic.php?f=38&t=68779&start=75#p943785

Thank you. I will sort this out tomorrow.
Good night.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Mon Oct 10, 2016 10:22 pm

texy wrote:Sorry - just picked up your reply. I've spent all evening starting afresh. So two steps forward, one back :D
Airplay now working - picking up correct name, audio is coming out of the USB sound card and metadata is also there - so far so good.
Fantastic. Pleased to hear that.
So the bad is that bluetooth now connects, displays metadata, but no sound out of on-board or USB.
Hmm. I doubt I can help on that one. Presumably something to do with pulseaudio. EDIT: seems you've fixed it!
Time for bed, up a 6am as usual tomorrow.......maybe a reboot will sort it, but thats for tomorrow.
Cheers,
Texy
Good night!
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Mon Oct 10, 2016 11:07 pm

Douglas6 wrote:I just toook a quick look at your wrapper code, and a very cursory look at the bluetoothmode stuff. Very nice, much prettier than my mess. I have to say I don't like the polling versus using the gobject mainloop and callback functions, but I can't give a good reason why. Whatever works, works. If you do decide to pursue the mainloop route, I had it working at some point where mainloop was in it's on Python thread. Just remember to include 'gobject.threads_init()' anytime you use threads with gobject.

Once again, great work on PiRadio.
Ok - should be easy enough to get callbacks working.

I'll try to write a nice neat wrapper for this as well to allow custom callbacks depending on interfaces, properties etc.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Tue Oct 11, 2016 7:43 pm

I've now got my system setup and working with the 'airplay_metadata' version working correctly - audio through usb sound card, and metadata displayed for both airshair and bluetooth - great work and many thanks ;)

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Tue Oct 11, 2016 7:46 pm

You are most welcome.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Wed Oct 12, 2016 2:25 pm

I did mean to say that the pip install method you suggest on github for dbus-python didn't work for me - I had to apt-get it.
It's surely to take me some time, but my plan is to use one of my 2.8" displays, rather than the HD44780. How easy would it
be to include album art with metadata?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Wed Oct 12, 2016 3:03 pm

texy wrote:I did mean to say that the pip install method you suggest on github for dbus-python didn't work for me - I had to apt-get it.
Yes - I noticed the same thing when I tried to install the module on my laptop over the weekend. I ended up using apt as well.
It's surely to take me some time, but my plan is to use one of my 2.8" displays, rather than the HD44780. How easy would it
be to include album art with metadata?
Texy
Incorporating a different display should be relatively straightforward. The "display" module should hopefully have all the functions in so you would need to recreate those functions for your own display. It will get harder if you want to use touchscreen as the display module is essentially one-way!

For metadata i think it depends if you're doing this over Airplay or Bluetooth:
  • Airplay should be relatively simple because this is provided by shairport-sync so I could probably amend my code for you to show how to get it. Once I've finished my bluetooth callback code I'll happily take a look for you.
  • Bluetooth, if I understand correctly, doesn't provide artwork so you'd need to use some sort of API to query an online source (e.g. Last.FM) to get artwork.
Last edited by elParaguayo on Wed Oct 12, 2016 3:32 pm, edited 1 time in total.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

User avatar
Douglas6
Posts: 4778
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: (Yet another) Vintage Pi-Radio

Wed Oct 12, 2016 3:19 pm

elParaguayo wrote:Bluetooth, if I understand correctly, doesn't provide artwork so you'd need to use some sort of API to query an online source (e.g. Last.FM) to get artwork.
That's my understanding as well, last time I looked into it.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Wed Oct 12, 2016 3:34 pm

You mean the software bluetooth application being used here doesn't support it?
As album art is of course supported when streaming audio via bluetooth in other systems.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Wed Oct 12, 2016 3:47 pm

I don't know about the last bit, but artwork isn't listed in available properties in the bluez documentation.

A quick google search also seems to suggest that artwork is not part of the AVRCP spec.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

User avatar
Douglas6
Posts: 4778
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: (Yet another) Vintage Pi-Radio

Wed Oct 12, 2016 3:56 pm

The Bluetooth spec supports cover art (via OBEX) in AVRCP 1.6. BlueZ currently supports 1.5. My guess is that devices showing cover art now mostly use an out-of-band source, such as CDDB. At one point I had a MusicBrainz Python module working pretty well.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Thu Oct 13, 2016 12:43 pm

My car doesn't have access to the 'net, but album art is shown on the display panel, transferred from my iphone when I stream via Bluetooth.....

Anyway, something that the shairport-sync mentions, but I couldn't find any details, are for multi-room support. So if I had a couple of PiRadio's in the house, but given a different name in /etc/shairport-sync.conf , then I can direct audio accordingly, but what if I want the same audio to both outputs?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Fri Oct 14, 2016 11:30 am

Texy,

Can't help on the bluetooth bit (other than wonder if the car is using AVRCP 1.6).

On the Airplay, hard for me to answer as I only have an iPhone because of work and don't have any other apple device so I'm not best qualified here. However, I thought iPhones could only output to one speaker but maybe you can select more than one via iTunes.

I do the multi-room sync with logitech media server and squeezelite.
Last edited by elParaguayo on Fri Oct 14, 2016 12:05 pm, edited 1 time in total.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Fri Oct 14, 2016 12:04 pm

Ah - closer look on iTunes at least you can select multiple speakers - yah!
And by using the apple remote app on my iphone I can control itunes, so as long as the pc running itunes is on at home, it can be done.

Cheers,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Sat Oct 15, 2016 8:49 am

elParaguayo wrote:So you've found two of the issues that I've got!

Radio - I've no idea why it crashes! I'm keen to debug that one when I have the time.
It's not crashing today when I change stations- although it is the first time I've tried internet radio using the airplay_metadata code.......

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Sat Oct 15, 2016 9:03 am

It's got some additional error handling code in there but should alert you if there's been an error!

However, if mpc/mpd does crash then I don't think my current error handling code will sort it. Keep me posted!
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Sat Oct 15, 2016 9:14 am

I'm currently adding some of my preferred radio stations.......
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Sat Oct 15, 2016 9:20 am

The list of stations I included was pretty basic/generic. Any good ones to share?
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Sun Oct 16, 2016 3:45 pm

OK - I've tried adding callbacks for Bluetooth rather than continuous polling.

The background code is a bit of a work in progress but it seems to work ok so far.

I've created a BluetoothSignalHandler class and then you can define callbacks based on the signal, interface and properties. For this code, the relevant lines are here: https://github.com/elParaguayo/PiRadio/ ... py#L58-L73 (the code listens for media players connecting to the radio and also for changes to track metadata).

It's on the bluetooth_update branch if someone wants to test.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Mon Oct 17, 2016 6:37 pm

elParaguayo wrote:The list of stations I included was pretty basic/generic. Any good ones to share?
Well music is a personal choice of course :lol:
Well I got off to a good start, but I think PiRadio is a little restricted with the station url format, so for example the #'ed out stations do not work :

Code: Select all

STATIONS = [("Radio 1", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p"),
            ("Radio 2", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p"),
            ("Radio 3", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio3_mf_p"),
            ("Radio 4", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p"),
            ("Radio 4 (LW)", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4lw_mf_p"),
            ("Radio 5 Live", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio5live_mf_p"),
            ("Radio 5 Extra", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio5extra_mf_p"),
            ("Radio 6", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_6music_mf_p"),

            ("Gold", "http://media-ice.musicradio.com:80/GoldMP3"),
#            ("Abs. Classic Rock", "http://network.absoluteradio.co.uk/core/audio/mp3/live.pls?service=vcbb"),
#            ("Absolute 60's", "http://network.absoluteradio.co.uk/core/audio/mp3/live.pls?service=a6bb"),
#            ("Absolute 70's", "http://network.absoluteradio.co.uk/core/audio/mp3/live.pls?service=a7bb"),
#            ("MOD Radio", "http://149.255.59.164/stream/modradio.pls?mp=/stream"),
            ("Capital FM", "http://media-sov.musicradio.com:80/CapitalMP3"),
            ("Heart", "http://media-sov.musicradio.com:80/HeartLondonMP3"),
            ("XFM", "http://media-sov.musicradio.com:80/RadioXLondonMP3"),
#            ("Punk", "http://79.141.174.216/12punks"),
#            ("Mercury", "http://media-ice.musicradio.com/Mercury966")]


Or I'm using the incorrect url format........
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Mon Oct 17, 2016 7:04 pm

PiRadio just passes the URL straight to mpd/mpc so, if you can play the url from the command line, it should work.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Mon Oct 17, 2016 8:20 pm

elParaguayo wrote:PiRadio just passes the URL straight to mpd/mpc so, if you can play the url from the command line, it should work.
OK - sussed it out now. Added a few stations :

Code: Select all

STATIONS = [("Radio 1", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p"),
            ("Radio 2", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p"),
            ("Radio 3", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio3_mf_p"),
            ("Radio 4", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p"),
            ("Radio 4 (LW)", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4lw_mf_p"),
            ("Radio 5 Live", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio5live_mf_p"),
            ("Radio 5 Extra", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio5extra_mf_p"),
            ("Radio 6", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_6music_mf_p"),

            ("Gold", "http://media-ice.musicradio.com:80/GoldMP3"),
            ("Abs. Classic Rock", "http://icy-e-bab-04-cr.sharp-stream.com:8000/absoluteclassicrock.mp3"),
            ("Absolute 60's", "http://icy-e-bab-04-cr.sharp-stream.com:8000/absolute60s.mp3"),
            ("Absolute 70's", "http://icy-e-bab-04-cr.sharp-stream.com:8000/absolute70s.mp3"),
            ("Planet Rock", "http://icy-e-bz-06-cr.sharp-stream.com:8000/planetrock.mp3"),
            ("Capital FM", "http://media-sov.musicradio.com:80/CapitalMP3"),
            ("Heart", "http://media-sov.musicradio.com:80/HeartLondonMP3"),
            ("XFM", "http://media-sov.musicradio.com:80/RadioXLondonMP3"),
            ("Punk Rock Radio", "http://149.56.155.73:8080"),
            ("MOD Radio", "http://149.255.59.164:8027")]
Thanks again.
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: (Yet another) Vintage Pi-Radio

Sun Oct 23, 2016 9:35 pm

I tried a pizero out of interest but the LCD gets scrambled - perhaps it's not compatible with the Adafruit code?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: (Yet another) Vintage Pi-Radio

Sun Oct 23, 2016 9:48 pm

My display gets scrambled sometimes. I might take another look at that some time.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

Return to “Graphics, sound and multimedia”