[PC-BSD Testing] no sound in 9.1-RC2

N V vans9 at yandex.ru
Fri Oct 26 06:38:14 PDT 2012


On 26 октября 2012 16:33:28 N V wrote:
> On 26 октября 2012 00:22:39 Kris Moore wrote:
> > On 10/25/2012 15:51, Hans Ruhe wrote:
> > > Hi James,
> > > 
> > > In the Control Panel there is the sound config icon, where you can
> > > find the correct soundcard for your system. I had to find out too, but
> > > after choosing the correct configuration it worked very well :-)
> > > 
> > > Best regards,
> > > 
> > > Hans
> > > 
> > > 2012/10/25 James T. Nixon III <james at ixsystems.com
> > > <mailto:james at ixsystems.com>>
> > > 
> > >     Hey guise,
> > >     
> > >     A few of us are experiencing issues with sound.  Has this been
> > >     discovered already?
> > >     
> > >     --james
> > >     _______________________________________________
> > >     Testing mailing list
> > >     Testing at lists.pcbsd.org <mailto:Testing at lists.pcbsd.org>
> > >     http://lists.pcbsd.org/mailman/listinfo/testing
> > > 
> > > _______________________________________________
> > > Testing mailing list
> > > Testing at lists.pcbsd.org
> > > http://lists.pcbsd.org/mailman/listinfo/testing
> > 
> > I did find an issue with this from devd calling sound-dev-changed.sh
> > during system bootup. To fix grab this file:
> > 
> > # svn co
> > svn://svn.pcbsd.org/pcbsd/current/overlays/desktop-overlay/usr/local/shar
> > e/ pcbsd/scripts/sound-dev-changed.sh # mv sound-dev-changed.sh
> > /usr/local/share/pcbsd/scripts/sound-dev-changed.sh
> > # chmod 755 /usr/local/share/pcbsd/scripts/sound-dev-changed.sh
> 
> Hi.
> 
> I've improved the script one step further, possibly. It set default_unit to
> the last play capable device previously. Now it just checks if newly
> attached device is playback capable and if it is sets default_sound_unit.
> default_sound_unit havn't been restored properly upon detach previously,
> because default_sound_unit has been set to the device that doesn't
> disappear/destroy upon detach. So, seems this should solve two possible
> problems in one shot. :) I have to note again: this script/patch may be
> ugly or rough.
> 
> Patch (against pcbsd/current/overlays/desktop-overlay/):
> Index: etc/devd.conf
> ===================================================================
> --- etc/devd.conf       (revision 19958)
> +++ etc/devd.conf       (working copy)
> @@ -271,3 +271,3 @@
>         match "cdev"            "mixer[0-9]+";
> -       action "sleep 2 ;
> /usr/local/share/pcbsd/scripts/sound-dev-changed.sh add";
> +       action "sleep 2 ;
> /usr/local/share/pcbsd/scripts/sound-dev-changed.sh add $cdev";
>  };
> @@ -279,3 +279,3 @@
>         match "cdev"            "mixer[0-9]+";
> -       action "sleep 2 ;
> /usr/local/share/pcbsd/scripts/sound-dev-changed.sh del";
> +       action "sleep 2 ;
> /usr/local/share/pcbsd/scripts/sound-dev-changed.sh del $cdev";
>  };
> Index: usr/local/share/pcbsd/scripts/sound-dev-changed.sh
> ===================================================================
> --- usr/local/share/pcbsd/scripts/sound-dev-changed.sh  (revision 19958)
> +++ usr/local/share/pcbsd/scripts/sound-dev-changed.sh  (working copy)
> @@ -4,2 +4,3 @@
>  action=$1
> +cdev=$2
> 
> @@ -17,2 +18,3 @@
>  # pcm-oss plugin configuration
> +# generated by ${0}
> 
> @@ -70,6 +72,12 @@
> 
> -   # Get the last pcm device so we can make it the default
> -   newDev=`cat /dev/sndstat | grep play | egrep -o 'pcm[0-9]+' | tail -n
> 1` -   dNum=`echo $newDev | sed 's|pcm||g'`
> -   sysctl hw.snd.default_unit=$dNum
> +   mixerNum=`echo ${cdev} | egrep -o '[0-9]+'`
> +
> +   # Can new dev play?
> +   cat /dev/sndstat | grep pcm${mixerNum} | grep -q play
> +   if [ $? -ne 0 ] ; then
> +      return
> +   fi
> +
> +   # make new device the default one
> +   sysctl hw.snd.default_unit=$mixerNum
>  }
> 
> 
> P.S. If I attach the file instead of copying it's contents into the message
> body will it reach the list?
> 
> Regards,
> Vans.
> _______________________________________________
> Testing mailing list
> Testing at lists.pcbsd.org
> http://lists.pcbsd.org/mailman/listinfo/testing


Few notes.

- There is a sleep for 2 seconds before script start which slows down the boot 
for about 10 seconds, cause devd notify is triggered some number of times (for 
each sound device in system, I suppose) at boot too. As for me that's ok, but 
boot speedups (including those that were made to rc) become pointless imho. 
Can we push it to the background or make script start without sleep delay? The 
second variant makes us to add some kind of pidfile possibly. Which leads us to 
complicated script imho. If we need such complicated script, isn't it easier 
to make user switch default_sound_unit through pc-bsd's super nice gui? :)
- Autochange of default_sound_unit adds some kind of automagical stuff that 
advanced user cann't trace easily imho. But may be desired by those users who 
plug in usb speakers/headphones. So it's entirely up to user experience.
- Btw, active application will stream sound to the current default_sound_unit 
unit the playback is restarted. Than it streams to newly setup 
default_sound_unit. This was tested in Clementine only.

Regards,
Vans.


More information about the Testing mailing list