This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

bluetooth sco pcm mapping in dm3730 processor

Other Parts Discussed in Thread: ASH, DM3730

hello everyone,

                  I am using Gumstix Overo Firestorm COM on a custom made board without any USB connector provided. As of now i require a bluetooth mono headset(for low quality audio) to be interfaced with the embedded device and thus onboard bluetooth W2CBWOO3 CHIP is the only choice left for me. I am working solely in command line Linux (Angstrom 2011.03, kernel 3.0.0). I started my development by getting the mono-headset to talk with a desktop linux PC also running on command line connect with a USB bluetooth adaptor. That stage was successful and i used bluez4 and alsa-1.0.24 provided tools like aplay/arecord to get the audio link working.

                 However, on the embedded board, the same procedure yielded complete silence. I could hear the start and stop beeps (i believe when rfcomm comes into action) when i issue the command

root#>  arecord -D samsung| aplay -D samsung

where samsung is the virtual alsa device created in the file ~/.asoundrc

pcm.samsung {
    type plug
    slave {
        pcm "samsung_hw"
    }
}

pcm.samsung_hw {
    type bluetooth
    device D8:57:EF:AC:F5:1E
    profile "auto"
}

                   Details about the on board bluetooth adaptor as follows

root#>  hciconfig hci0
hci0:    Type: BR/EDR  Bus: UART
    BD Address: 00:19:88:4A:05:93  ACL MTU: 310:10  SCO MTU: 64:8
    UP RUNNING PSCAN
    RX bytes:9507 acl:116 sco:0 events:353 errors:0
    TX bytes:188543 acl:132 sco:3541 commands:120 errors:0

root#>  hciconfig hci0 -a
hci0:    Type: BR/EDR  Bus: UART
    BD Address: 00:19:88:4A:05:93  ACL MTU: 310:10  SCO MTU: 64:8
    UP RUNNING PSCAN
    RX bytes:9507 acl:116 sco:0 events:353 errors:0
    TX bytes:188543 acl:132 sco:3541 commands:120 errors:0
    Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF PARK
    Link mode: SLAVE ACCEPT
    Name: 'xxxx-0'
    Class: 0x480100
    Service Classes: Capturing, Telephony
    Device Class: Computer, Uncategorized
    HCI Version: 2.0 (0x3)  Revision: 0xc5c
    LMP Version: 2.0 (0x3)  Subversion: 0xc5c
    Manufacturer: Cambridge Silicon Radio (10)

root#>  hciconfig hci0 revision
hci0:    Type: BR/EDR  Bus: UART
    BD Address: 00:19:88:4A:05:93  ACL MTU: 310:10  SCO MTU: 64:8
    Unified 21e
    Chip version: BlueCore4-ROM
    Max key size: 128 bit
    SCO mapping:  PCM

               

                   Further probing the problem in Gumstix forums led to the conclusion that the bluetooth chip SCO mapping is done to the PCM link and not HCI and cannot be altered. Besides the HCI uart link has a limited speed of 115Kbps and therefore SCO link quality is also limited. I did not want to purse the route of altering W2CBWOO3 chip firmware as it is risky. So the only way i can get audio to work is getting an alsa driver for the bluetooth PCM link and telling bluetooth device module about this device as mentioned here.

Link 1         http://gumstix.8.n6.nabble.com/Overo-audio-bluetooth-headset-td656900.html

Link 2         http://gumstix.8.n6.nabble.com/sco-routing-pcm-td567725.html

                  This lead me to a similar discussion in TI forum

Link3          http://e2e.ti.com/support/dsp/sitara_arm174_microprocessors/f/416/t/165965.aspx

and

