Re: Get SPDIF-in sample rate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Denis Shulyaka wrote:
> 2017-07-18 8:47 GMT+02:00 Clemens Ladisch:
> > > Does ALSA provide any general interface for the userspace applications
> > > that indicates the SPDIF source sample rate?
> >
> > Yes, but the USB audio driver does not implement it because the USB
> > audio specification does not define such an interface between the driver
> > and the device.
>
> What could I use if I had a non-USB sound card with SPDIF-in?

There would be a mixer control "IEC958 Capture Default" associated with
the PCM device (i.e., not a real mixer control visible in alsamixer),
containing the channel status bits; the "IEC958 Capture Mask" control
defines which bits are valid.

> > At the moment, you have to write the code yourself.  But if you've
> > tested it, we would be interested in integrating it into the kernel
> > driver.
>
> The below program outputs the current SPDIF-In sample rate of my card.

The HID interface is managed by another driver.  The kernel driver
already knows how to write to these registers with a control request
instead (see below).  Could you check if a control read request works,
or if the response still goes through the HID pipe?


Regards,
Clemens
-- 

static int snd_usb_cm106_write_int_reg(struct usb_device *dev, int reg, u16 value)
{
	u8 buf[4];
	buf[0] = 0x20;
	buf[1] = value & 0xff;
	buf[2] = (value >> 8) & 0xff;
	buf[3] = reg;
	return snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_CONFIGURATION,
			       USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT,
			       0, 0, &buf, 4);
}

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux