[Pkg-voip-commits] r7055 - in /qutecom/trunk/debian/patches/generic: fix-alsa-mixer.patch fix-ring-pulseaudio.patch

cavedon-guest at alioth.debian.org cavedon-guest at alioth.debian.org
Sat Apr 25 23:46:41 UTC 2009


Author: cavedon-guest
Date: Sat Apr 25 23:46:41 2009
New Revision: 7055

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=7055
Log:
update fix-alsa-mixer.patch

Modified:
    qutecom/trunk/debian/patches/generic/fix-alsa-mixer.patch
    qutecom/trunk/debian/patches/generic/fix-ring-pulseaudio.patch

Modified: qutecom/trunk/debian/patches/generic/fix-alsa-mixer.patch
URL: http://svn.debian.org/wsvn/pkg-voip/qutecom/trunk/debian/patches/generic/fix-alsa-mixer.patch?rev=7055&op=diff
==============================================================================
--- qutecom/trunk/debian/patches/generic/fix-alsa-mixer.patch (original)
+++ qutecom/trunk/debian/patches/generic/fix-alsa-mixer.patch Sat Apr 25 23:46:41 2009
@@ -1,30 +1,102 @@
+Fix handling of ALSA miser devices
+http://trac.qutecom.org/ticket/40
 Index: qutecom-2.2~rc3.dfsg1/libs/sound/src/linux/LinuxVolumeControl.cpp
 ===================================================================
