Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1
    Senior Member carsten_h's Avatar
    Join Date
    Apr 2019
    Location
    Wunstorf, Germany
    Posts
    642

    piCorePlayer/squeezelite and Bluetooth media control?

    Hello!

    I searched a little bit for Bluetooth media controls in Linux because it would be great to use the media controls on my headphone to control my piCorePlayer.
    What I found is this:
    https://wiki.archlinux.org/index.php/MPRIS#Bluetooth

    So it seems that the mpris-proxy has to be started to receive the bluetooth media controls.
    But I don't know if squeezelite can receive something from mpris, as it is not mentioned as a supported client.

    Maybe someone with knowledge in this parts can look at this.

    Or isn't there any interest in using this?
    Pi4 4GB piCorePlayer with LMS and Squeezelite for USB inside an Argon One case
    Pi3B+ (7" Display, Hifiberry DAC+ Pro) piCorePlayer with Squeezlite/Jivelite for Hifiberry and Bluetooth headphone inside a SmartiPi touch case
    Two Airport Express
    Ikea Symfonisk

  2. #2
    Senior Member carsten_h's Avatar
    Join Date
    Apr 2019
    Location
    Wunstorf, Germany
    Posts
    642
    It seems there is lmsmpris (from Hifiberry OS): https://github.com/hifiberry/lmsmpris which can control squeezelite.
    But maybe it needs to run on the LMS Server, which is of no use for a simple client.
    Pi4 4GB piCorePlayer with LMS and Squeezelite for USB inside an Argon One case
    Pi3B+ (7" Display, Hifiberry DAC+ Pro) piCorePlayer with Squeezlite/Jivelite for Hifiberry and Bluetooth headphone inside a SmartiPi touch case
    Two Airport Express
    Ikea Symfonisk

  3. #3
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,534
    Quote Originally Posted by carsten_h View Post
    But maybe it needs to run on the LMS Server, which is of no use for a simple client.
    I had a quick look at the code and at first glance it looks like it finds LMS on the network and then issues commands to it ... which implies to me it would work with any player ... although I presume it is looking for the player that matches the system that this code is running on.
    https://github.com/hifiberry/lmsmpri...smpris.py#L192
    Last edited by Paul Webster; 2021-04-23 at 03:28.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  4. #4
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,023
    I have a script I use on a Pi4 to connect BT speakers to LMS. I've just (today!) updated this to handle prev/next and play/pause buttons on the speakers - pressing the buttons sends the relevant JSONRPC command to LMS. I'd like to add this change to pCP's implementation, but I use the 'evdev' and 'requests' Python modules that appear not to be on pCP. Any idea on how these can be added?

    If you are interested, my code is at https://github.com/CDrummond/lms-bts...ker-monitor.py Relevant lines are 45 to 135. Basically, the speaker is listed as in input device on Linux, and my code checks for various keycode events associated with the hardware buttons.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

  5. #5
    Senior Member carsten_h's Avatar
    Join Date
    Apr 2019
    Location
    Wunstorf, Germany
    Posts
    642
    Quote Originally Posted by cpd73 View Post
    I have a script I use on a Pi4 to connect BT speakers to LMS.
    That is interesting!

    My LMS Server is on a Pi with piCorePlayer installation and the Bluetooth headphone will be connected to another Pi with piCorePlayer Installation and Jivelite on a 7" Display.
    Will this also work or does the speaker/headphone has to be connected to the Pi with LMS running?
    Pi4 4GB piCorePlayer with LMS and Squeezelite for USB inside an Argon One case
    Pi3B+ (7" Display, Hifiberry DAC+ Pro) piCorePlayer with Squeezlite/Jivelite for Hifiberry and Bluetooth headphone inside a SmartiPi touch case
    Two Airport Express
    Ikea Symfonisk

  6. #6
    Senior Member
    Join Date
    Jan 2006
    Location
    South Coast, NSW, Australia
    Posts
    1,298
    Quote Originally Posted by cpd73 View Post
    I have a script I use on a Pi4 to connect BT speakers to LMS. I've just (today!) updated this to handle prev/next and play/pause buttons on the speakers - pressing the buttons sends the relevant JSONRPC command to LMS. I'd like to add this change to pCP's implementation, but I use the 'evdev' and 'requests' Python modules that appear not to be on pCP. Any idea on how these can be added?

    If you are interested, my code is at https://github.com/CDrummond/lms-bts...ker-monitor.py Relevant lines are 45 to 135. Basically, the speaker is listed as in input device on Linux, and my code checks for various keycode events associated with the hardware buttons.
    cpd73,
    Python had to be added for a new pCP player, as detailed in this thread
    https://audiophilestyle.com/forums/t...?ct=1619175608

    here are the commands to add python
    piCorePlayer v7.0.0 onwards :
    -----------------------------
    Resize FS on webGUI

    ssh login with user tc Password piCore

    tce-load -wi python3.8-Pillow.tcz
    tce-load -wi python3.8-smbus.tcz
    tce-load -wi python3.8-rpi-gpio.tcz
    tce-load -wi iproute2.tcz

    sudo su

    I don't know if the iproute2.tcz is needed but this should get you python.
    A camel is a racehorse designed by a committee.

    Seen sprayed on the outside wall of the local library -
    Three things I hate in life :
    1. Vandalism
    2. Irony
    3. Lists

  7. #7
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,023
    Quote Originally Posted by carsten_h View Post
    That is interesting!

    My LMS Server is on a Pi with piCorePlayer installation and the Bluetooth headphone will be connected to another Pi with piCorePlayer Installation and Jivelite on a 7" Display.
    Will this also work or does the speaker/headphone has to be connected to the Pi with LMS running?
    The script needs to be on the machine that has BT, it does not need to be on the same machine as LMS (bu then you need to provide the script the LMS IP/hostname). pCP has a similar, but more advanced (as it deals with BT sink, etc) script that I'd like to add this button functionality to.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

  8. #8
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,023
    Quote Originally Posted by Wirrunna View Post
    Python had to be added for a new pCP player, as detailed in this thread
    Python is already installed on pCP - its the extra modules (evdev and requests) that are required.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

  9. #9
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,350
    Most pCP installs will not have Python loaded. Loading Python would add 20% or 30% to the size of pCP.

    By default, pCP does have microPython loaded but with very few modules.

    Python is a optional extra that will be installed when required. I am not sure if pip is installed as a dependency of Python.

  10. #10
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,023
    Quote Originally Posted by Greg Erskine View Post
    Python is a optional extra that will be installed when required.
    Its on my pCP7 - but I'm guessing that is due to the bluetooth support.

    Quote Originally Posted by Greg Erskine View Post
    I am not sure if pip is installed as a dependency of Python.
    It's not. I installed it, and setuptools. However, 'pip install evdev' fails as it needs kernel headers

    Edit...

    Tried installing gcc linux-5.4.y_api_headers python3.8-setuptools python3.8-pip python3.8-dev, but pip install still fails

    Code:
        gcc: fatal error: cannot execute 'as': execvp: No such file or directory
        compilation terminated.
        error: command 'gcc' failed with exit status 1
        In file included from /tmp/tcloop/gcc/usr/local/lib/gcc/armv7l-unknown-linux-gnueabihf/10.1.0/include-fixed/syslimits.h:7,
                         from /tmp/tcloop/gcc/usr/local/lib/gcc/armv7l-unknown-linux-gnueabihf/10.1.0/include-fixed/limits.h:34,
                         from /usr/local/include/python3.8/Python.h:11,
                         from evdev/input.c:10:
        /tmp/tcloop/gcc/usr/local/lib/gcc/armv7l-unknown-linux-gnueabihf/10.1.0/include-fixed/limits.h:195:15: fatal error: limits.h: No such file or directory
          195 | #include_next <limits.h>  /* recurse down to the real one */
              |               ^~~~~~~~~~
        compilation terminated.
    Last edited by cpd73; 2021-04-23 at 06:23.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •