LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Bluetooth headset, Alsa - no soundcard in /proc/asound/cards (but headset works) (http://www.linuxquestions.org/questions/linux-hardware-18/bluetooth-headset-alsa-no-soundcard-in-proc-asound-cards-but-headset-works-707357/)

simopal6 02-25-2009 04:10 AM

Bluetooth headset, Alsa - no soundcard in /proc/asound/cards (but headset works)
 
Hello!
I trying to make my bluetooth headset work... I'm working on the output part first - microphone will come later.
I've found some python code in Bluez Trac which seems to work, I can hear audio from the headset.
I've also added these lines to my .asoundrc file:
Code:

pcm.bluetooth {
  type bluetooth
}

If I run, for example,
Code:

mplayer -ao alsa:device=bluetooth file.mp3
audio comes from the headset. If I omit the -ao part, audio comes from the computer (obviously).
Also, if I run
Code:

mplayer -ao alsa:device=bluetoothasdf file.mp3
I get an error.
Then, I think I can say that "bluetooth" is recognized as an alsa device (or card, I don't know if it's the same thing).

My problem is that I want to be able to set dynamically (i.e. when I need it) the headset as default alsa device. I've tested the ALSA_CARD environment variable, and it seems to work. What I need is the of the headset name as alsa sees it.
I thought that exporting ALSA_CARD=bluetooth would work, but it doesn't.
If I run
Code:

aplay test.wav
I get
Code:

ALSA lib confmisc.c:768:(parse_card) cannot find card 'bluetooth'
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:3982:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:546: audio open error: No such device

which is strange to me, since with mplayer "-ao alsa:device=bluetooth" works.
If I cat /proc/asound/cards (when the headset is being used, to make sure), I get
Code:

0 [I82801DBICH4  ]: ICH4 - Intel 82801DB-ICH4
                      Intel 82801DB-ICH4 with STAC9750,51 at irq 4

which is my motherboard's soundcard.
(By the way, if I set ALSA_CARD to "I82801DBICH4", sound works again).
So, why doesn't /proc/asound/cards list the headset too?
If it did, I could use its name to set ALSA_CARD accordingly.

P.S. I opened a thread (http://www.linuxquestions.org/questi...doubts-706830/) about my bluetooth headset some days ago, but nobody replied. Moreover, the thread's title is not so clear (I'm sorry), so I think moderators can delete it.

gsanchez 04-29-2009 10:07 AM

Same problem here!

This is my .asoundrc file
pcm.!default {
type plug
slave.pcm "bluetooth"
}
pcm.bluetooth {
type bluetooth
device 00:12:C8:91:36:89
}

When I start the system (Ubuntu 9.04, by the way) it sounds through the bluetooth headset, but when I list /proc/asound/pcm I cant see it.

When I run this command:
aplay -v -D bluetooth something.wav
sometimes it works and sometimes it displays the following error:

aplay: pcm_write:1442: error de escritura: Error de entrada/salida
(writing error:I/O error)

Im starting to think that is a bluetooth problem and it doesnt have to do with ALSA. How can I confirm this?

Best regards!


All times are GMT -5. The time now is 11:46 AM.