From 79cc5a178b399457c1a3e2c8cfaf59c4cbc78f0a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 23 Mar 2009 17:40:45 +0100 Subject: Replace asound.conf with a more full-fledged bluetooth.conf The new fragment will introduce device strings that can be given the BT address of the headset as parameter. Also, they integrate 'plug' so that they can be used with any application. This replaces the old 'asound.conf' file which was much more limited. Also since we now install 'bluetooth.conf' to /etc/alsa it is not a good idea to simply call that file 'asound.conf'. Please note that this will install the config fragment but not actually enable it. For that some minor changes to the /etc/asoundrc as shipped by the distro are necessary. It's up to the distributions to do this. How that works in explained in the header of bluetooth.conf. --- audio/Makefile.am | 5 ++++- audio/asound.conf | 7 ------- audio/bluetooth.conf | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 8 deletions(-) delete mode 100644 audio/asound.conf create mode 100644 audio/bluetooth.conf diff --git a/audio/Makefile.am b/audio/Makefile.am index f5ca4ee2..af2e6fd6 100644 --- a/audio/Makefile.am +++ b/audio/Makefile.am @@ -20,6 +20,7 @@ LDADD = $(top_builddir)/common/libhelper.a \ if ALSA alsadir = $(libdir)/alsa-lib +alsaconfdir = $(sysconfdir)/alsa alsa_LTLIBRARIES = libasound_module_pcm_bluetooth.la libasound_module_ctl_bluetooth.la @@ -32,6 +33,8 @@ libasound_module_ctl_bluetooth_la_SOURCES = ctl_bluetooth.c rtp.h ipc.h ipc.c libasound_module_ctl_bluetooth_la_LDFLAGS = -module -avoid-version -export-symbols-regex [_]*snd_ctl_.* libasound_module_ctl_bluetooth_la_LIBADD = @BLUEZ_LIBS@ @ALSA_LIBS@ libasound_module_ctl_bluetooth_la_CFLAGS = @ALSA_CFLAGS@ @BLUEZ_CFLAGS@ + +alsaconf_DATA = bluetooth.conf endif if GSTREAMER @@ -63,7 +66,7 @@ CLEANFILES = $(BUILT_SOURCES) INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/src -EXTRA_DIST = audio.conf asound.conf telephony-dummy.c telephony-maemo.c +EXTRA_DIST = audio.conf telephony-dummy.c telephony-maemo.c bluetooth.conf MAINTAINERCLEANFILES = Makefile.in diff --git a/audio/asound.conf b/audio/asound.conf deleted file mode 100644 index ec97d46f..00000000 --- a/audio/asound.conf +++ /dev/null @@ -1,7 +0,0 @@ -pcm.headset { - type bluetooth -} - -ctl.headset { - type bluetooth -} diff --git a/audio/bluetooth.conf b/audio/bluetooth.conf new file mode 100644 index 00000000..55b51e43 --- /dev/null +++ b/audio/bluetooth.conf @@ -0,0 +1,36 @@ +# Please note that this ALSA configuration file fragment needs be enabled in +# /etc/asound.conf or a similar configuration file with directives similar to +# the following: +# +#@hooks [ +# { +# func load +# files [ +# "/etc/alsa/bluetooth.conf" +# ] +# errors false +# } +#] + +pcm.rawbluetooth { + @args [ ADDRESS ] + @args.ADDRESS { + type string + } + type bluetooth + device $ADDRESS +} + +pcm.bluetooth { + @args [ ADDRESS ] + @args.ADDRESS { + type string + } + type plug + slave { + pcm { + type bluetooth + device $ADDRESS + } + } +} -- cgit