[PC-BSD Testing] sound-dev-changed.sh

Kris Moore kris at pcbsd.org
Wed Oct 10 07:47:27 PDT 2012


On 10/10/2012 10:10, N V wrote:
> Hi,
>
> I'm still here. Advanced patch, which adds the description. But I don't know 
> is this description usuable in anyway. :)
> The patch is still against r19575.
>
>
> Index: sound-dev-changed.sh
> ===================================================================
> --- sound-dev-changed.sh	(revision 19575)
> +++ sound-dev-changed.sh	(working copy)
> @@ -5,9 +5,15 @@
>  
>  regen_ossconf()
>  {
> +PCM_OSS_CONF_DIR=/compat/linux/etc/alsa/pcm/
> +PCM_OSS_CONF=${PCM_OSS_CONF_DIR}pcm-oss.conf
>  
> +if [ ! -d $PCM_OSS_CONF_DIR ]; then
> +  return
> +fi
> +
>  PCM=`egrep -o 'pcm[0-9]+' /dev/sndstat | egrep -o '[0-9]+'`
> -cat > /tmp/pcm-oss.conf <<EOF
> +OSSCONF=`cat <<EOF
>  # pcm-oss plugin configuration
>  
>  pcm.oss {
> @@ -25,16 +31,19 @@
>                  description "Open Sound System"
>          }
>  }
> +EOF`
>  
> -EOF
> +for NUM in $PCM; do
> +  UNIT_DESC=`sysctl -in dev.pcm.${NUM}.%desc`
> +  
> +  OSSCONF_UNITS=${OSSCONF_UNITS}`cat <<EOF
>  
> -for NUM in $PCM; do
> -  cat >> /tmp/pcm-oss.conf <<EOF
> + 
>  pcm.oss${NUM} {
>  	type oss
>  	device /dev/dsp${NUM}
>  	hint {
> -		description "Open Sound System Unit ${NUM}"
> +		description "oss${NUM}: ${UNIT_DESC}"
>  	}
>  }
>  
> @@ -42,14 +51,13 @@
>  	type oss
>  	device /dev/mixer${NUM}
>  	hint {
> -		description "Open Sound System Unit ${NUM}"
> +		description "oss${NUM}: ${UNIT_DESC}"
>  	}
>  }
> +EOF`
> +done
>  
> -EOF
> -
> -done
> -mv /tmp/pcm-oss.conf /compat/linux/etc/alsa/pcm/pcm-oss.conf
> +echo "${OSSCONF}${OSSCONF_UNITS}" > $PCM_OSS_CONF
>  }
>  
>  set_new_dev()
>
>
>
> On 2 октября 2012 14:38:04 N V wrote:
>> Oops.
>>
>> Lost the dircheck. I don't know what should be there: return or smth else.
>> Btw, I have little exp in shell scripting so there may be some rough places
>> in the script.
>>
>> Index: sound-dev-changed.sh
>> ===================================================================
>> --- sound-dev-changed.sh	(revision 19575)
>> +++ sound-dev-changed.sh	(working copy)
>> @@ -5,9 +5,15 @@
>>
>>  regen_ossconf()
>>  {
>> +PCM_OSS_CONF_DIR=/compat/linux/etc/alsa/pcm/
>> +PCM_OSS_CONF=${PCM_OSS_CONF_DIR}pcm-oss.conf
>>
>> +if [ ! -d $PCM_OSS_CONF_DIR ]; then
>> +  return
>> +fi
>> +
>>  PCM=`egrep -o 'pcm[0-9]+' /dev/sndstat | egrep -o '[0-9]+'`
>> -cat > /tmp/pcm-oss.conf <<EOF
>> +OSSCONF=`cat <<EOF
>>  # pcm-oss plugin configuration
>>
>>  pcm.oss {
>> @@ -25,11 +31,12 @@
>>                  description "Open Sound System"
>>          }
>>  }
>> +EOF`
>>
>> -EOF
>> -
>>  for NUM in $PCM; do
>> -  cat >> /tmp/pcm-oss.conf <<EOF
>> +  OSSCONF_UNITS=${OSSCONF_UNITS}`cat <<EOF
>> +
>> +
>>  pcm.oss${NUM} {
>>  	type oss
>>  	device /dev/dsp${NUM}
>> @@ -45,11 +52,10 @@
>>  		description "Open Sound System Unit ${NUM}"
>>  	}
>>  }
>> +EOF`
>> +done
>>
>> -EOF
>> -
>> -done
>> -mv /tmp/pcm-oss.conf /compat/linux/etc/alsa/pcm/pcm-oss.conf
>> +echo "${OSSCONF}${OSSCONF_UNITS}" > $PCM_OSS_CONF
>>  }
>>
>>  set_new_dev()
>>
>>
>> Regards,
>> Vans.
>>
>> On 25 сентября 2012 18:00:26 Kris Moore wrote:
>>> On 09/25/2012 04:40, N V wrote:
>>>> Hi.
>>>>
>>>> I've found script sound-dev-changed.sh has been extended with the
>>>> setting of the default_unit. Let me notice that we should change
>>>> default unit if this unit have playback, imho. I have a plan to extend
>>>> this script, but that should be done before RC2. Is there RC2
>>>> somethere on the horizon?
>>>>
>>>> Regards,
>>>> Vans.
>>>> _______________________________________________
>>>> Testing mailing list
>>>> Testing at lists.pcbsd.org
>>>> http://lists.pcbsd.org/mailman/listinfo/testing
>>> RC2 is still in waiting, FreeBSD is still not RC2 yet...
>>>
>>> If you want to extend the script, send a patch and I'll get it in!
>> _______________________________________________
>> 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

Sorry it took so long to take a look at this. Patch looks good, not sure
if descriptions will do anything, but it doesn't hurt to
have them in there :)

Committed!

-- 
Kris Moore
PC-BSD Software
iXsystems



More information about the Testing mailing list