Page 1 of 1

Raspberry Pi b+ does not work with the Headset JeTech H0781

Posted: Fri Apr 24, 2015 12:03 pm
by ole359
Hello,
I’m trying to get the headset H0781 to work with raspberry pi b+. The headset is in discovery mode:

My commands and respective output:

Code: Select all

uname -a
Linux two 3.18.10+ #774 PREEMPT Wed Mar 25 13:58:34 GMT 2015 armv6l GNU/Linux

Code: Select all

hcitool scan
Scanning ...
07:81:02:15:86:12 JETech H0781

Code: Select all

sudo bluez-test-device trusted 07:81:02:15:86:12 yes

Code: Select all

sudo bluez-test-input connect 07:81:02:15:86:12
Traceback (most recent call last):
File "/usr/bin/bluez-test-input", line 40, in <module>
input.Connect()
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.bluez.Error.NotSupported: Operation is not supported

What is going wrong here? Is it headset related? How can I get the headset to work?

Re: Raspberry Pi v+ does not work with the Headset JeTech H0

Posted: Fri Apr 24, 2015 2:41 pm
by ole359
At first, by looking at /var/log/messages I found that the firmware file firmware/brcm/BCM20702A0-0a5c-21ec.hcd could not be found. I downloaded fw-0a5c_21ec.hcd and copied into /lib/firmware/brcm/BCM20702A0-0a5c-21ec.hcd as suggested in http://plugable.com/2014/06/23/plugable ... s-on-linux
The complains are now gone. But the connect is still not working:

Code: Select all

sudo bluez-test-input connect 07:81:02:15:86:12
still gives:

File "/usr/bin/bluez-test-input", line 40, in <module>
input.Connect()
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.bluez.Error.NotSupported: Operation is not supported

Re: Raspberry Pi v+ does not work with the Headset JeTech H0

Posted: Fri Apr 24, 2015 3:01 pm
by Douglas6
Bluez-test-input is for HID devices, like keyboards. Try bluez-test-audio. I'm afraid I don't have a headset, so can't be much help.

Re: Raspberry Pi v+ does not work with the Headset JeTech H0

Posted: Fri Apr 24, 2015 3:27 pm
by ole359
Douglas6 wrote:Bluez-test-input is for HID devices, like keyboards. Try bluez-test-audio. I'm afraid I don't have a headset, so can't be much help.
Thanks! I have replaced bluez-test-input with bluez-test-audio. The error message is gone!

Code: Select all

aplay -L
gives

Code: Select all

default
    Playback/recording through the PulseAudio sound server
But still, I can't hear anything while playing a wav file on raspberry pi. And I get new errors in /var/log/messages:
...
Apr 24 17:19:08 two pulseaudio[3634]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
...
My raspberry pi is headless. Any ideas?

Re: Raspberry Pi v+ does not work with the Headset JeTech H0

Posted: Fri Apr 24, 2015 4:15 pm
by ole359
viewtopic.php?t=31961&p=278613 suggests to put

Code: Select all

DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
DBUS_SESSION_BUS_PID=`cat /run/dbus/pid`
into

Code: Select all

/etc/rc.local
After doing this and rebooting the headset works! Still, the sound is very dull.

Re: Raspberry Pi v+ does not work with the Headset JeTech H0

Posted: Fri Apr 24, 2015 4:18 pm
by Douglas6
Looks like you're running Pulseadio in user mode? I always use system-wide mode, but here are a few things to try. First, add your user to the 'lp' group, that might help with D-Bus issues. Also add to the pulse-access group, to get access to the pactl command (may not be required in user mode):

Code: Select all

sudo adduser pi lp
sudo adduser pi pulse-access
You should have the PA module-bluetooth-discovery module loaded; check it with

Code: Select all

pactl list modules
and you should see something like

Code: Select all

Module #12
        Name: module-bluetooth-discover
        Argument:
        Usage counter: n/a
        Properties:
                module.author = "Joao Paulo Rechi Vita"
                module.description = "Detect available bluetooth audio devices and load bluetooth audio drivers"
                module.version = "2.0"
You have the headset paired and trusted already, so if the headset is connected, you should also see a module-bluetooth-device corresponding to your headset. If you're lucky, you'll have a corresponding PA sink;

Code: Select all

pactl list sinks
to see. One last step, you want to loop back the default Pulseaudio source to your headset sink. Something like:

Code: Select all

pactl load-module module-loopback source=0 sink=bluez_sink.AA_BB_CC_DD_EE_FF
It's just that easy*.

*With BlueZ, it's NEVER that easy, but I hope that helps a little

Re: Raspberry Pi v+ does not work with the Headset JeTech H0

Posted: Fri Apr 24, 2015 4:30 pm
by Douglas6
ole359 wrote:After doing this and rebooting the headset works! Still, the sound is very dull.
AH, good, ignore everything I said, then :) pactl has a volume control, something like

Code: Select all

pactl set-sink-volume bluez_sink.AA_BB_CC_DD_EE_FF 100%
if it's not at 100% already (pactl list sinks should tell you.)

Re: Raspberry Pi v+ does not work with the Headset JeTech H0

Posted: Sat Apr 25, 2015 4:24 pm
by ole359
Thanks, the playback is working now. The next problem is to get the microphone to record. I have bluez 4.99 installed, so the mike should be supported? It is not recording now. Any suggestions are welcomed!

Re: Raspberry Pi v+ does not work with the Headset JeTech H0

Posted: Sat Apr 25, 2015 6:17 pm
by Douglas6
Use the 'pactl list sources' command to see if BlueZ has set up an audio source for your headset. If so, you can use the given name for commands such as 'parecord'. If not, maybe someone else with a BT headset can chime in here.