a2dp to stereo speakers

Plugging in devices such as LAN adapters, Wi-Fi cards, printers, etc. to Arch Linux ARM.

a2dp to stereo speakers

Postby pepedog » Mon May 02, 2011 7:38 pm

Has anyone done this, I have seen so many conflicting methods.
Did find a script somewhere that scans, adds device after asking for pass phrase, etc, but it no longer works as based on python 2.4
pepedog
Developer
 
Posts: 1664
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: a2dp to stereo speakers

Postby pepedog » Thu May 05, 2011 1:09 pm

I got this working, don't remember now packages, think it was
pacman -S bluez-firmware bluez python-pybluez
Might also have been
yaourt -S bluez-tools

[root@PBLinux ~]# hciconfig -a hci0 up
[root@PBLinux ~]# hcitool scan # which gave me the mac of audio, which was in pair mode
[root@PBLinux ~]# bluez-simple-agent hci0 00:16:8D:01:63:B2 # was asked for pin

My /etc/asound.conf
Code: Select all
pcm.!default {
   type plug
   slave.pcm "bluetooth"
}

ctl.mixer0 {
   type hw
   card 0
}

pcm.bluetooth {
       type bluetooth
       device "00:16:8D:01:63:B2"
       profile "auto"
}

Got a 44100 wav sample
Code: Select all
wget http://freewavesamples.com/files/Roland-GR-1-Pick-Bass-2-C4.wav

And played it
Code: Select all
[root@PBLinux ~]# aplay -Dplug:bluetooth Roland-GR-1-Pick-Bass-2-C4.wav
aplay Roland-GR-1-Pick-Bass-2-C4.wav #also seems to work as default device

Even shairport is streaming from iTunes, the out thru dockstar bluetooth, works without a skip
pepedog
Developer
 
Posts: 1664
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: a2dp to stereo speakers

Postby ygator » Sun Jul 31, 2011 2:50 am

pepedog,

I am trying to do this as well. Everything seems to work up to the point where I try the play a file.
I am getting:
bt_audio_service_open: connect() failed: Connection refused (111)
aplay: main:660: audio open error: Connection refused

If you still have this functioning can you let me know what you have in your /etc/bluetooth/audio.conf file?

thanks
ygator
 
Posts: 77
Joined: Tue Aug 10, 2010 9:37 pm

Re: a2dp to stereo speakers

Postby pepedog » Sun Jul 31, 2011 8:44 am

/etc/bluetooth/audio.conf, I think this more for i/c signal
Code: Select all
Bluetooth Service
Identifier=audio
Name=Audio service
Description=Bluetooth Audio service
Autostart=true

[A2DP]
SBCSources=1
MPEG12Sources=0
SBCSinks=
MPEG12Sinks=


Is bluetooth daemon running, I spent a while on this at the time, thought I posted originally all that was needed
More stuff in /usr/share/alsa
pepedog
Developer
 
Posts: 1664
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: a2dp to stereo speakers

Postby ygator » Sun Jul 31, 2011 5:41 pm

Yes, dbus and bluetooth are both running.

Did you make changes to any of the files in /usr/share/alsa ?
If so can you post their contents.

Thanks
ygator
 
Posts: 77
Joined: Tue Aug 10, 2010 9:37 pm

Re: a2dp to stereo speakers

Postby pepedog » Sun Jul 31, 2011 8:50 pm

I never touched them, I noticed in ubuntu that the symlink files in etc to odd files in /use/share/alsa
Did the bt scan work? That's one part, then once connected and you can play sound, it survives reboot
pepedog
Developer
 
Posts: 1664
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: a2dp to stereo speakers

Postby ygator » Sun Jul 31, 2011 11:47 pm

I was following the archlinux wiki on the subject.
I did the following after installing the software.
/etc/rc.d/dbus start
/etc/rc.d/bluetooth start
hciconfig -a hci0 up
# put bt speakers into pairing mode
hcitool scan
# saw the bt speakers
bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX
#entered 0000 as pin
#edited /etc/asound.conf like the wiki and also tried what you posted
aplay -D btspeakers test.wav

