How to play an audio file using bluetooth speaker on warpx imx6 board ?

41 views
Skip to first unread message

TitusRathinaraj Stalin

unread,
Aug 8, 2017, 1:28:05 PM8/8/17
to >warpx.io
Hello Experts,

Want to interface the Bluetooth speaker to warpx board.
I have configured the pulseaudio and able to pair & connect the bluetooth speaker.

"pactl list modules" command output gives following log:

Module #19
    Name: module-bluez5-discover
    Argument:
    Usage counter: n/a
    Properties:
        module.author = "João Paulo Rechi Vita"
        module.description = "Detect available BlueZ 5 Bluetooth audio devices and load BlueZ 5 Bluetooth audio drivers"
        module.version = "9.0"

Module #20
    Name: module-bluez5-device
    Argument: path=/org/bluez/hci0/dev_00_1F_47_A6_B1_B8
    Usage counter: 0
    Properties:
        module.author = "João Paulo Rechi Vita"
        module.description = "BlueZ 5 Bluetooth audio sink and source"
        module.version = "9.0"
warpx-imx6:~$

Seems, the my BT speaker 00_1F_47_A6_B1_B8 was connected... but when I play wav file using aplay command, got the below error.

warpx-imx6:/$ aplay audio_test.wav
ALSA lib ../../../alsa-lib-1.1.2/src/pcm/pcm_direct.c:1604:(_snd_pcm_direct_get_slave_ipc_offset) Invalid value for card
aplay: main:786: audio open error: No such file or directory
warpx-imx6:/$
warpx-imx6:/$ aplay -l
aplay: device_list:268: no soundcards found...
warpx-imx6:/$


With root user:
============


With root user, I can access the pulse audio volume control (pavucontrol).

Module #21
    Name: module-bluetooth-discover
    Argument:
    Usage counter: n/a
    Properties:
        module.author = "João Paulo Rechi Vita"
        module.description = "Detect available Bluetooth daemon and load the corresponding discovery module"
        module.version = "9.0"

Module #22
    Name: module-bluez5-discover
    Argument:
    Usage counter: n/a
    Properties:
        module.author = "João Paulo Rechi Vita"
        module.description = "Detect available BlueZ 5 Bluetooth audio devices and load BlueZ 5 Bluetooth audio drivers"
        module.version = "9.0"

Module #23
    Name: module-bluez5-device
    Argument: path=/org/bluez/hci0/dev_00_1F_47_A6_B1_B8
    Usage counter: 1
    Properties:
        module.author = "João Paulo Rechi Vita"
        module.description = "BlueZ 5 Bluetooth audio sink and source"
        module.version = "9.0"
root@warpx-imx6:/#
root@warpx-imx6:/#



root@warpx-imx6:/# pactl list cards short
0    alsa_card.platform-sound-spdif    module-alsa-card.c
1    alsa_card.platform-sound    module-alsa-card.c
2    bluez_card.00_1F_47_A6_B1_B8    module-bluez5-device.c
root@warpx-imx6:/#
root@warpx-imx6:/#


Regards,
Titus S.

Diego Rondini

unread,
Aug 16, 2017, 12:10:12 PM8/16/17
to wa...@googlegroups.com
Hi Titus,

On martedì 8 agosto 2017 19:28:04 CEST TitusRathinaraj Stalin wrote:
> Hello Experts,
>
> Want to interface the Bluetooth speaker to warpx board.
> I have configured the pulseaudio and able to pair & connect the bluetooth
> speaker.
>
> *"pactl list modules*" command output gives following log:
> warpx-imx6:/$ *aplay -l*
> aplay: device_list:268: no soundcards found...
> warpx-imx6:/$
>
>
>
> *With root user:============*
>
> With root user, I can access the pulse audio volume control (pavucontrol).
>
> Module #21
> Name: module-bluetooth-discover
> Argument:
> Usage counter: n/a
> Properties:
> module.author = "João Paulo Rechi Vita"
> module.description = "Detect available Bluetooth daemon and load
> the corresponding discovery module"
> module.version = "9.0"
>
> Module #22
> Name: module-bluez5-discover
> Argument:
> Usage counter: n/a
> Properties:
> module.author = "João Paulo Rechi Vita"
> module.description = "Detect available BlueZ 5 Bluetooth audio
> devices and load BlueZ 5 Bluetooth audio drivers"
> module.version = "9.0"
>
> Module #23
> Name: module-bluez5-device
> Argument: path*=/org/bluez/hci0/dev_00_1F_47_A6_B1_B8*
> Usage counter: 1
> Properties:
> module.author = "João Paulo Rechi Vita"
> module.description = "BlueZ 5 Bluetooth audio sink and source"
> module.version = "9.0"
> root@warpx-imx6:/#
> root@warpx-imx6:/#
>
>
>
> root@warpx-imx6:/# p*actl list cards short*
> 0 alsa_card.platform-sound-spdif module-alsa-card.c
> 1 alsa_card.platform-sound module-alsa-card.c
> 2 bluez_card.00_1F_47_A6_B1_B8 module-bluez5-device.c
> root@warpx-imx6:/#
> root@warpx-imx6:/#
>
>

I don't have an easy fix at hand, but here's my feedback:
1) I have Bluetooth headphones connected to my Linux PC, but they are not
listed by alsa as a soundcard (aplay -l), there are fully managed by
pulseaudio
2) I have "pulse" as a PCM (aplay -L , mind the capital "L"), so I'm able to
play an audio file with:
$ aplay --device=pulse audiofile.wav

I'll likely try some other Bluetooth features on the warp_0x01 in the coming
weeks, so let me know if you're still having problems, I might have the chance
to quickly give it a shot.

By the way, in the case it helps, we've been working on updating our warpx
meta-layer support lately, including your accel / mag contribution:
https://github.com/Kynetics/meta-warpx
You'll find two new branches: 'master' which has been tested lately with poky
master (and other layers too), and 'pyro' which works with two patches to
backport manually:
http://cgit.openembedded.org/meta-openembedded/commit/meta-oe/recipes-devtools/sip/sip_4.19.2.bb?id=229f824568406df354bc857b31989a7777d778bb
https://github.com/meta-qt5/meta-qt5/commit/
3c4f2cba1ff6925da20bcf4469526aceee80ad90


Bests,
Diego Rondini
Sr. Embedded Engineer

Kynetics
www.kynetics.com

TitusRathinaraj Stalin

unread,
Aug 18, 2017, 10:59:46 AM8/18/17
to >warpx.io, diego....@kynetics.com
Hi Diego,

Thanks for your reply.
I am able to play music file now after long try.

It worked:
gst-launch-1.0 filesrc location=test_audio.mp3 ! decodebin ! audioconvert ! pulsesink device=bluez_sink.00_1F_47_A6_B1_B8

I hope it may helps someone.

Regards,
Titus S.
Reply all
Reply to author
Forward
0 new messages