Registered Member
|
I am new to Bluetooth Programing.
My aim is to write program to hear song in raspberry pi through A2DP played from mobile phone. After some studies I Plan to use KDE BLUEZQT because I am familiar with Qt programing. My setup as follows 1. Raspberry Pi 4 2. Installed Latest version of Raspbian OS 3. Build and installed QT5.14 in the Raspberry. 4. Then using bluetoothctl I was able to play or hear the Audio from raspberry pi through A2DP. 5. Installed BluezQt version 5.68.0 using following command and installation was successful cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) -DCMAKE_INSTALL_INCLUDEDIR=include -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-std=c++11 -DKDE_INSTALL_QMLDIR=/opt/Qt5.14/qml -DECM_MKSPECS_INSTALL_DIR=/opt/Qt5.14/mkspecs/modules -DCMAKE_PREFIX_PATH=/opt/Qt5.14 6.I used Qt creator to create applications similar to sample program from /bluez-qt/tests path, Chat profile, device receiver. Both the application was working. 7. Then I started to use the mediaendpointconnect example, I was able to pair and connect with the mobile phone but when I started to play song from mobile phone, error was thrown as below. Transport state: BluezQt::MediaTransport::State::Pending org.kde.bluez: PendingCall Error: "Operation Not Authorized" fd: -1 mtu read: 0 mtu write: 0 8. D-Bus error is thrown when the calling TPendingCall<QDBusUnixFileDescriptor, uint16_t, uint16_t> *fd = transport->tryAcquire(); // After 2 weeks of struggle I could not able to find out what causes this issue. Snapshot of Code as follow BTAudioDemo.pro
audioendpointconnector.cpp
main.cpp files.
|
Registered Member
|
Dear All,
I was able to solve this issue, I configured bluealsa with profile option a2dp-sink. Once I removed the option "-p a2dp-sink" from file /lib/systemd/system/bluealsa.service and reboot which I configured earlier. My application can call transport->tryAcquire function and able to get file discriptor successfully. |
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]