[alsa-devel] USB asynchronous mode feedback format

Alex Lee lee188 at singnet.com.sg
Sat Oct 16 03:52:54 CEST 2010


On Fri, 2010-10-15 at 19:19 +0200, Julian Scheel wrote:

> 
> Correcting myself. It detects the card, but playback is not possible anymore:
> 
> LC_ALL=en speaker-test -Dusb -c 2 -t sine -f 1000
> 
> speaker-test 1.0.23
> 
> Playback device is usb
> Stream parameters are 48000Hz, S16_LE, 2 channels
> Sine wave rate is 1000.0000Hz
> Rate set to 48000Hz (requested 48000Hz)
> Buffer size range from 96 to 262144
> Period size range from 48 to 131072
> Using max buffer size 262144
> Periods = 4
> Unable to set hw params for playback: Broken pipe
> Setting of hwparams failed: Broken pipe
> 
> Is this a hint to not-working feedback? (c:

You may need to respond to the specific requests for get and set of the
sampling rate of the audio stream, once you have the Sample Rate
Attribute set.  See my sdr-widget code to process these requests:

   //  assume all other requests are for AUDIO interface

	   switch (request)
	    {
	       case BR_REQUEST_SET_CUR:
	          audio_set_cur();
	          return TRUE;
	          // No need to break here !

	       case BR_REQUEST_SET_MIN:     //! Set MIN,MAX and RES not
supported
	       case BR_REQUEST_SET_MAX:
	       case BR_REQUEST_SET_RES:
	          return FALSE;
	          // No need to break here !

	       case BR_REQUEST_GET_CUR:
	          audio_get_cur();
	          return TRUE;
	          // No need to break here !

	       case BR_REQUEST_GET_MIN:
	          audio_get_min();
	          return TRUE;
	          // No need to break here !

	       case BR_REQUEST_GET_MAX:
	          audio_get_max();
	          return TRUE;
	          // No need to break here !

	       case BR_REQUEST_GET_RES:
	          audio_get_res();
	          return TRUE;
	          // No need to break here !

	       default:
	          return FALSE;
	          // No need to break here !
	    }




More information about the Alsa-devel mailing list