WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer  (Read 34299 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14770
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #30 on: April 18, 2015, 09:15:15 AM »
You need pygobject

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #31 on: April 18, 2015, 09:43:09 AM »
Yes... But does not exsist as a.tcz i bellive
Rgds; Jesper


Sent from my iPhone using Tapatalk

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14770
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #32 on: April 18, 2015, 10:13:10 AM »
sorry, but I didn't check - I only have x86{,_64} hardware

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #33 on: April 18, 2015, 12:31:09 PM »
 :) Cool...

I think i have to ask Bela' if he has any intention of building pygobject.

I try to build it, but there as dep. on dep. on dep. on it  :o

Rgds; Jesper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #34 on: April 18, 2015, 10:55:01 PM »
pygobject.tcz added to repo.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #35 on: April 19, 2015, 12:40:54 AM »
 :) Thanks Bela'

Nice nice!

I am missing something / something setup uncorrect? I Donno?

Have this error, even when pygobject is loaded

Quote
tc@PlayBox:~/bluez-4.101/test$ sudo python simple-agent
Traceback (most recent call last):
  File "simple-agent", line 5, in <module>
    from gi.repository import GObject
ImportError: No module named gi.repository

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #36 on: April 19, 2015, 12:53:31 AM »
No idea what is simple-agent. Importing module in Python works:


Code: [Select]
tc@box:~$ python
Python 2.7.9 (default, Dec 27 2014, 09:00:34)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import GObject
>>>
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14770
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #37 on: April 19, 2015, 12:54:02 AM »
I think you need pygobject-2.x rather than pygobject-3.x for bluez-4

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #38 on: April 19, 2015, 01:00:53 AM »
Bela' ::

The simple-agent, is a tool for pairing bluetooth devices supplied with the BlueZ4 package.

Look, when i try the same :

Quote
tc@PlayBox:~/bluez-4.101/test$ python
Python 2.7.9 (default, Dec 27 2014, 09:00:34)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import GObject
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named gi.repository
>>>

Juanito :: You might be right... Gobject must maybee be 2 instead of 3

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #39 on: April 19, 2015, 01:07:14 AM »
Bela'

Can you try this on your devel. machine ?

Quote
tc@PlayBox:~/bluez-4.101/test$ python
Python 2.7.9 (default, Dec 27 2014, 09:00:34)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']
>>>

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #40 on: April 19, 2015, 01:11:21 AM »
Code: [Select]
tc@box:~$ python
Python 2.7.9 (default, Dec 27 2014, 09:00:34)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']
>>>
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #41 on: April 19, 2015, 01:15:23 AM »
Hi.

tce-load -i pygobject.tcz did the trick!

Sry... i thought that when loading the pygobject-dev package, it would load the pygobject package.

 :-[

Rgds; Jesper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #42 on: April 19, 2015, 01:19:27 AM »

Sry... i thought that when loading the pygobject-dev package, it would load the pygobject package.


I does, but there was a typo in the dep file which was corrected and now ok. You were too fast.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #43 on: April 19, 2015, 01:42:38 AM »
Okay then.

I have desided to use Bluez4 for bluetooth streaming, cause bluez4 does support ALSA, which the new Bluez5 doesent.

I tried and succeded compiling bluez5, and pulseaudio with the bluez5 enabled. -Problem is, that pulseaudio uses way to much cpu power.
-anyway i never succeded streaming audio on bluez5.

So status now is :

Compiled and created bluez4-a.tcz (the -a is just for my own sake)
patched the .tcz file with the following : <allow send_type="method_call"/>, according to this : http://thethingsystem.com/dev/Bootstrapping-the-Raspberry-Pi.html

Quote
<policy user="root">
    <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent"/>
    <allow send_interface="org.bluez.HandsfreeAgent"/>
    <allow send_interface="org.bluez.MediaEndpoint"/>
    <allow send_interface="org.bluez.MediaPlayer"/>
    <allow send_interface="org.bluez.Watcher"/>
    <allow send_interface="org.bluez.ThermometerWatcher"/>
    <allow send_type="method_call"/>
  </policy>

I can start bluetoothd, and a bluetoothd --version gives me following :

Quote
tc@PlayBox:~/bluez-4.101/test$ bluetoothd --version
4.101

Top returns :

Quote
2231     1 root     S    12740  2.8   0 44.8 /home/tc/squeezelite/squeezelite-armv6hf -z -a 80  4  -n PlayBox -m xx xx xx xx xx 5E -s 192.168.1.133
10441  7331 tc       R     3124  0.7   0  1.2 top
 2298  1921 root     S     4832  1.0   0  0.4 sshd: tc@pts/0
    7     2 root     SW       0  0.0   0  0.2 [rcu_preempt]
 2288     1 root     S    17228  3.8   0  0.0 /usr/local/bin/shairport -d -a PlayBox -b 95
 1921     1 root     S     4748  1.0   0  0.0 /usr/local/sbin/sshd
 7943     1 root     S     4488  1.0   0  0.0 bluetoothd
 7331  7326 tc       S     3124  0.7   0  0.0 sh
 2301  2298 tc       S     3124  0.7   0  0.0 -sh
 1870     1 tc       S     3124  0.7   0  0.0 -sh
 7326  7296 root     S     3124  0.7   0  0.0 sh
 7283  2301 root     S     3124  0.7   0  0.0 sh
 7290  7288 root     S     3124  0.7   0  0.0 sh
 7296  7290 tc       S     3124  0.7   0  0.0 sh
 7288  7283 tc       S     3124  0.7   0  0.0 sh
 1874  1871 root     S     3016  0.6   0  0.0 /sbin/getty -L ttyAMA0 115200 vt100
    1     0 root     S     3012  0.6   0  0.0 init
 1871     1 root     S     3012  0.6   0  0.0 {startserialtty} /bin/sh /usr/sbin/startserialtty
 2247     1 root     S     3012  0.6   0  0.0 /sbin/udhcpc -b -i eth0 -x hostname PlayBox -p /var/run/udhcpc.eth0.pid
 7410     1 tc       S     2608  0.5   0  0.0 /usr/local/bin/dbus-daemon --system

So next step is to have the bluez4 scripts running (python)

A bluetooth scan seems to work  ;)

