diff --git a/0007-remove-all-preamp.patch b/0007-remove-all-preamp.patch new file mode 100644 index 0000000..3182ed1 --- /dev/null +++ b/0007-remove-all-preamp.patch @@ -0,0 +1,13 @@ +Index: pulseaudio-equalizer-2.7.0.2/usr/bin/pulseaudio-equalizer +=================================================================== +--- pulseaudio-equalizer-2.7.0.2.orig/usr/bin/pulseaudio-equalizer ++++ pulseaudio-equalizer-2.7.0.2/usr/bin/pulseaudio-equalizer +@@ -290,7 +290,7 @@ if [ "$1" = "enable-config" ]; then + + # Set LADSPA sink as default sink & set appropriate master sink (preamp) volume + echo "set-default-sink $PA_LADSPA_SINK" >>$HOME/.config/pulse/default.pa +- echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>$HOME/.config/pulse/default.pa ++ #echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>$HOME/.config/pulse/default.pa + echo "set-sink-mute $PA_MASTER_SINK 0" >>$HOME/.config/pulse/default.pa + echo "### END: Equalized audio configuration" >>$HOME/.config/pulse/default.pa + diff --git a/0008-fix-locale-issues.patch b/0008-fix-locale-issues.patch new file mode 100644 index 0000000..283e319 --- /dev/null +++ b/0008-fix-locale-issues.patch @@ -0,0 +1,84 @@ +diff -aur a/usr/bin/pulseaudio-equalizer b/usr/bin/pulseaudio-equalizer +--- a/usr/bin/pulseaudio-equalizer ++++ b/usr/bin/pulseaudio-equalizer +@@ -18,6 +18,7 @@ + PA_PREAMP="1.0" + PA_CURRENT_PRESET="" + ++LC_MESSAGES=C + PRESET_DIR1=$HOME/.config/pulse/presets + PRESET_DIR2=/usr/share/pulseaudio-equalizer/presets + SCRIPT_NAME=pulseaudio-equalizer +@@ -108,20 +109,20 @@ + + # Get sink names and volumes + PA_LADSPA_SINK="ladspa_output.$PA_LADSPA_PLUGIN.$PA_LADSPA_LABEL" +-PA_CURRENT_SINK=$(pacmd stat | grep "Default sink name" | sed 's/Default sink name: //g') +-PA_CURRENT_VOLUME=$(pacmd list | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'volume: 0:' | awk '{print $NF}' | sed 's/%//g') ++PA_CURRENT_SINK=$(pacmd stat | sed -e '/Default sink name/!d;s/Default sink name: //g') ++PA_CURRENT_VOLUME=$(pacmd list | iconv -c -t ascii | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'volume: 0:' | awk '{print $NF}' | sed 's/%//g') + PA_REAL_VOLUME=$((PA_CURRENT_VOLUME*65536/100)) + PA_REAL_PREAMP_FLOAT=$(echo "$PA_PREAMP*65536" | bc) + PA_REAL_PREAMP=${PA_REAL_PREAMP_FLOAT/\.*} +-PA_CURRENT_MUTE=$(pacmd list-sinks | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'muted: ' | sed 's/[\t]muted: no/0/g' | sed 's/[\t]muted: yes/1/g') ++PA_CURRENT_MUTE=$(pacmd list-sinks | iconv -c -t ascii | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'muted: ' | sed -e 's/[\t]muted: no/0/g;s/[\t]muted: yes/1/g') + + # Check if equalizer is running and get accurate master sink name + if [ "$PA_CURRENT_SINK" = "$PA_LADSPA_SINK" ]; then + PA_EQUALIZER_STATUS=1 +- PA_MASTER_SINK=$(pacmd info | grep -A30 "<$PA_CURRENT_SINK>" | grep -m1 'device.master_device = ' | sed 's/device.master_device = //g' | sed 's/"//g' | sed 's/^[ \t]*//') ++ PA_MASTER_SINK=$(pacmd info | iconv -c -t ascii | grep -A30 "<$PA_CURRENT_SINK>" | grep -m1 'device.master_device = ' | sed -e 's/device.master_device = //g;s/"//g;s/^[ \t]*//') + else + PA_EQUALIZER_STATUS=0 +- PA_MASTER_SINK=$(pacmd stat | grep 'Default sink name' | sed 's/Default sink name: //g') ++ PA_MASTER_SINK=$(pacmd stat | sed -e '/Default sink name/!d;s/Default sink name: //g') + fi + + # Check if equalizer is set as persistent +@@ -337,16 +338,16 @@ + + # Unload & reload stream-restore module + echo "Unloading & reloading stream-restore module..." +- echo >>/tmp/eqcommands.sh "unload-module $(pacmd list | grep -B1 -m1 'name: ' | grep ' index: ' | sed 's/ index: //g')" ++ echo >>/tmp/eqcommands.sh "unload-module $(pacmd list | iconv -c -t ascii | grep -B1 -m1 'name: ' | sed -e '/ index: /!d;s/ index: //g')" + echo >>/tmp/eqcommands.sh "load-module module-stream-restore" + + # Unload LADSPA sink module (if it is already loaded) + echo "Unloading module-ladspa-sink..." +- echo >>/tmp/eqcommands.sh "unload-module $(pacmd list | grep -B1 -m1 'name: ' | grep ' index: ' | sed 's/ index: //g')" ++ echo >>/tmp/eqcommands.sh "unload-module $(pacmd list | iconv -c -t ascii | grep -B1 -m1 'name: ' | sed -e '/ index: /!d;s/ index: //g')" + + # Move active client sinks to ALSA sink + echo "Moving active PulseAudio clients to ALSA sink ($PA_MASTER_SINK)..." +- echo >>/tmp/eqcommands.sh "$(pacmd "list-sink-inputs" | grep 'index: ' | sed 's/ index: /move-sink-input /g' | sed "s/$/ $PA_MASTER_SINK/g")" ++ echo >>/tmp/eqcommands.sh "$(pacmd "list-sink-inputs" | iconv -c -t ascii | sed -e '/index: /!d;s/ index: /move-sink-input /g;s/$/ $PA_MASTER_SINK/g")" + + # Transfer current mute/sink volume to ALSA sink + echo "Transferring current mute ($PA_CURRENT_MUTE) & volume ($PA_CURRENT_VOLUME%) to ALSA sink ($PA_MASTER_SINK)..." +@@ -366,7 +367,7 @@ + + # Unload & reload stream-restore module with restore_device option disabled (to ensure that previously cached per-client sinks are not used) + echo "Unloading & reloading stream-restore module..." +- echo >>/tmp/eqcommands.sh "unload-module $(pacmd list | grep -B1 -m1 'name: ' | grep ' index: ' | sed 's/ index: //g')" ++ echo >>/tmp/eqcommands.sh "unload-module $(pacmd list | iconv -c -t ascii | grep -B1 -m1 'name: ' | sed -e '/ index: /!d;s/ index: //g')" + echo >>/tmp/eqcommands.sh "load-module module-stream-restore restore_device=false" + + # Load LADSPA sink module +@@ -389,7 +390,7 @@ + + # Move currently active client sinks to LADSPA sink + echo "Moving active PulseAudio clients to LADSPA sink ($PA_LADSPA_SINK)..." +- echo >>/tmp/eqcommands.sh "$(pacmd "list-sink-inputs" | grep 'index: ' | sed 's/ index: /move-sink-input /g' | sed "s/$/ $PA_LADSPA_SINK/g")" ++ echo >>/tmp/eqcommands.sh "$(pacmd "list-sink-inputs" | iconv -c -t ascii | sed -e '/index: /!d;s/ index: /move-sink-input /g' | sed "s/$/ $PA_LADSPA_SINK/g')" + + # Execute all queued commands (for potential speed benefit)... + pacmd /dev/null +@@ -423,7 +424,7 @@ + fi + + # Refresh current sink status and display equalizer information +-PA_CURRENT_SINK=$(pacmd stat | grep "Default sink name" | sed 's/Default sink name: //g') ++PA_CURRENT_SINK=$(pacmd stat | sed -e '/Default sink name/!d;s/Default sink name: //g') + if [ "$PA_CURRENT_SINK" = "$PA_LADSPA_SINK" ]; then + echo "-------------------------------------" + echo "Equalizer status: [enabled]" diff --git a/0009-do-not-zero-volume.patch b/0009-do-not-zero-volume.patch new file mode 100644 index 0000000..6048952 --- /dev/null +++ b/0009-do-not-zero-volume.patch @@ -0,0 +1,20 @@ +diff -aur a/usr/bin/pulseaudio-equalizer b/usr/bin/pulseaudio-equalizer +--- a/usr/bin/pulseaudio-equalizer ++++ b/usr/bin/pulseaudio-equalizer +@@ -110,8 +110,14 @@ + # Get sink names and volumes + PA_LADSPA_SINK="ladspa_output.$PA_LADSPA_PLUGIN.$PA_LADSPA_LABEL" + PA_CURRENT_SINK=$(pacmd stat | sed -e '/Default sink name/!d;s/Default sink name: //g') +-PA_CURRENT_VOLUME=$(pacmd list | iconv -c -t ascii | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'volume: 0:' | awk '{print $NF}' | sed 's/%//g') +-PA_REAL_VOLUME=$((PA_CURRENT_VOLUME*65536/100)) ++if [ "$( (echo '4.0'; pulseaudio --version | awk '{print $2}') | sort -V | sed -n '1p' )" = '4.0' ]; then ++ # Version of PulseAudio is superior than 4.0. ++ PA_CURRENT_VOLUME=$(pacmd list | iconv -c -t ascii | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'volume: front-left:' | awk '{print $3}') ++ PA_REAL_VOLUME="$PA_CURRENT_VOLUME" ++else ++ PA_CURRENT_VOLUME=$(pacmd list | iconv -c -t ascii | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'volume: 0:' | awk '{print $NF}' | sed 's/%//g') ++ PA_REAL_VOLUME=$((PA_CURRENT_VOLUME*65536/100)) ++fi + PA_REAL_PREAMP_FLOAT=$(echo "$PA_PREAMP*65536" | bc) + PA_REAL_PREAMP=${PA_REAL_PREAMP_FLOAT/\.*} + PA_CURRENT_MUTE=$(pacmd list-sinks | iconv -c -t ascii | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'muted: ' | sed -e 's/[\t]muted: no/0/g;s/[\t]muted: yes/1/g') diff --git a/pulseaudio-equalizer.changes b/pulseaudio-equalizer.changes index d3c3357..045ccf3 100644 --- a/pulseaudio-equalizer.changes +++ b/pulseaudio-equalizer.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Apr 29 21:12:32 UTC 2015 - sor.alexei@meowr.ru + +- Add 0007-remove-all-preamp.patch, 0008-fix-locale-issues.patch, + 0009-do-not-zero-volume.patch. + ------------------------------------------------------------------- Mon Oct 20 12:17:15 UTC 2014 - sor.alexei@meowr.ru diff --git a/pulseaudio-equalizer.spec b/pulseaudio-equalizer.spec index 4edb189..6533315 100644 --- a/pulseaudio-equalizer.spec +++ b/pulseaudio-equalizer.spec @@ -1,7 +1,7 @@ # # spec file for package pulseaudio-equalizer # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,23 +24,28 @@ License: GPL-3.0+ Group: Productivity/Multimedia/Sound/Mixers Url: http://ubuntuforums.org/showthread.php?t=1308838 Source: http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/pool/main/p/%{name}/%{name}_%{version}.orig.tar.gz -# PATCH-FIX-UPSTREAM 0001-pulse-path.patch webupd8@gmail.com -- Update path to PulseAudio files to a new one +# PATCH-FIX-UPSTREAM 0001-pulse-path.patch webupd8@gmail.com -- Update path to PulseAudio files to a new one. Patch0: 0001-pulse-path.patch -# PATCH-FIX-UPSTREAM 0002-remove-preamp.patch webupd8@gmail.com -- Remove preamp +# PATCH-FIX-UPSTREAM 0002-remove-preamp.patch webupd8@gmail.com -- Remove preamp. Patch1: 0002-remove-preamp.patch -# PATCH-FIX-UPSTREAM 0003-force-default-persistence-value.patch webupd8@gmail.com -- Force default persistence value +# PATCH-FIX-UPSTREAM 0003-force-default-persistence-value.patch webupd8@gmail.com -- Force default persistence value. Patch2: 0003-force-default-persistence-value.patch -# PATCH-FIX-UPSTREAM 0004-do-not-crash-on-missing-preset.patch webupd8@gmail.com -- Do not crash on missing preset +# PATCH-FIX-UPSTREAM 0004-do-not-crash-on-missing-preset.patch webupd8@gmail.com -- Do not crash on missing preset. Patch3: 0004-do-not-crash-on-missing-preset.patch -# PATCH-FIX-UPSTREAM 0005-window-icon.patch webupd8@gmail.com -- Correct way of setting window icon +# PATCH-FIX-UPSTREAM 0005-window-icon.patch webupd8@gmail.com -- Correct way of setting window icon. Patch4: 0005-window-icon.patch -# PATCH-FIX-UPSTREAM 0006-fix-desktop.patch malcolmlewis@opensuse.org -- Fix .desktop file +# PATCH-FIX-UPSTREAM 0006-fix-desktop.patch malcolmlewis@opensuse.org -- Fix .desktop file. Patch5: 0006-fix-desktop.patch +# PATCH-FIX-UPSTREAM 0007-remove-all-preamp.patch alex@warwickvesztrocy.co.uk -- Remove all preamp. +Patch6: 0007-remove-all-preamp.patch +# PATCH-FIX-UPSTREAM 0008-fix-locale-issues.patch sor.alexei@meowr.ru -- Fix issues on non-Latin systems. +Patch7: 0008-fix-locale-issues.patch +# PATCH-FIX-UPSTREAM 0009-do-not-zero-volume.patch sor.alexei@meowr.ru -- Fix volume zeroing on fresh PulseAudio. +Patch8: 0009-do-not-zero-volume.patch BuildRequires: update-desktop-files Requires: ladspa-swh-plugins Requires: pulseaudio >= 4.0 Requires: pulseaudio-utils >= 4.0 -Requires: python Requires: python-gnome Requires: python-gtk BuildArch: noarch @@ -57,6 +62,9 @@ GUI for PulseAudio's LADSPA interface using Steve Harris' Multiband EQ %patch3 -p1 %patch4 -p1 %patch5 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 %build # Nothing to build. @@ -64,7 +72,7 @@ GUI for PulseAudio's LADSPA interface using Steve Harris' Multiband EQ %install mkdir -p %{buildroot}%{_bindir}/ %{buildroot}%{_datadir}/%{name}/presets/ install -Dm 0755 .%{_bindir}/%{name}* %{buildroot}%{_bindir}/ -install -Dm 0644 .%{_datadir}/%{name}/%{name}.py %{buildroot}%{_datadir}/%{name}/%{name}.py +install -Dm 0755 .%{_datadir}/%{name}/%{name}.py %{buildroot}%{_datadir}/%{name}/%{name}.py install -Dm 0644 .%{_datadir}/%{name}/presets/* %{buildroot}%{_datadir}/%{name}/presets/ install -Dm 0644 .%{_datadir}/applications/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop %suse_update_desktop_file %{name} @@ -78,7 +86,6 @@ install -Dm 0644 .%{_datadir}/applications/%{name}.desktop %{buildroot}%{_datadi %files %defattr(-,root,root) %{_bindir}/%{name}* -%{_datadir}/%{name}/%{name}.py %{_datadir}/%{name}/ %{_datadir}/applications/%{name}.desktop