Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: lykkedk on April 11, 2015, 04:49:28 AM
-
Hi all.
I have been very busy, last few months creating my new Preamp., with raspberry pi buildin.
I allway's end up with some diy hifi equipment, with lots of features and boxes, with power switches :)... So i wanted something simple this time, which is easy for also my kids and wife to use.
This preamp, has no but a powerswitch at back, turning everything on with just one click. -When preamp. turns on, it automatic turns on my poweramp. -So piCore is the only usefull system, for such a system i guess 8)
So, while enjoying radio/music/streams, i thought it would be fun to have a bluetooth attached also, so i found one and plugged in the last spare usb-port of the PI.
I posted some quistions at another topic http://forum.tinycorelinux.net/index.php/topic,17945.0.html (http://forum.tinycorelinux.net/index.php/topic,17945.0.html).
But i think it would be better to open up a new thread on this.
This i installed from tce :
tce - Tiny Core Extension browser
1. bluetooth-3.12.36-piCore+.tcz
2. bluez-hcidump-doc.tcz
3. bluez-hcidump.tcz
But i need other tools, like bluez, bluez-utils, bluez-tools, blues-alsa etc...
Well i will wait and see, if someone chimes in here.
(http://i1312.photobucket.com/albums/t535/Jesperlykke/PlayBox%20final/A6226D47-9AE9-44B6-8743-3A811B955250_zps6uscub2p.jpg)
(http://i1312.photobucket.com/albums/t535/Jesperlykke/PlayBox%20final/606CAF63-9F20-439E-896C-E17388175B27_zpsnn1ssnnm.jpg)
-
You can find the corepure64 instructions to compile bluez here:
http://www.tinycorelinux.net/6.x/x86_64/tcz/src/bluez/compile_bluez
..it should be relatively easy to modify these for your purposes.
Note that it is awkward to use bluetooth with alsa alone, but much easier to use it with pulseaudio at the cost of a lot of bloat.
-
Thank.. Will look into this.
Sent from my iPhone using Tapatalk
-
:) Apperantly i connot make it!
I think i need the GLIB2 >= 2.28... Maybe Bela' have an idea of why it does not compile.
tc@PlayBox:~/bluetooth/bluez-5.30$ ls
AUTHORS Makefile.am README btio/ config.sub emulator/ missing test/
BAK-config.log Makefile.in TODO client/ configure gdbus/ monitor/ tools/
COPYING Makefile.obexd acinclude.m4 compile configure.ac gobex/ obexd/ unit/
COPYING.LIB Makefile.plugins aclocal.m4 config.guess configure.lineno install-sh plugins/
ChangeLog Makefile.tools android/ config.h.in depcomp lib/ profiles/
INSTALL NEWS attrib/ config.log doc/ ltmain.sh src/
tc@PlayBox:~/bluetooth/bluez-5.30$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... none
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for pkg-config... no
checking for C/C++ restrict keyword... __restrict
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking whether gcc and cc understand -c and -o together... yes
checking whether gcc accepts -fPIE... yes
checking build system type... armv6l-unknown-linux-gnueabihf
checking host system type... armv6l-unknown-linux-gnueabihf
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/local/bin/ld
checking if the linker (/usr/local/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/local/bin/nm -B
checking the name lister (/usr/local/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking how to convert armv6l-unknown-linux-gnueabihf file names to armv6l-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert armv6l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
checking for /usr/local/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/local/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/local/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for signalfd... yes
checking for clock_gettime in -lrt... yes
checking for pthread_create in -lpthread... yes
checking for dlopen in -ldl... yes
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking linux/if_alg.h usability... yes
checking linux/if_alg.h presence... yes
checking for linux/if_alg.h... yes
checking for GLIB... no
configure: error: GLib >= 2.28 is required
tc@PlayBox:~/bluetooth/bluez-5.30$
Rgds; Jesper
-
You need to install pkg-config, and maybe other packages.
-
So.
I created pkg-config from this source http://pkgconfig.freedesktop.org/releases/ (http://pkgconfig.freedesktop.org/releases/)
It compiled without problems, and therefore i created a .tcz for the sake of it. (Only pkg-config.list here, due to attachment size :))
I loaded it, and tried to run ./configure on my bluez 5.30 once more, but no change. -Compiler stops at same error.
Rgds; Jesper.
-
So.
I now loaded my newly build pkg-config.tzc, and did export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig.
Now ./configure finds the GLIB :)
It now stops at another error? -As i think udev is complicated, it might be hard to go pass this error.
What i have loaded is this :
libudev-dev
squashfs-tools
dbus-glib-dev
readline-dev
glib2-locale
glib2-python
glib2-dev
mc
nano
zip
bluetooth-3.12.36-piCore+
bluez-hcidump
usbutils
compile-essentials
linux-3.12.y_api_headers
/home/tc/pkg-config
Commandline snippet :
checking for GLIB... yes
checking for DBUS... yes
checking D-Bus configuration directory... /usr/local/etc
checking D-Bus system bus services dir... /usr/local/share/dbus-1/system-services
checking D-Bus session bus services dir... /usr/local/share/dbus-1/services
checking for UDEV... yes
checking for udev_hwdb_new in -ludev... no
checking udev directory... configure: error: udev directory is required
Rgds; Jesper.
-
If you compile pkg-config with:
--with-pc-path="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/share/pkgconfig"
..you won't need to set $PKG_CONFIG_PATH everytime.
Are /etc/udev/rules.d and /lib/udev present?
-
There's a pre-existing pkg-config extension, as well.
-
Juanito .
Are /etc/udev/rules.d and /lib/udev present?
Yes :)
tc@PlayBox:~/bluetooth/bluez-5.30$ ls -all /etc/udev/rules.d
total 56
drwxrwxr-x 2 root staff 340 Jan 1 1970 ./
drwxrwxr-x 3 root staff 60 Jan 1 1970 ../
-rw-rw-r-- 1 root staff 764 Jan 14 08:17 42-qemu-usb.rules
-rw-rw-r-- 1 root staff 277 Jan 14 08:17 50-firmware.rules
-rw-rw-r-- 1 root staff 3831 Jan 14 08:17 50-udev-default.rules
-rw-rw-r-- 1 root staff 167 Jan 14 08:17 55-tc.rules
-rw-rw-r-- 1 root staff 104 Jan 14 08:17 56-lsusb.rules
-rw-rw-r-- 1 root staff 308 Jan 14 08:17 60-cdrom_id.rules
-rw-rw-r-- 1 root staff 616 Jan 14 08:17 60-persistent-alsa.rules
-rw-rw-r-- 1 root staff 2400 Jan 14 08:17 60-persistent-input.rules
-rw-rw-r-- 1 root staff 947 Jan 14 08:17 60-persistent-serial.rules
-rw-rw-r-- 1 root staff 2669 Jan 14 08:17 60-persistent-storage.rules
-rw-rw-r-- 1 root staff 239 Jan 14 08:17 75-cd-dvd.rules
-rw-rw-r-- 1 root staff 657 Jan 14 08:17 80-drivers.rules
lrwxrwxrwx 1 root root 49 Jan 1 1970 90-alsa-restore.rules -> /usr/local/etc/udev/rules.d/90-alsa-restore.rules
-rw-rw-r-- 1 root staff 155 Jan 14 08:17 95-udev-late.rules
-rw-rw-r-- 1 root staff 294 Jan 14 08:17 98-tc.rules
tc@PlayBox:~/bluetooth/bluez-5.30$ ls -all /lib/udev
total 4
drwxrwxr-x 2 root staff 60 Jan 1 1970 ./
drwxr-xr-x 4 root root 1060 Jan 31 17:29 ../
-rwxrwxr-x 1 root staff 568 Jan 14 08:17 firmware.sh
-
Then I guess you'll need to look in config.log to see why you get this:
checking udev directory... configure: error: udev directory is required
-
Hi.
Not much :
configure:13415: checking udev directory
configure:13419: error: udev directory is required
Rgds; Jesper.
-
How about line 13419 of the configure script?
-
Hi back...
First of, the link you gave me earlier, with instructions for compiling on core64, the line with
tce-load -i dbus-glib-dev libical-dev readline-dev udev-lib-dev
I better tell, that both libical-dev and udev-lib-dev is nonexistant on piCore (will try to build later maybee)
If i --disable -with udev, in configure, the scripts end at missing libical.
Anyway, you asked about line 13419 :)
Line 13419 is where the * is :)
# Check whether --with-udevdir was given.
if test "${with_udevdir+set}" = set; then :
withval=$with_udevdir; path_udevdir=${withval}
fi
if (test "${enable_udev}" != "no" && test -z "${path_udevdir}"); then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking udev directory" >&5
$as_echo_n "checking udev directory... " >&6; }
path_udevdir="`$PKG_CONFIG --variable=udevdir udev`"
if (test -z "${path_udevdir}"); then
* as_fn_error $? "udev directory is required" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${path_udevdir}" >&5
$as_echo "${path_udevdir}" >&6; }
fi
UDEV_DIR=${path_udevdir}
-
I guess it's called libudev-dev rather than udev-lib-dev in the raspberry repo and I'd also guess there's a ./configure switch to disable libical (check "./configure --help").
Do you have libudev-dev loaded?
-
Thanks again :)
Yes libudev is loaded...
I will try to disable libical later today, thanks... but configure still stops at udev directory, if i not disable it... do i need udev ???
here is what i load, when i login to the PI :
jesper@jlp:~$ ssh tc@192.168.1.108
tc@192.168.1.108's password:
libudev-dev is already installed!
squashfs-tools is already installed!
dbus-glib-dev is already installed!
readline-dev is already installed!
glib2-locale is already installed!
glib2-python is already installed!
glib2-dev is already installed!
mc is already installed!
nano is already installed!
zip is already installed!
bluetooth-3.12.36-piCore+ is already installed!
bluez-hcidump is already installed!
usbutils is already installed!
compile-essentials is already installed!
linux-3.12.y_api_headers is already installed!
/home/tc/pkg-config is already installed!
All programs loaded now ... Enjoy!
-
Good news!
./configure --prefix=/usr/local --with-udevdir=/etc/udev - SUCCESS!
checking for GLIB... yes
checking for DBUS... yes
checking D-Bus configuration directory... /usr/local/etc
checking D-Bus system bus services dir... /usr/local/share/dbus-1/system-services
checking D-Bus session bus services dir... /usr/local/share/dbus-1/services
checking for UDEV... yes
checking for udev_hwdb_new in -ludev... no
checking for ICAL... no
configure: error: libical is required
Rgds; Jesper.
-
:) Evening...
So i have compiled and created a libical.tcz succesfully.
So when running configure, as pasted below, configure ends with no error.
But make, gives the error (Se below)
./configure --prefix=/usr/local --disable-static --localstatedir=/var --libexecdir=/usr/local/lib --disable-systemd
--enable-library --with-udevdir=/etc/udev
MAKE Error :
/usr/local/lib/libreadline.so: undefined reference to `tputs'
/usr/local/lib/libreadline.so: undefined reference to `tgoto'
/usr/local/lib/libreadline.so: undefined reference to `tgetflag'
/usr/local/lib/libreadline.so: undefined reference to `UP'
/usr/local/lib/libreadline.so: undefined reference to `tgetent'
/usr/local/lib/libreadline.so: undefined reference to `tgetnum'
/usr/local/lib/libreadline.so: undefined reference to `PC'
/usr/local/lib/libreadline.so: undefined reference to `tgetstr'
/usr/local/lib/libreadline.so: undefined reference to `BC'
collect2: error: ld returned 1 exit status
Makefile:3518: recipe for target 'client/bluetoothctl' failed
make[1]: *** [client/bluetoothctl] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:2718: recipe for target 'all' failed
make: *** [all] Error 2
I found this thread regarding readline / ncurses, witch i have installed.
http://forum.tinycorelinux.net/index.php?topic=15251.0 (http://forum.tinycorelinux.net/index.php?topic=15251.0)
But i can't seem to find a way to get pass this error
Rgds; Jesper.
-
SUCCESS ;)
Thanks all... so far i have compiled and installed libical, pkg-config, and bluez-5.30 (Had to "patch" 5-7 lines with -lncurses)
I will continue later, today when back from home experiemental !
tc@PlayBox:~$ lsusb
Bus 001 Device 005: ID 20b1:2009 XMOS Ltd
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. SMC9512/9514 USB Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
tc@PlayBox:~$
tc@PlayBox:~$ hciconfig scan
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 ISCAN
RX bytes:2713 acl:0 sco:0 events:69 errors:0
TX bytes:811 acl:0 sco:0 commands:63 errors:0
tc@PlayBox:~$ hcitool scan
Scanning ...
xx:xx:xx:xx:xx:1D iPhone
tc@PlayBox:~$
Good Morning; Jesper.
-
So i am near now.
Patched Makefile.in, and export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig etc... etc.. etc..
./configure and make runs fine!
I have created a bluez-5.30.tcz, which is loading fine.
But i miss something.
I have only done the ::
mkdir /home/tc/package
make DESTDIR=/home/tc/package install
And then cd /home/tc, mksquashfs package bluez-5.30.tcz
How do i include this BELOW in my .tcz ???
sudo install -dm755 /usr/local/etc/bluetooth
sudo install -m644 src/main.conf /usr/local/etc/bluetooth/main.conf
sudo install -m644 profiles/input/input.conf /usr/local/etc/bluetooth/input.conf
sudo install -m644 profiles/network/network.conf /usr/local/etc/bluetooth/network.conf
sudo install -m644 profiles/proximity/proximity.conf /usr/local/etc/bluetooth/proximity.conf
Here is what i was suggested to use for install
tce-load -i dbus-glib-dev libical-dev readline-dev udev-lib-dev
cd bluez-5.28
patch -Np1 -i ../bluez-5.28-obexd_without_systemd-1.patch
CC="gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --disable-static --localstatedir=/var --libexecdir=/usr/local/lib --disable-systemd --enable-library
find . -name Makefile -type f -exec sed -i 's/-O2//g' {} \;
make
sudo make install
sudo install -dm755 /usr/local/etc/bluetooth
sudo install -m644 src/main.conf /usr/local/etc/bluetooth/main.conf
sudo install -m644 profiles/input/input.conf /usr/local/etc/bluetooth/input.conf
sudo install -m644 profiles/network/network.conf /usr/local/etc/bluetooth/network.conf
sudo install -m644 profiles/proximity/proximity.conf /usr/local/etc/bluetooth/proximity.conf
-
Hi lykkedk
How do i include this BELOW in my .tcz
Create the directory:
package/usr/local/tce.installed/
Place your commands in a file called:
bluez-5.30
and save it in that directory.
You can look in:
/usr/local/tce.installed/
for examples of what other extensions do.
-
don't forget:
$ sudo chmod 775 /usr/local/tce.installed
$ sudo chown root:staff /usr/local/tce.installed
You'll also need an /usr/local/etc/init.d/bluez script - you can copy it and the start-up script from the bluez extension in the x86 repo (and please feel free to add improvements).
-
You might also want to check if /usr/local/share/dbus-1/services/org.bluez.obex.service was installed - it wasn't installed by bluez-5.28 and it is required for obex file transfer to work.
-
Thanks all :)
Thanks i am working hard to get it going right now !
8)
Rgds; Jesper.
-
So... here i am now :)
BlueZ-5.30.tcz created succesfully, and everything is running with minimal .deps
Next step is to use it with pulseaudio, but i need (I think??) the "pulseaudio-module-bluetooth"
The prebuild pulseaudio 5, does not contain that, so i tried to compile pulseaudio myself.
./configure runs fine, but does not contain BlueZ 5...
Any hint's, it seems hard to find documentation about, what must be, for the bluetoot-pulseaudio to be build
Rgds; Jesper.
---{ pulseaudio 6.0 }---
prefix: /usr/local
sysconfdir: ${prefix}/etc
localstatedir: /var
modlibexecdir: ${exec_prefix}/lib/pulse-6.0/modules
System Runtime Path: /var/run/pulse
System State Path: /var/lib/pulse
System Config Path: /var/lib/pulse
Zsh completions directory: ${datarootdir}/zsh/site-functions
Compiler: gcc -std=gnu99
CFLAGS: -g -O2 -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option -fdiagnostics-color=auto
CPPFLAGS: -DFASTPATH -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
LIBS: -lgdbm -lcap -lpthread -lrt -ldl -lm
Enable X11: no
Enable OSS Output: yes
Enable OSS Wrapper: yes
Enable EsounD: yes
Enable Alsa: yes
Enable CoreAudio: no
Enable Solaris: no
Enable WaveOut: no
Enable GLib 2.0: yes
Enable Gtk+ 3.0: no
Enable GConf: no
Enable Avahi: no
Enable Jack: yes
Enable Async DNS: no
Enable LIRC: no
Enable Xen PV driver: no
Enable D-Bus: yes
Enable BlueZ 4: no
Enable BlueZ 5: no
Enable ofono headsets: no
Enable native headsets: no
Enable udev: yes
Enable HAL->udev compat: yes
Enable systemd
Daemon (Socket Activation): no
Login (Session Tracking): no
Journal (Logging): no
Enable TCP Wrappers: no
Enable libsamplerate: no
Enable IPv6: yes
Enable OpenSSL (for Airtunes): yes
Enable fftw: no
Enable orc: yes
Enable Adrian echo canceller: yes
Enable speex (resampler, AEC): yes
Enable WebRTC echo canceller: no
Enable gcov coverage: no
Enable unit tests: no
Database
tdb: no
gdbm: yes
simple database: no
System User: pulse
System Group: pulse
Access Group: pulse-access
Enable per-user EsounD socket: yes
Force preopen: yes
Preopened modules: all
Legacy Database Entry Support: yes
-
This worked for me:
http://www.tinycorelinux.net/5.x/x86_64/tcz/src/pulseaudio5/compile_pulseaudio
Did you check config.log to see why the ./configure script did not find bluez?
-
:) Thanks again pal!
I am working (or my PI does) compiling the pulseaudio
I am having some problems with x and startup the pulseaudio daemon. (I use no X on my headless PI)
Will report back, when i got some progress.
Rgds; Jesper.
-
:) hmm...
Nothing seems to work right now.
Pulseaudio both 5 and 6 seems to be using far to much cpu-power (~50%) so no go pulseaudio.
So i tried to compile the Bluez4 for using ALSA with bluetooth audio stream, but i cannot find any documentation?
I cant even made bluez4 start.. Complains about some dbus things ::)
Anyone with working bluetooth streaming ??
Rgds; Jesper
-
You can start pulseaudio with "pulseaudio -vv" to look for the problem. I seem to recall that I had to comment something out in one of the *conf files.
You could compare with the conf files in the x86 extension.
-
Thanks .. But i think i have to go the BlueZ4 way for success!
I managed to make bluez4 start as daemon now, but i have now discovered that i need some python things to use the supplied scripts.
When i try to start simple-agent, i got this error :
I dont know howto solve this ?
tc@PlayBox:~/bluez-4.101/test$ ./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
-
You need pygobject
-
Yes... But does not exsist as a.tcz i bellive
Rgds; Jesper
Sent from my iPhone using Tapatalk
-
sorry, but I didn't check - I only have x86{,_64} hardware
-
:) 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.
-
pygobject.tcz added to repo.
-
:) Thanks Bela'
Nice nice!
I am missing something / something setup uncorrect? I Donno?
Have this error, even when pygobject is loaded
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
-
No idea what is simple-agent. Importing module in Python works:
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
>>>
-
I think you need pygobject-2.x rather than pygobject-3.x for bluez-4
-
Bela' ::
The simple-agent, is a tool for pairing bluetooth devices supplied with the BlueZ4 package.
Look, when i try the same :
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
-
Bela'
Can you try this on your devel. machine ?
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']
>>>
-
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']
>>>
-
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.
-
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.
-
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 (http://thethingsystem.com/dev/Bootstrapping-the-Raspberry-Pi.html)
<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 :
tc@PlayBox:~/bluez-4.101/test$ bluetoothd --version
4.101
Top returns :
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 ;)
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.
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 :
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
-
libgirepository-1.0.so.1 is provided by gobject-introspection, which is a dep of pygobject.
-
:) Soo, as Bela' said there was a .dep typo.
So now, i got pass the other fault.
first load the pygobject :
tc@PlayBox:~$ tce-load -i pygobject
readline.tcz: OK
python.tcz: OK
gobject-introspection.tcz: OK
pixman.tcz: OK
cairo.tcz: OK
pycairo.tcz: OK
pygobject.tcz: OK
So trying again the simple-agent :
tc@PlayBox:~/bluez-4.101/test$ python simple-agent
Traceback (most recent call last):
File "simple-agent", line 8, in <module>
import dbus
ImportError: No module named dbus
Seems endless .. haha
Rgds; Jesper
-
True, no python dbus module in the repo.
-
:).. I am trying to compile it now!
make is running right now... donno if i can make it :)
Will report back!
-
:) Soo ... lucky me i guess...
dbus-python compiled fine, so i created dbus-python.tcz, which also loads fine.
Now i can run sudo python simple-agent 8)
tc@PlayBox:~/bluez-4.101/test$ sudo python simple-agent
Agent registered
Authorize (/org/bluez/2642/hci0/dev_xxxxxxxx_1D, 0000110c-0000-1000-8000-00805f9b34fb)
Authorize connection (yes/no): yes
Actually i can pair/connect now...
tc@PlayBox:~/bluez-4.101/test$ sudo python list-devices
[ /org/bluez/2642/hci0 ]
Name = PlayBox-0
Powered = 1
Devices = dev_7xxxxxxxxxx_1D
DiscoverableTimeout = 0
PairableTimeout = 0
Discoverable = 0
Address = xxxxxxxxxx:15
Discovering = 0
Pairable = 1
Class = 0
UUIDs = 0x1000 0x1001 0x1112 0x111f 0x110c 0x110e
[ /org/bluez/2642/hci0/dev_xxxxxxxxxxx_1D ]
Product = 0x6e00
Vendor = 0x004c
Name = iPhone
Paired = 1
Adapter = /org/bluez/2642/hci0
Alias = iPhone
Version = 0x0810
Connected = 1
UUIDs = 00000000-deca-fade-deca-deafdecacafe 0x1000 0x110a 0x110c 0x110e 0x1116 0x111f 0x112f 0x1132 0x1200
Address = xxxxxxxxxx:1D
Services = dbus.Array([], signature=dbus.Signature('o'), variant_level=1)
Blocked = 0
Class = 0x7a020c
Trusted = 0
Icon = phone
Translate Danish "Tilsluttet" = "Connected" 8) 8) 8)
(http://i1312.photobucket.com/albums/t535/Jesperlykke/piCore/FEA068A1-4745-4E5B-A6D7-E641F28E7006_zpsw3shgrkp.png)
Rgds; Jesper.
-
Great - does music come out?
-
:) Naaa... no music yet!
Actually i haven't a clue of howto do that yet :o
-Do you know about music streaming ?
Been using a lot of time getting here now.
Rgds; Jesper.
-
dbus-python.tcz added to repo.
-
I managed to set an iPhone as an audio source using blueman and then play music from the iPhone through my laptop speakers using pavucontrol/pulseaudio to set the appropriate source and sink
This being said, I guess you'd need to achieve the same thing using python/alsa on your raspberry/hifi setup, which is going to require some considerable google foo...
-
Hi...
I managed to setup Bluez4 now, but things are flacky...
I did not manage to actually stream audio yet ::)
Just a little followup.
Rgds; Jesper.
-
Hi Jesper... and everyone else in the forum ;),
are there any news, success, etc. with the audio streaming? It would be a dream to got this to work! I also thought about doing this with BlueZ4 and ALSA (instead of Bluez5 + Pulseaudio) because i already use alsa for audio output from mpd. But:
While researching how to got this to work I found this great documentation of bluez for audio streaming (with explanation!):
https://web.archive.org/web/20140704063150/http://jamesbond3142.no-ip.org/blog/?viewDetailed=00031 (https://web.archive.org/web/20140704063150/http://jamesbond3142.no-ip.org/blog/?viewDetailed=00031)
I'm not really familiar with this bluez thing but if I understand it right, then it's not possible to use bluez4 + alsa to recieve a audio stream via A2DP and play it at the audio output of the RasPi. That means you have to go with bluez5 + pulseaudio. Am I right that far?
Cheers JJ
-
Hi there :)
Hi Jesper... and everyone else in the forum ;),
are there any news, success, etc. with the audio streaming? It would be a dream to got this to work! I also thought about doing this with BlueZ4 and ALSA (instead of Bluez5 + Pulseaudio) because i already use alsa for audio output from mpd. But:
While researching how to got this to work I found this great documentation of bluez for audio streaming (with explanation!):
newbielink:https://web.archive.org/web/20140704063150/http://jamesbond3142.no-ip.org/blog/?viewDetailed=00031 [nonactive]
I'm not really familiar with this bluez thing but if I understand it right, then it's not possible to use bluez4 + alsa to recieve a audio stream via A2DP and play it at the audio output of the RasPi. That means you have to go with bluez5 + pulseaudio. Am I right that far?
Cheers JJ
Nice link you provided, thanks.
Honestly, i cannot answer yes or no to youre quistions. I think through that its possible both some how.
Problem is, that both bluez4/alsa and bluez5/pulseaudio both have some pros. / cons. :)
Hope that someone else try it out...
Rgds; Jesper.
-
Hey Jesper
I'd be glad to try but at the moment I'm stuck at compiling bluez5 (I didn't try bluez4 yet). First I had the same Errors you got at the beginning of this thread but now I have a "DBUS not found" error and until now I was not able to solve this. Maybe you could upload your compiled packages somewhere or send them to me? (add them to the repo?)
To the Link: My understanding of this is: It's not possible to use bluez4 + alsa without writing an interface to pass the A2DP stream from bluez to Alsa. Thats because you need to disable the Socket option in audio.conf to make the Media DBus API work, wich you need to receive the audio stream from the bluetooth device. But if this works the next step - logically - is to pass this received strem to alsa. To do so you need the alsa pcm plugin and for that you need to enable the Socket option in audi.conf. And because you cannot enable and disable Socket at the same time, it doesn't work - at least not that easily I expected ;D
But If I'd have the compiled packages I would give both solutions a try... ;)
Cheers JJ
-
Hi there... I Will Try finding it sogn...
Really sorry i miss reply, and not answer soner, but i AM in middle of moving house ;-)... So time is stort... Good Thing is, That the house is really neat ;-)
Rdgsrds from working man :)
Sent from my iPhone using Tapatalk
-
Hey. No problem, take your time. :) Meanwhile I'll try to finish compiling bluez5.
Current status: I solved all errors with the configure script but now make command stops because of several "...-file not found" errors despite the fact that the files are existing. I'll try to fix this in the next days, otherwise I'll post a detailed description of the errors, so maybe someone can help.
Greez JJ
-
Any progress ?
:) Just curius
Rgds; Jesper
-
Btw...
Here is a dropbox link with some files i found (Bluez)
Honestly, i can't remember details, but one can unsquashfs them and have a look :)
Rgds; Jesper.
https://www.dropbox.com/s/779crb1w3ozd3f9/RPI-BLUEZ.zip?dl=0 (https://www.dropbox.com/s/779crb1w3ozd3f9/RPI-BLUEZ.zip?dl=0)
-
Hi,
Thanks for the download link.
I didn't have time to do some more experiments, but if there is any progress I'll share it here.
Thanks and greetings
JJ