maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   A2DP works, help me test it? (https://talk.maemo.org/showthread.php?t=13468)

yukop4 2009-06-21 02:29

Re: A2DP works, help me test it?
 
got the same problem with my tablet n810-media player send via bluetooth and the bluetooth connection drops out

what annoys me is that the md 7w speakers were stated as being compatiable with the n810

zenjunior 2009-06-26 17:59

Re: A2DP works, help me test it?
 
The instructions on the first page are still valid, and work without a problem, the only problem is that mplayer normaly uses 5 to 10 % , and using the A2DP it spikes to 50%, when monitoring using # top

So it works, but I think battery is going to be an issue...

Thanks for the hint

Tomaszd 2009-07-12 10:32

Re: A2DP works, help me test it?
 
Quote:

Originally Posted by Serge (Post 266187)
Hello,

Regarding A2DP performance on N800/N810. Using the latest diablo firmware, a2dp-support_0.9_all.deb package and nothing else, we get the following profiling statistics (Signed 16 bit Little Endian, Rate 44100 Hz, Stereo WAV file played with aplay for 100 seconds), the results are consistent across multiple runs, CPU was set to run at 400MHz:



CPU usage is split between kernel and bluez SBC encoder more or less evenly and the bluetooth driver consumes quite a noticeable share of cpu time. Applying attached patch (tweak of UART FIFO buffer settings) to the kernel reduces CPU usage in the bluetooth driver. The fix for UART FIFO stuff for the bluetooth is available in pre-alpha fremantle kernel which was released to the public. I just did some tweaks which should work better on N800/N810, but of course somebody else can probably improve it more (reading OMAP1 and OMAP3 documentation about UART and "interpolating" it for OMAP2). Even better optimization would be to try using DMA in the bluetooth driver, but that may be a bit harder.

With the patch applied, the profiling statistics changes to the following:


CPU usage in the kernel gets lower and there are less interrupts generated. On the other hand, bluetooth transfer speed may become a little bit smaller.

As for the SBC codec alone, it takes ~7% of CPU on N800/N810. With ARMv6 SIMD optimizations (which are still to be done) and the latest SBC encoder from upstream bluez project, I expect that this time might get halved.

Alternatively, DSP can be used for SBC encoder (port to it is done by lardman). But ARM<->DSP communication overhead is also kind of can of worms and may (or may not) kill the benefits of offloading some work to DSP.

To anyone who wants to know: I've added Serge's patch to kernel-source-diablo of Mer, it's now in N8x0:Testing, should be available in the next release of Mer (0.15).

svu 2009-11-02 10:24

Re: A2DP works, help me test it?
 
svs57, could you please fix your a2dp script with adding

enabled=0

at the start? Otherwise the line

if [ $enabled -eq 1 ] ; then

gives the error message, when $enabled is not initialized.

Thanks

svs57 2009-11-02 11:11

Re: A2DP works, help me test it?
 
1 Attachment(s)
Thank you svu.
I fixed script.

clearcut 2009-12-02 05:14

Re: A2DP works, help me test it?
 
I'm trying to get this to work with a pair of LG HSB-250 which support A2DP. I have read all 9 pages of this tread. I followed the first message - actually 3 times now rebooting between tries.

With a2dp enabled:

mplayer - plays a video with no sound. Occasionally it plays a double speed with no sound. Until the video actually plays, screen taps play. Version 1.0rc1-maemo20.n8x0

Kagu simply crashes.

With a2dp disabled I can hear in both speakers, but the quality is poor. Kagu plays normally.

The headphones connect in HFP, HSP. I was able to make a call with Goggle Voice and Gizmo.

Any other suggestions?

lardman 2009-12-02 10:23

Re: A2DP works, help me test it?
 
Try un-pairing and then re-pairing, getting it to connect the first time can be a real pita.

clearcut 2009-12-02 17:59

Re: A2DP works, help me test it?
 
Thanks for the suggestion. Unfortunately after 6 un-pairing / re-pairings, the results are the same.

I have tried re-pairing while a2dp and enabled and a2dp was disabled.

I have triple checked the Bluetooth address.

As an experiment, I paired (and then un-paired) the headset with a Mac and achieved full a2dp support including controlling iTunes with the headset controls, so I know the headset works correctly.

Any other suggestions?

svs57 2009-12-03 08:05

Re: A2DP works, help me test it?
 
Start xterm. From xterm type
mplayer <Path to mp3 file>/<mp3 file name>
for example
mplayer /media/mmc2/music.mp3
Then copy output and paste here.

IMHO FAQ miss very important part - create a2dp device
Here is python script for this
-----------------------------------
import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')
bus_id = manager.ActivateService('audio')
audio = dbus.Interface(bus.get_object(bus_id, '/org/bluez/audio'), 'org.bluez.audio.Manager')

path = audio.CreateDevice('XX:XX:XX:XX:XX:XX')
audio.ChangeDefaultDevice(path) #change the device to be used by default
sink = dbus.Interface (bus.get_object(bus_id, path), 'org.bluez.audio.Sink')
sink.Connect()
----------------------------------------------
Change in the line
path = audio.CreateDevice('XX:XX:XX:XX:XX:XX')
BT address of your headphone

Also check file
/etc/bluetooth/audio.conf
line
Disable=Control,Sink,Source
should be
#Disable=Control,Sink,Source
And restart BT as root
/etc/init.d/bluez-utils stop
/etc/init.d/bluez-utils start

Hope this help you.

clearcut 2009-12-04 20:12

Re: A2DP works, help me test it?
 
Thank you so much for trying to help. I really appreciate it. But still no a2dp sound.

==-=-==

I rebooted the N810,
re-paired the HBS-250 headset,
did a a2dp runfirst adding the correct device 00:07:88:6A1:E1:72
and ran mplayer as you suggested

==-=-==
12/04/09, 10:59 AM: /media/mmc2 $ mplayer fpb.mp3
MPlayer 1.0rc1-maemo.29.n8x0 (C) 2000-2006 MPlayer Team
CPU: ARM
Internet Tablet OS version: RX-34+RX-44+RX-48_DIABLO_5.2008.43-7_PR_MR0

[MENU] Can't open menu config file: /home/user/.mplayer/menu.conf
Menu inited: /etc/mplayer/menu.conf

Playing fpb.mp3.

Audio file file format detected.
================================================== ========================
Trying to force audio codec driver family dspmp3...Opening audio decoder: [dspmp3] MP3 audio pass-through for Nokia 770/N800 (fake decoder)
ADecoder preinit failed :(
ADecoder init failed :(
Trying to force audio codec driver family libmad...Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
================================================== ========================
alsa-lib: pcm_bluetooth.c:1589:(bluetooth_init) BT_GETCAPABILITIES failed : Input/output error(5)
alsa-init: playback open error: Input/output error
Could not open/initialize audio device -> no sound.Audio: no sound
Video: no video


Exiting... (End of file)

==-=-==

I then ran your script

==-=-==

12/04/09, 11:00 AM: /media/mmc2 $ python usebt.py
Traceback (most recent call last):
File "usebt.py", line 7, in <module>
path = audio.CreateDevice('00:07:88:6A1:E1:72') File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 140, in __call__
**keywords)
File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 607, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.bluez.Error.ConnectionAttemptFailed: Host is down
/media/mmc2 $

==-=-==

and reran mplayer

==-=-==
______

12/04/09, 11:01 AM: /media/mmc2 $ mplayer fpb.mp3
MPlayer 1.0rc1-maemo.29.n8x0 (C) 2000-2006 MPlayer Team
CPU: ARM
Internet Tablet OS version: RX-34+RX-44+RX-48_DIABLO_5.2008.43-7_PR_MR0

[MENU] Can't open menu config file: /home/user/.mplayer/menu.conf
Menu inited: /etc/mplayer/menu.conf

Playing fpb.mp3.

Audio file file format detected.
================================================== ========================
Trying to force audio codec driver family dspmp3...Opening audio decoder: [dspmp3] MP3 audio pass-through for Nokia 770/N800 (fake decoder)
ADecoder preinit failed :(
ADecoder init failed :(
Trying to force audio codec driver family libmad...Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
================================================== ========================
alsa-lib: pcm_bluetooth.c:1589:(bluetooth_init) BT_GETCAPABILITIES failed : Input/output error(5)
alsa-init: playback open error: Input/output error
Could not open/initialize audio device -> no sound.Audio: no sound
Video: no video


Exiting... (End of file)

==-=-==

I also rebooted and re-paired.


All times are GMT. The time now is 16:46.

vBulletin® Version 3.8.8