Link 4        http://en.usenet.digipedia.org/thread/19013/31485/

                  where they are trying to develop a similar driver for the bluetooth PCM link. I could integrate their driver into my kernel sources and compile after changing the PCM link to omap-mcbsp-dai.4 (taking hint from Ash's post in link 2). But still the audio is not heard and i am at blank about how to mention the sco_sink/sco_source parameters. I have all the software ready with me for the Overo board. Can anyone direct me about how to proceed in this matter. I don't have any linux device driver development experience but can tweak existing drivers if given a hint. I am sure many folks are facing similar problems with same or other board/platforms as seen from the discussions in other forums which come to no conclusions.

The Overo document states that the board revision we are using has Bluetooth PCM connection added but not where. DM3730 datasheet says it has 5 McBSP connections available.

Thanks in advance

Noel 



  • Hi Noel,

    You could start with investigation of the schematics of the Overo® FireSTORM COM board where the bluetooth PCM is connecter. If you have not the schematics you should require them from the board manufacture. The you can configure the relevant McBSP to start communication.

    BR

    Tsvetolin Shulev

  • Thanks for replying.

    According to the document here

    http://gumstix.org/images/overo_snapshot_latest.pdf

    page 3, section 2 , under Bluetooth interface heading GPIO_BT_BSP4 is at GPIO152:155 

    which may mean Bluetooth PCM link is connected to mcbsp4 port on Soc (when the DM3730 datasheet  also is referred)

    http://www.ti.com/product/dm3730 

    therefore i must set the

    .cpu_dai_name = "omap-mcbsp-dai.3" 

    in the code celldai-soc.c code given at Link 4 in my first post.

    I have made both these files celldai-soc.c and celldai-codec.c as part of the kernel tree and am compiling the two.

    I don't fully understand what you meant by

    "... configure the relevant McBSP to start communication.."

    Should i remove the dummy codec file celldai-codec.c (as mentioned by its author in Link4) and make some changes in the omap-mcbsp.c file also present in the same directory sound/soc/omap

    I am confident the BT-PCM link is present on the Overo board so i have to do the software side of it.

    I am totally new to this kind of development so please help. How will i test sound in my Linux userspace once alsa device is shown??

    Regards

    Noel

  • Could anybody briefly list the steps for testing a particular driver of the Bluetooth PCM link in command line linux. I mean how to invoke the Bluetooth link before making aplay/arecord to sink/source from the alsa device representing the Bluetooth PCM link.

    If anyone has used the onboard bluetooth adaptor in Gumstix board with HCI over UART for voice communications, kindly help.

    Regards

    Noel

  • One developer from Gumstix forum has suggested the following in email:

    " Unfortunately, while the connections are in place on recent COM
    revisions, there are limitations in software.  As I remember it,
    confidential information is needed from the wireless module maker
    (wi2wi) in order to get the necessary register information to enable
    Bluetooth PCM.  IIRC, Brad looked into this option but found it
    expensive and restrictive (if Gumstix could do it once for all our
    customers, we might consider it but the licensing was exclusive) "

    Could it be possible that even when SCO to PCM link is present and SCO to HCI is blocked in firmware, still further licensing is required from BT module maker to get sco audio working at all?

  • how can i redirect the SCO link to point to the newly created alsa device for BT-PCM link? some suggest to use pulseaudio to specify the sco_sink and sco_source parameters as the alsa device. but i get Failure: Module initalization failed error. is there any other way than using pulseaudio to do this.

    what i am not clear is how the BT will get triggered once aplay/arecord on hw:0,0 (alsa device) is evoked?

  • any response? since i am stuck with no clue.

  • I managed to get some audio to be heard on the headset by directly accessing the McBSP4 registers based on these instructions

    http://gumstix.8.n6.nabble.com/Direct-register-access-control-of-McBSP-ARM-interface-on-Overo-Water-TOBI-SOLVED-td4965285.html

    but what i hear is only plain noise except for when i set SRGR2 0X107C (FPER  = 0X107C) & SRGR1 0X5F (FWID = 0X5F) which gives me intermittent audio playback with loud banging noise playing in background. Setting Frame and Bit clocks from external i.e. W2CBW003 does not seem to work at all (no noise heard). So i am trying to source the clock from either CLKS or McBSP4_ICLK. But not able to find the correct settings for the registers to hear the 8-bit, 16Khz, Mono audio to be heard over the mono-headset using aplay. I will post a detailed howto for the whole setup once i get the audio playback/capture working.