[Bug 211684] audio/pulseaudio: Respect hw.snd.default_unit

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Aug 10 14:25:23 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211684

--- Comment #4 from lightside <lightside at gmx.com> ---
Created attachment 173511
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=173511&action=edit
Proposed patch (since 419133 revision) for v8.0

(In reply to comment #3)
> I think, the other possible approach is following:
> If user didn't set-default-sink (or other possible value(s)), then try to
> determine the hw.snd.default_unit and change it accordingly.
I created new patch for mentioned approach, which also parses "play" and "rec"
strings to determine the default sink and/or source device(s).
While testing I noticed, that PulseAudio may decide to use previously changed
default sink, in case of source only device, for example:
# sysctl hw.snd.default_unit=0
hw.snd.default_unit: 0 -> 0
% cat /dev/sndstat | sed -e 's|<.*>|<Some device>|'
Installed devices:
pcm0: <Some device> (play/rec) default
pcm1: <Some device> (play)
pcm2: <Some device> (rec)
% echo -n | paplay --raw
% pacmd dump | grep set-default-s
set-default-sink oss_output.dsp0
set-default-source oss_input.dsp0
% pacmd exit

# sysctl hw.snd.default_unit=1
hw.snd.default_unit: 0 -> 1
% cat /dev/sndstat | sed -e 's|<.*>|<Some device>|'
Installed devices:
pcm0: <Some device> (play/rec)
pcm1: <Some device> (play) default
pcm2: <Some device> (rec)
% echo -n | paplay --raw
% pacmd dump | grep set-default-s
set-default-sink oss_output.dsp1
set-default-source oss_input.dsp0
% pacmd exit

# sysctl hw.snd.default_unit=2
hw.snd.default_unit: 1 -> 2
% cat /dev/sndstat | sed -e 's|<.*>|<Some device>|'
Installed devices:
pcm0: <Some device> (play/rec)
pcm1: <Some device> (play)
pcm2: <Some device> (rec) default
% echo -n | paplay --raw
% pacmd dump | grep set-default-s
set-default-sink oss_output.dsp1
set-default-source oss_input.dsp2
% pacmd exit

# sysctl hw.snd.default_unit=0
hw.snd.default_unit: 2 -> 0
% echo -n | paplay --raw
% pacmd dump | grep set-default-s
set-default-sink oss_output.dsp0
set-default-source oss_input.dsp0
% pacmd exit

# sysctl hw.snd.default_unit=2
hw.snd.default_unit: 0 -> 2
% echo -n | paplay --raw
% pacmd dump | grep set-default-s
set-default-sink oss_output.dsp0
set-default-source oss_input.dsp2
% pacmd exit

# sysctl hw.snd.default_unit=0
hw.snd.default_unit: 2 -> 0
% echo -n | paplay --raw
% pacmd dump | grep set-default-s
set-default-sink oss_output.dsp0
set-default-source oss_input.dsp0
% pacmd exit

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.


More information about the freebsd-gnome mailing list