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

Kris Moore kris at pcbsd.org
Fri Oct 26 11:40:46 PDT 2012


On 10/26/2012 14:18, N V wrote:
> Hi.
>
> I've seen your commit. Sorry I havn't replied. I've checked out it today. It does slightly different thing than expected: it sets default_unit to the last device with "play" capability, which may be not the device that has been plugged in. That's why I've posted the patch in previous version.
>
> Regards,
> Vans.

In my testing it looks like the last device is always the most recently
plugged in one... Can you send the .patch file directly to my e-mail so
I can take a look?

>
> 26.10.2012, 20:58, "Kris Moore" <kris at pcbsd.org>:
>> On 10/26/2012 09:38, N V wrote:
>>
>>>  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.
>>>  _______________________________________________
>>>  Testing mailing list
>>>  Testing at lists.pcbsd.org
>>>  http://lists.pcbsd.org/mailman/listinfo/testing
>> Thanks for the suggestions! I removed the sleep statements to speed up
>> the bootup process. Also, the "play" keyword was put in a few days ago.
>> Can you check the version in SVN and see if it does what you expect now?
>>
>> --
>> Kris Moore
>> PC-BSD Software
>> iXsystems
>>
>> _______________________________________________
>> Testing mailing list
>> 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


-- 
Kris Moore
PC-BSD Software
iXsystems



More information about the Testing mailing list