On Sat, Jun 15, 2013 at 01:40:55PM +0200, Alexandre Ratchov wrote:
> This is a small diff to enable mavb(4) 24-bit native format. To
> test it, first check that audio works without the diff. Then, apply
> the diff, kill sndiod, and run it as:
> 
>       sndiod -dd -e s24be4lsb
> 
> then play any audio file; sndiod should log something like:
> 
> snd0: 48000Hz, s24be4lsb, play 0:1, rec 0:1, 9 blocks of 960 frames

mavb0 at macebus0 base 0x00300000 irq 6: AD1843 rev 1
audio0 at mavb0

o2:~$ sndiod -dd -e s24be4lsb
snd0.default: rec=0:1 play=0:1 vol=23170 dup
snd0: 48000Hz, s24be4lsb, play 0:1, rec 0:1, 8 blocks of 1024 frames
mpg0: 48000Hz, s16be, play 0:15, 8 blocks of 1024 frames
snd0: device started

> 
> does it? if so, does it sound right?

Sounds alright, no problems.

> 
> Thanks!
> 
> -- Alexandre
> 
> Index: mavb.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/sgi/dev/mavb.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 mavb.c
> --- mavb.c    15 May 2013 08:29:23 -0000      1.15
> +++ mavb.c    15 Jun 2013 11:29:10 -0000
> @@ -522,7 +522,10 @@ mavb_set_params(void *hdl, int setmode, 
>                                       return (EINVAL);
>                               }
>                       } else {
> -                             return (EINVAL);
> +                             play->factor = 1;
> +                             play->sw_code = NULL;
> +                             play->channels = 2;
> +                             play->precision = 24;
>                       }
>                       break;
>               default:
> @@ -538,7 +541,7 @@ mavb_set_params(void *hdl, int setmode, 
>                       return (error);
>  
>               play->bps = AUDIO_BPS(play->precision);
> -             play->msb = 1;
> +             play->msb = 0;
>       }
>  
>       if (setmode & AUMODE_RECORD) {
> @@ -556,7 +559,11 @@ mavb_set_params(void *hdl, int setmode, 
>                               rec->factor = 2;
>                               rec->sw_code = linear24_to_linear16_be;
>                       } else {
> -                             return (EINVAL);
> +                             rec->factor = 1;
> +                             rec->sw_code = NULL;
> +                             rec->channels = 2;
> +                             rec->precision = 24;
> +                             break;
>                       }
>                       break;
>               default:
> @@ -575,7 +582,7 @@ mavb_set_params(void *hdl, int setmode, 
>                       return (error);
>  
>               rec->bps = AUDIO_BPS(rec->precision);
> -             rec->msb = 1;
> +             rec->msb = 0;
>       }
>  
>       return (0);
> 

Reply via email to