Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does record from bluetooth supported now? #196

Closed
AndroiDjo opened this issue Mar 20, 2019 · 5 comments
Closed

Does record from bluetooth supported now? #196

AndroiDjo opened this issue Mar 20, 2019 · 5 comments

Comments

@AndroiDjo
Copy link

AndroiDjo commented Mar 20, 2019

Hello.
Sorry for my noob question, im new in linux-like systems and im trying to make something like smart speaker on my raspbian. I can use my speaker through a2dp profile successfully, but i cant change profile (hfp-hf, hfp-ofono) to record sound.

Im trying change profile by command:
pi@raspberrypi:~/exp $ bluealsa -p hfp-hf
bluealsa: Couldn't bind controller socket: /var/run/bluealsa/hci0: Address already in use
bluealsa: ../../src/bluez.c:1099: Registering profile: /HFP/HandsFree
bluealsa: ../../src/main.c:299: Starting main dispatching loop
then nothing happens and i have to cancel this process by Ctrl+C

when i try to record sound, i get error:
pi@raspberrypi:~/exp $ arecord -d 5 record.wav
../../../src/asound/../shared/ctl-client.c:108: Connecting to socket: /var/run/bluealsa/hci0
../../../src/asound/../shared/ctl-client.c:238: Getting transport for F4:4E:FD:32:0D:6C type 0x81
ALSA lib ../../../src/asound/bluealsa-pcm.c:714:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA transport: No such device or address
arecord: main:788: audio open error: No such device or address

Version of bluealsa is 1.4.0

@AndroiDjo
Copy link
Author

Upd.
Now i know how to record with bluealsa, but i have error:
$ sudo arecord -f S16_LE -D bluealsa:HCI=hci,DEV=F4:4E:FD:32:0D:6C,PROFILE=sco record.wav
../../../src/asound/../shared/ctl-client.c:108: Connecting to socket: /var/run/bluealsa/hci
ALSA lib ../../../src/asound/bluealsa-pcm.c:702:(_snd_pcm_bluealsa_open) BlueALSA connection failed: No such file or directory
arecord: main:788: audio open error: No such file or directory

@SeppiR
Copy link

SeppiR commented Mar 28, 2019

I am facing the same Problem
aplay works great with my bluetooth devic but arecord gives me the same error as @AndroiDjo
$ arecord -l --> list is empty

@bryanhughes
Copy link

bryanhughes commented Oct 31, 2019

I too am facing the same problem. After a lot of struggling, I compiled from source on my Beagle Bone Green (Debian 9.9) without issue, purged pulseaudio and got playback working. Yay!

Unfortunately recording audio is giving me an error:

$ arecord -D bluealsa capture.wav
ALSA lib ../../../src/asound/bluealsa-pcm.c:755:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA PCM: PCM not found
arecord: main:788: audio open error: No such device

Is there more configuration or settings needed to record audio from bluetooth?

UPDATE 1:
I am able to record if I change the default profile from "a2dp" to "sco" but when I do this I can no longer playback. So now I manually switch to "sco" to record and then "a2dp" to listen. I am hoping I am not just doing something right as this seems a little broken otherwise. I am assuming I am missing something.

UPDATE 2:
A day later and a power down and power up, and I am no longer able to record. I am now getting:

$ arecord -D bluealsa capture-logi.wav
ALSA lib ../../../src/asound/bluealsa-pcm.c:731:(_snd_pcm_bluealsa_open) Invalid BT profile [a2dp, sco]: soc
arecord: main:788: audio open error: Invalid argument

Here is my .asoundrc

defaults.bluealsa.service "org.bluealsa"
defaults.bluealsa.device "88:C6:26:D4:3D:01"
defaults.bluealsa.profile "soc"
defaults.bluealsa.delay 10000

pcm.!default {
        type plug
        slave {
                pcm {
                        type bluealsa
                        device 88:C6:26:D4:3D:01
                        profile "soc"
                }
        }
        hint {
                show on
                description "Logitec"
        }
}
ctl.!default {
        type bluealsa
}

@arkq
Copy link
Owner

arkq commented Nov 5, 2019

With the latest commit in the master recording with HFP/HSP in headset mode (incoming call from phone) should be possible.

Also please note, that when SCO is acquired, the A2DP might be muted by the headset, so you can not use SCO and A2DP simultaneously.

update2 not working

You've made a typo: not "sOc" but "scO" :)

@arkq arkq closed this as completed Nov 5, 2019
@rkachach
Copy link

rkachach commented Oct 26, 2020

Facing the same problem with the latest version (v3.0.0-9-g63e2eea) running on an RPI 4. I'm able to play wav files when using a2dp but I can't capture/record. I get the following error:

pi@raspberrypi:~ $ arecord -D jabra capture.wav
D: ../../../src/asound/bluealsa-pcm.c:1004: Getting BlueALSA PCM: CAPTURE 70:BF:92:15:BF:EE a2dp
ALSA lib ../../../src/asound/bluealsa-pcm.c:1006:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA PCM: PCM not found
arecord: main:828: audio open error: No existe el dispositivo

Is there something i'm missing? my configuration is the following:

defaults.bluealsa.interface "hci0"
defaults.bluealsa.device "70:BF:92:15:BF:EE"
defaults.bluealsa.profile "sco"

pcm.jabra {
    type plug
    slave.pcm {
        type bluealsa
        service "org.bluealsa"
        device "70:BF:92:15:BF:EE"
        profile "sco"
    }
    hint {
       show on
       description "Bluetooth Jabra Speaker"
    }
}




Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants