Explain relation between asound.conf file with HFP and A2DP commands

1.2k views Asked by At

Here i am looking for Testing A2DP and HFP (Hands free) Profiles.

So here in HFP i am using dbus command for sending message over dbus and execute service address of bluez. for connecting and disconnecting.

here i am using below command for audio playing in HFP.

aplay  -D hw:0,1 -c 2 -f S16_LE file_name &

can you explain me what is the meaning of hw:0,1 .

HFP supports only 8000 Hz sampling rate wav files.

IN Advanced Audio Distribution Profile (A2DP) defines how the high quality audio can be streamed from one device to another over Bluetooth connection.

here i am using this command , but before this command i have to update asound.conf file.

aplay -Dplug:bluetooth file_name > /dev/null > /dev/null &

and in both case i am using same asound.conf file. which is given below.

pcm.!bluetooth {
    type bluetooth
    device "BD_ADDR"  //bluetooth address of hands free device.
    }

pcm.!default {
    type plug
    slave.pcm "bluetooth"
    }

So i want to know the relation of this asound.conf file with HFP command and A2DP command.

Please Help me to sort out this confusion.

1

There are 1 answers

0
mtfk On

can you explain me what is the meaning of hw:0,1 .

The numbers after hw: stand for the sound card number and the device number. A third number can be added (hw:0,0,0) for the sub-device number, but it defaults to the next sub-device avaliable. The numbers start from zero, so, for example, to access the first device on the second sound card, you would use hw:1,0.

So i want to know the relation of this asound.conf file with HFP command and A2DP command.

asound.conf is configuration file for your PulsAudio server, normally you do not need it at all but in some cases you can setup there some specific options or behavior for your hardware. HFP and A2DP are just Bluetooth profiles which are used to communicate with your headset. You can use asound.conf to link sound from your PulsAudio server with Bluetooth device which you are pair. Which means that for example you can set default output/input to this particular BT device, that all applications in your system will use it to play and record sound. But as I mention before normally all those things happen automatically and you do not need to do anything to make it work.

More about how to use asoundrc/asound.config you can find here: http://alsa.opensrc.org/.asoundrc