I am working on the Bluetooth media player feature of an internet radio project written in C on Linux platform. The idea is:
- Connect to a nearby BT speaker which is supporting AVRCP profile
- Transmit audio through BT to the BT speaker
- Handle button push events
Initially I was following the MPRIS D-Bus Interface Specification: https://specifications.freedesktop.org/mpris-spec/latest/
If I understand it well, the specification tells the following:
- Request a unique bus name which looks like this: org.mpris.MediaPlayer2.AnyName
- Expose the /org/mpris/MediaPlayer2 object path
- Implement the following interfaces:
- org.mpris.MediaPlayer2
- org.mpris.MediaPlayer2.Player
All these steps are done. I am using the D-Feet D-bus tool to test property queries, method calls and all of them are working properly.
Now my problem is, that when I connect to a BT speaker and I push the buttons, the application is not getting the events.
Can you please point out what I am missing and what should I do next?
Thanks in advance!
PM: Sorry if I am not clear, I am a newborn programmer and Stackoverflow user. Please ask me if you need more information. I will appreciate any advice you have :)
EDIT1: The source I have is 1200 line long and I dont know what can I extract from the code for you. But FYI I am using the High-level D-Bus Support of GLib: https://developer.gnome.org/gio/stable/gdbus-convenience.html