---- qutecom-2.2~rc3.dfsg1.orig/libs/sound/src/linux/LinuxVolumeControl.cpp	2009-04-24 19:59:30.000000000 -0700
-+++ qutecom-2.2~rc3.dfsg1/libs/sound/src/linux/LinuxVolumeControl.cpp	2009-04-24 20:27:21.000000000 -0700
-@@ -52,10 +52,10 @@
+--- qutecom-2.2~rc3.dfsg1.orig/libs/sound/src/linux/LinuxVolumeControl.cpp	2008-12-18 05:22:36.000000000 -0800
++++ qutecom-2.2~rc3.dfsg1/libs/sound/src/linux/LinuxVolumeControl.cpp	2009-04-25 16:09:05.000000000 -0700
+@@ -30,6 +30,7 @@
+ 
+ LinuxVolumeControl::LinuxVolumeControl(const AudioDevice & audioDevice) {
+ 	_audioDevice = audioDevice;
++	_strDeviceName = audioDevice.getData()[1];
+ 
+ 	EnumDeviceType::DeviceType deviceType =
+ 		EnumDeviceType::toDeviceType(audioDevice.getData()[2]);
+@@ -37,11 +38,11 @@
+ 	switch (deviceType) {
+ 	case EnumDeviceType::DeviceTypeMicrophoneIn:
+ 	case EnumDeviceType::DeviceTypeWaveIn:
+-		_strDeviceType = "capture";
++		_deviceType = CAPTURE_VOLUME;
+ 		break;
+ 	case EnumDeviceType::DeviceTypeMasterVolume:
+ 	case EnumDeviceType::DeviceTypeWaveOut:
+-		_strDeviceType = "pcm";
++		_deviceType = MASTER_VOLUME;
+ 		break;
+ 	default:
+ 		LOG_FATAL("Unknown audio device type");
+@@ -50,26 +51,14 @@
+ 
+ int LinuxVolumeControl::getLevel() {
  	int level;
- 	// TODO: retrieve the sound card name from the AudioDevice
- 	if (_strDeviceType == "pcm") {
+-	// TODO: retrieve the sound card name from the AudioDevice
+-	if (_strDeviceType == "pcm") {
 -		get_mixer_level("hw:0", PCM_VOLUME, &level);
-+		get_mixer_level("default", MASTER_VOLUME, &level);
- 		return level;
- 	} else if (_strDeviceType == "capture") {
+-		return level;
+-	} else if (_strDeviceType == "capture") {
 -		get_mixer_level("hw:0", CAPTURE_VOLUME, &level);
-+		get_mixer_level("default", CAPTURE_VOLUME, &level);
- 		return level;
+-		return level;
++	if(get_mixer_level(_strDeviceName.c_str(), _deviceType, &level) < 0) {
++		return -1;
  	}
- 	return -1;
-@@ -64,10 +64,10 @@
+-	return -1;
++	return level;
+ }
+ 
  bool LinuxVolumeControl::setLevel(unsigned level) {
- 	// TODO: retrieve the sound card name from the AudioDevice
- 	if (_strDeviceType == "pcm") {
+-	// TODO: retrieve the sound card name from the AudioDevice
+-	if (_strDeviceType == "pcm") {
 -		return set_mixer_level("hw:0", PCM_VOLUME, level);
-+		return set_mixer_level("default", MASTER_VOLUME, level);
- 		return level;
- 	} else if (_strDeviceType == "capture") {
+-		return level;
+-	} else if (_strDeviceType == "capture") {
 -		return set_mixer_level("hw:0", CAPTURE_VOLUME, level);
-+		return set_mixer_level("default", CAPTURE_VOLUME, level);
+-	}
+-	return false;
++	return set_mixer_level(_strDeviceName.c_str(), _deviceType, level) >= 0;
+ }
+ 
+ bool LinuxVolumeControl::isMuted() {
+Index: qutecom-2.2~rc3.dfsg1/libs/sound/src/linux/LinuxVolumeControl.h
+===================================================================
+--- qutecom-2.2~rc3.dfsg1.orig/libs/sound/src/linux/LinuxVolumeControl.h	2009-04-25 16:04:55.000000000 -0700
++++ qutecom-2.2~rc3.dfsg1/libs/sound/src/linux/LinuxVolumeControl.h	2009-04-25 16:11:07.000000000 -0700
+@@ -25,6 +25,8 @@
+ 
+ #include <string>
+ 
++#include "alsa_mixer.h"
++
+ /**
+  * Gets and change the volume of a Linux audio device.
+  *
+@@ -48,8 +50,8 @@
+ private:
+ 
+ 	AudioDevice _audioDevice;
+-
+-	std::string _strDeviceType;
++	std::string _strDeviceName;
++	volume_t _deviceType;
+ };
+ 
+ #endif	//LINUXVOLUMECONTROL_H
+Index: qutecom-2.2~rc3.dfsg1/libs/sound/src/linux/alsa_mixer.cpp
+===================================================================
+--- qutecom-2.2~rc3.dfsg1.orig/libs/sound/src/linux/alsa_mixer.cpp	2009-04-25 16:09:23.000000000 -0700
++++ qutecom-2.2~rc3.dfsg1/libs/sound/src/linux/alsa_mixer.cpp	2009-04-25 16:09:59.000000000 -0700
+@@ -262,7 +262,6 @@
+ 
+ int get_mixer_level(const char *sound_card, volume_t volume_type, int *level) {
+ 	snd_mixer_t *mixer_handle;
+-	int err = -1;
+ 
+ 	mixer_handle = open_mixer(sound_card);
+ 	if (mixer_handle == NULL) {
+@@ -292,5 +291,5 @@
  	}
- 	return false;
+ 
+ 	close_mixer(mixer_handle);
+-	return err;
++	return 0;
  }

Modified: qutecom/trunk/debian/patches/generic/fix-ring-pulseaudio.patch
URL: http://svn.debian.org/wsvn/pkg-voip/qutecom/trunk/debian/patches/generic/fix-ring-pulseaudio.patch?rev=7055&op=diff
==============================================================================
--- qutecom/trunk/debian/patches/generic/fix-ring-pulseaudio.patch (original)
+++ qutecom/trunk/debian/patches/generic/fix-ring-pulseaudio.patch Sat Apr 25 23:46:41 2009
@@ -1,3 +1,4 @@
+Handle ALSA returning 1 for success when pulesudio is used.
 Index: qutecom-2.2~rc3.dfsg1/libs/sound/src/linux/alsa_sndfile.cpp
 ===================================================================
 --- qutecom-2.2~rc3.dfsg1.orig/libs/sound/src/linux/alsa_sndfile.cpp	2009-04-24 18:56:11.000000000 -0700




More information about the Pkg-voip-commits mailing list