Skip to contentSkip to conversation

BAT: Add default device name for playback and capture

PATCH In review [email protected] 2 participants 2 messages Oct 28, 2015 – Oct 30, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 BAT: Add default device name for playback and capture

From: "Lu, Han" <[email protected]>

If the playback device and the capture device was not set through '-D', '-P' or '-C' options, set the name of the two devices to "default". So by default, BAT will work through PulseAudio sound server on Ubuntu/Debian, and work though CRAS sound server on Chromium OS/Chrome OS.

If the playback device or the capture device was set through '-D', '-P' or '-C' options by user, the device name "default" will not be set.

bat/bat.c +4 -0
index 086b9fa..4310be0 100644
@@ -473,6 +473,10 @@ static int bat_init(struct bat *bat)
 			return err;
 	}
 
+	/* Set default playback and capture devices */
+	if (bat->playback.device == NULL && bat->capture.device == NULL)
+		bat->playback.device = bat->capture.device = "default";
+
 	/* Determine capture file */
 	if (bat->local) {
 		bat->capture.file = bat->playback.file;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 9 lines · On Wed, 28 Oct 2015 09:12:29 +0100, [email protected] wrote:

From: "Lu, Han" <[email protected]>

If the playback device and the capture device was not set through '-D', '-P' or '-C' options, set the name of the two devices to "default". So by default, BAT will work through PulseAudio sound server on Ubuntu/Debian, and work though CRAS sound server on Chromium OS/Chrome OS.

Quoted 5 lines

If the playback device or the capture device was set through '-D', '-P' or '-C' options by user, the device name "default" will not be set.

I'm hesitating about applying patches to alsa-lib & co since Jaroslav already tagged v1.1.0.

Jaroslav, would you mind picking more changes before 1.1.0 release, or are we going to release 1.1.1 soon after that?

There are two other pending fixes for alsa-lib by Mike Frysinger, too. And possibly topology updates from Mengdong...

Takashi

Quoted 18 lines
bat/bat.c +4 -0
index 086b9fa..4310be0 100644
@@ -473,6 +473,10 @@ static int bat_init(struct bat *bat)
 			return err;
 	}
 
+	/* Set default playback and capture devices */
+	if (bat->playback.device == NULL && bat->capture.device == NULL)
+		bat->playback.device = bat->capture.device = "default";
+
 	/* Determine capture file */
 	if (bat->local) {
 		bat->capture.file = bat->playback.file;
Signature · 1 line
1.9.1