5/20/2014

Ubuntu, Raspberry Pi,CubieBoard Linux A2DP, bluetooth audio source receiver service, speaker


Bluetooth A2DP receiver.

$ sudo apt-get install pulseaudio-module-bluetooth
$ pactl load-module module-loopback source_dont_move=yes source=$BTSOURCE sink=$SINK
  • You can find $SINK with $ pactl list sinks, $SINK is shown after Name:
  • And you can see the $BTSOURCE with $ pactl list sources
$ pactl load-module module-loopback source_dont_move=yes source=bluez_source.9C_E6_E7_C8_B2_A3 sink=alsa_output.platform-bcm2835_AUD0.0.analog-stereo
ex) Play audio from Smartphone 

Find pulseaudio source list
 $ pactl list sources
Source #0
        State: IDLE
        Name: alsa_output.platform-bcm2835_AUD0.0.analog-stereo.monitor
        Description: Monitor of bcm2835 ALSA Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 4
        Mute: no
        Volume: 0: 100% 1: 100%
                0: 0.00 dB 1: 0.00 dB
                balance 0.00
        Base Volume: 100%
                     0.00 dB
        Monitor of Sink: alsa_output.platform-bcm2835_AUD0.0.analog-stereo
        Latency: 0 usec, configured 371519 usec
        Flags: DECIBEL_VOLUME LATENCY 
        Properties:
                device.description = "Monitor of bcm2835 ALSA Analog Stereo"
                device.class = "monitor"
                alsa.card = "0"
                alsa.card_name = "bcm2835 ALSA"
                alsa.long_card_name = "bcm2835 ALSA"
                alsa.driver_name = "snd_bcm2835"
                device.bus_path = "platform-bcm2835_AUD0.0"
                sysfs.path = "/devices/platform/bcm2835_AUD0.0/sound/card0"
                device.string = "0"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card"
        Formats:
                pcm

Source #2
        State: RUNNING
        Name: bluez_source.9C_E6_E7_C8_B2_A3
        Description: SHW-M440S
        Driver: module-bluetooth-device.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 25
        Mute: no
        Volume: 0: 100% 1: 100%
                0: 0.00 dB 1: 0.00 dB
                balance 0.00
        Base Volume: 100%
                     0.00 dB
        Monitor of Sink: n/a
        Latency: 198393 usec, configured 193344 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                bluetooth.protocol = "a2dp_source"
                device.description = "SHW-M440S"
                device.string = "9C:E6:E7:C8:B2:A3"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                bluez.path = "/org/bluez/2163/hci0/dev_9C_E6_E7_C8_B2_A3"
                bluez.class = "0x5a020c"
                bluez.name = "SHW-M440S"
                device.icon_name = "audio-card-bluetooth"
        Formats:
                pcm

댓글 없음: