1

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

  • Hi, welcome to Stackoverflow. Would you be able to share some of the code that you've written which relates to your question? – Matt Mar 18 '16 at 10:30
  • The code right now is 1200 lines long. I don't know if I can extract snippets of the code. Instead I will edit my post and add a line that I am using High-level D-Bus Support of Glib. – Posta Istvan Mar 18 '16 at 10:41

1 Answers1

0

uinput module is used to write AVRCP key commands, hence you will require a client to read from uinput when BT headset(A2DP) is connected, check in profiles/audio/avctp.c::uinput_create(), when a avrcp profile is connected, keys are send from handle_panel_passthrough() function to uinput module in kernel

ashish
  • 1,384
  • 1
  • 12
  • 21