Quote
tc@PlayBox:~$ sudo hciconfig hci0 up
tc@PlayBox:~$ sudo hcitool scan
Scanning ...
   xx:xx:xx:xx:xx:1D   iPhone
tc@PlayBox:~$ sudo hciconfig -a
hci0:   Type: BR/EDR  Bus: USB
   BD Address: 00:1A:7D:DA:71:15  ACL MTU: 310:10  SCO MTU: 64:8
   UP RUNNING PSCAN
   RX bytes:4051 acl:0 sco:0 events:84 errors:0
   TX bytes:1105 acl:0 sco:0 commands:68 errors:0
   Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
   Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
   Link policy: RSWITCH HOLD SNIFF PARK
   Link mode: SLAVE ACCEPT
   Name: 'PlayBox-0'
   Class: 0x400100
   Service Classes: Telephony
   Device Class: Computer, Uncategorized
   HCI Version: 4.0 (0x6)  Revision: 0x22bb
   LMP Version: 4.0 (0x6)  Subversion: 0x22bb
   Manufacturer: Cambridge Silicon Radio (10)

But for pairing i need the tools inside the bluez4 package.

This is here i am fighting the python.

Quote
tc@PlayBox:~/bluez-4.101/test$ ls
agent.c             hciemu.1            lmptest.c           service-did.xml     simple-service      test-input          test-serial-proxy
attest.c            hciemu.c            monitor-bluetooth   service-ftp.xml     test-adapter        test-manager        test-service
avtest.c            hsmicro             mpris-player.c      service-opp.xml     test-attrib         test-nap            test-telephony
bdaddr.8            hsplay              rctest.1            service-record.dtd  test-audio          test-network        test-textfile.c
bdaddr.c            hstest.c            rctest.c            service-spp.xml     test-device         test-oob            test-thermometer
btiotest.c          ipctest.c           sap-client          simple-agent        test-discovery      test-proximity      uuidtest.c
dbusdef.py          l2test.c            scotest.c           simple-endpoint     test-health         test-sap-server
gaptest.c           list-devices        sdptest.c           simple-player       test-health-sink    test-serial

So when trying to start e.g simple-agent i got :

Quote
tc@PlayBox:~/bluez-4.101/test$ python simple-agent
Traceback (most recent call last):
  File "simple-agent", line 5, in <module>
    from gi.repository import GObject
  File "/usr/local/lib/python2.7/site-packages/gi/__init__.py", line 27, in <module>
    from ._gi import _API
ImportError: libgirepository-1.0.so.1: cannot open shared object file: No such file or directory

It's hard to get going  ::)

Rgds; and goodmorning Jesper


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14770
Re: [ Need bluetooth] DIY Preamplifier with buildin Raspberry pi B streamer
« Reply #44 on: April 19, 2015, 01:50:54 AM »
libgirepository-1.0.so.1 is provided by gobject-introspection, which is a dep of pygobject.