PeteManchester / MediaPlayer

61 stars 20 forks source link

Trying to get custom source working but having some bother #97

Closed ghost closed 7 months ago

ghost commented 3 years ago

I'm having a bit of bother getting a custom input source working. I'm using the InputSources.xml file from the repo as a base. When I first boot the Pi the bluetooth receiver script runs when I click the 'Bluetooth receiver' source in Kazoo. I'm not entirely sure what other input sources I'm meant to have in the InputSources.xml file, but I've left just 'Playlist' and my custom Bluetooth source, based on the 'Spotify' source that was already there.

Can you possibly tell me exactly which sources the InputSources.xml file needs? At the moment switching to the Bluetooth receiver source keeps the playlist running - I would have expected this to be put on pause. Is this something I've done by removing most of the sources from InputSources.xml?

PeteManchester commented 3 years ago

Hi, Looks intersing what you are doing. Also looks like you've figured out most of it by now. The InputSources file needs: PlayList Radio AirPlay UpnpAv

Looking at the code, Mediaplayer should attempt to stop the currently playing track if an Analogue source is selected. In the log file you should see the message 'Analog Source Selected, attempt to Stop Playback'

Just out of interest, how have you configured your Bluetooth receiver?

Thanks,

Pete.

ghost commented 3 years ago

Hi, Looks intersing what you are doing. Also looks like you've figured out most of it by now. The InputSources file needs: PlayList Radio AirPlay UpnpAv

Looking at the code, Mediaplayer should attempt to stop the currently playing track if an Analogue source is selected. In the log file you should see the message 'Analog Source Selected, attempt to Stop Playback'

Many thanks. I actually only got MediaPlayer switching to Bluetooth once, so I obviously didn't have the InputSources.xml quite right.

Just out of interest, how have you configured your Bluetooth receiver?

Thanks,

Pete.

I'm using bluealsa, but on Ubuntu I need to use the Impish (21.10) repo to get the binary, as I couldn't get it to build from source (the build instructions seem to be inadequate). The incantation I'm using is:

sudo pkill bluealsa sudo bluealsa -p a2dp-sink & bt-agent --capability=NoInputNoOutput &

Pair with the source, in this case my phone.

bluealsa-aplay --pcm-buffer-time=170000 --profile-a2dp 00:00:00:00:00:00 &

then play music on phone - sound is redirected over bluetooth to the Pi.

ghost commented 3 years ago

I'm using the InputSources.xml from this repo unmodified and Kazoo is still counting up time once the source switched. I don't see any Analog Source Selected, attempt to Stop Playback in the log - see attached mediaplayer_log.zip. The log is showing the source switching, but not the above message.

I've not tried adding my Bluetooth source yet.