I get the connection refused.

Do you show any connections when you do the command "hcitool -i hci0 con"?
ygator
 
Posts: 77
Joined: Tue Aug 10, 2010 9:37 pm

Re: a2dp to stereo speakers

Postby pepedog » Mon Aug 01, 2011 12:18 am

I am going to have to set this all up again. In the mean time, make sure the services start on boot, and reboot.
pepedog
Developer
 
Posts: 1664
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: a2dp to stereo speakers

Postby ygator » Mon Aug 01, 2011 12:46 am

Here are some commands with the output:
Code: Select all
# hciconfig
hci0:   Type: BR/EDR  Bus: USB
        BD Address: 00:02:72:XX:XX:XX  ACL MTU: 1022:8  SCO MTU: 121:3
        UP RUNNING PSCAN
        RX bytes:6311 acl:11 sco:0 events:157 errors:0
        TX bytes:1539 acl:12 sco:0 commands:99 errors:0
# hciconfig -a hci0
hci0:   Type: BR/EDR  Bus: USB
        BD Address: 00:02:72:XX:XX:XX  ACL MTU: 1022:8  SCO MTU: 121:3
        UP RUNNING PSCAN
        RX bytes:6311 acl:11 sco:0 events:157 errors:0
        TX bytes:1539 acl:12 sco:0 commands:99 errors:0
        Features: 0xff 0xfe 0x0d 0xfe 0x98 0x7f 0x79 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF
        Link mode: SLAVE ACCEPT
        Name: 'hostname.com-0'
        Class: 0x000100
        Service Classes: Unspecified
        Device Class: Computer, Uncategorized
        HCI Version: 3.0 (0x5)  Revision: 0x9999
        LMP Version: 3.0 (0x5)  Subversion: 0x9999
        Manufacturer: Atheros Communications, Inc. (69)
# hcitool -i hci0 dev
Devices:
        hci0    00:02:72:XX:XX:XX

# hcitool -i hci0 scan
Scanning ...
        00:0C:78:XX:XX:XX       BT90S
# hcitool -i hci0 info 00:0C:78:4XX:XX:XX
Requesting information ...
        BD Address:  00:0C:78:XX:XX:XX
        Device Name: BT90S
        LMP Version: 2.0 (0x3) LMP Subversion: 0xb12
        Manufacturer: Cambridge Silicon Radio (10)
        Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
# hcitool -i hci0 con
Connections:
ygator
 
Posts: 77
Joined: Tue Aug 10, 2010 9:37 pm

Re: a2dp to stereo speakers

Postby ygator » Mon Aug 01, 2011 1:38 am

Here is an lsmod. I read in a post that a guy with a similar problem did a
modprobe l2cap
modprobe rfcomm

as you can see in my lsmod I have rfcomm, but not l2cap. Could that be the problem?

Code: Select all
# lsmod
Module                  Size  Used by
rfcomm                 32056  0
ath3k                   4093  0
bnep                    7628  2
ipv6                  238329  10
btusb                  10179  3
bluetooth             110684  19 rfcomm,bnep,btusb
rfkill                 14403  2 bluetooth
mv_cesa                 8959  0


I can l2ping the device okay and that uses l2cap, so I guess that is not the problem.
Code: Select all
# l2ping 00:0C:78:XX:XX:XX
Ping: 00:0C:78:XX:XX:XX from 00:02:72:XX:XX:XX (data size 44) ...
4 bytes from 00:0C:78:XX:XX:XX id 0 time 15.95ms
4 bytes from 00:0C:78:XX:XX:XX id 1 time 32.16ms
4 bytes from 00:0C:78:XX:XX:XX id 2 time 32.39ms
4 bytes from 00:0C:78:XX:XX:XX id 3 time 32.22ms
ygator
 
Posts: 77
Joined: Tue Aug 10, 2010 9:37 pm

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 1 guest