# OSS with USB DAC: crackles



## nadstaky (Feb 3, 2015)

Hello,

I'm using FreeBSD 10.1 and for sound I own a Cambridge Audio DAC Magic 100 (asynchronous USB).

I've noticed that it makes crackles randomly... I've had the same problem under ArchLinux (ALSA), the solution was to get a refund for the asynchronous that I had USB DAC and buy this one 

I'd like to avoid resampling (44100:16:2) as all my music collection is FLAC.

I've tried in /etc/sysctl.conf: 
	
	



```
dev.pcm.%d.bitperfect
```
I still have this issue (plus no way to control volume under VLC?).
Still in /etc/sysctl.conf:

```
dev.pcm.0.play.vchanformat=s32le:2.0
dev.pcm.0.play.vchanrate=44100
hw.snd.feeder_rate_quality=4
```
No way...

Could you help me please ?

I have a last question : When changing a value in /etc/sysctl.conf, must one reboot to apply changes or is there a command line to apply without rebooting?

I thank you for your help,
Nad


----------



## tobik@ (Feb 3, 2015)

I can't help you with your problem, but you can reload /etc/sysctl.conf with `sysctl -f /etc/sysctl.conf` or `service sysctl start`.

If you are experimenting with sysctl values you can also set them directly with e.g. `sysctl dev.pcm.0.play.vchanformat=s32le:2.0`.


----------



## nadstaky (Feb 3, 2015)

Thank you, I won't waste my time rebooting...


----------



## t1066 (Feb 3, 2015)

I once had some similar problems with USB sound card. My remedy was to buy a cheap PCI-E USB 3.0 card with a 4-pin power connector. Plugging the USB sound card into any other USB header would result in popping sound when playing music. Plugging it into the USB 3.0 card solved this problem. It may have to do with the poor mains electricity supply that I was living at that time. Since I moved away, I was able to plug my USB sound card into any USB header without encountering any problem. I would suggest trying different power socket in the house. And if you have spare power supply, change it to see if it would make any difference. Of course, you may also try a PCI-E add on card.


----------



## hselasky@ (Feb 3, 2015)

Hi,

Are you using FreeBSD 9-stable or 10-stable.

Can you dump the USB descriptor of your audio device. There is maybe a bug in the feedback endpoint handling mechanism in FreeBSD causing these crackles.

`usbconfig -d X.Y dump_device_desc dump_curr_config_desc`

Also:
– `sysctl hw.usb.uaudio.debug=15`
– Plug device.
– Paste uaudio related output from dmesg.

Thank you!

--HPS


----------



## hselasky@ (Feb 13, 2015)

Hi,

Can you update to 9-stable , 10-stable or 11-current and report if this is still an issue?

Thank you!

--HPS


----------



## laufdi (Mar 21, 2015)

I have similar problems with a USB S/PDIF output (hiFaceTWO UAC2 M2Tech). I have pops every few seconds. It is externally powered. On this machine I have this problem only since I updated kernel yesterday. 10.1-STABLE #26 r279892. bitperfect, latency and quality `sysctl`s don't make a difference.
I had it on another machine and blamed some USB disks and other periphs, but there is none here and nothing else changed


```
# usbconfig -d ugen0.3 dump_device_desc dump_curr_config_desc
ugen0.3: <hiFaceTWO UAC2 M2Tech> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x00ef  <Miscellaneous device>
  bDeviceSubClass = 0x0002
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x249c
  idProduct = 0x930b
  bcdDevice = 0x0661
  iManufacturer = 0x0001  <M2Tech>
  iProduct = 0x0003  <hiFaceTWO UAC2>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0002


 Configuration index 0

  bLength = 0x0009
  bDescriptorType = 0x0002
  wTotalLength = 0x00e7
  bNumInterfaces = 0x0003
  bConfigurationValue = 0x0001
  iConfiguration = 0x0000  <no string>
  bmAttributes = 0x0080
  bMaxPower = 0x0032

  Additional Descriptor

  bLength = 0x08
  bDescriptorType = 0x0b
  bDescriptorSubType = 0x00
  RAW dump:
  0x00 | 0x08, 0x0b, 0x00, 0x02, 0x01, 0x00, 0x20, 0x00


  Interface 0
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x0000
  bAlternateSetting = 0x0000
  bNumEndpoints = 0x0000
  bInterfaceClass = 0x0001  <Audio device>
  bInterfaceSubClass = 0x0001
  bInterfaceProtocol = 0x0020
  iInterface = 0x0003  <hiFaceTWO UAC2>

  Additional Descriptor

  bLength = 0x09
  bDescriptorType = 0x24
  bDescriptorSubType = 0x01
  RAW dump:
  0x00 | 0x09, 0x24, 0x01, 0x00, 0x02, 0x08, 0x48, 0x00,
  0x08 | 0x00

  Additional Descriptor

  bLength = 0x08
  bDescriptorType = 0x24
  bDescriptorSubType = 0x0a
  RAW dump:
  0x00 | 0x08, 0x24, 0x0a, 0x29, 0x03, 0x07, 0x00, 0x0e


  Additional Descriptor

  bLength = 0x08
  bDescriptorType = 0x24
  bDescriptorSubType = 0x0b
  RAW dump:
  0x00 | 0x08, 0x24, 0x0b, 0x28, 0x01, 0x29, 0x03, 0x0d


  Additional Descriptor

  bLength = 0x11
  bDescriptorType = 0x24
  bDescriptorSubType = 0x02
  RAW dump:
  0x00 | 0x11, 0x24, 0x02, 0x02, 0x01, 0x01, 0x00, 0x28,
  0x08 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
  0x10 | 0x06

  Additional Descriptor

  bLength = 0x12
  bDescriptorType = 0x24
  bDescriptorSubType = 0x06
  RAW dump:
  0x00 | 0x12, 0x24, 0x06, 0x0a, 0x02, 0x0f, 0x00, 0x00,
  0x08 | 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
  0x10 | 0x00, 0x00


  Additional Descriptor

  bLength = 0x0c
  bDescriptorType = 0x24
  bDescriptorSubType = 0x03
  RAW dump:
  0x00 | 0x0c, 0x24, 0x03, 0x14, 0x01, 0x03, 0x00, 0x0a,
  0x08 | 0x28, 0x00, 0x00, 0x00



  Interface 1
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x0001
  bAlternateSetting = 0x0000
  bNumEndpoints = 0x0000
  bInterfaceClass = 0x0001  <Audio device>
  bInterfaceSubClass = 0x0002
  bInterfaceProtocol = 0x0020
  iInterface = 0x0004  <hiFaceTWO UAC2 Output>


  Interface 1 Alt 1
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x0001
  bAlternateSetting = 0x0001
  bNumEndpoints = 0x0002
  bInterfaceClass = 0x0001  <Audio device>
  bInterfaceSubClass = 0x0002
  bInterfaceProtocol = 0x0020
  iInterface = 0x0004  <hiFaceTWO UAC2 Output>

  Additional Descriptor

  bLength = 0x10
  bDescriptorType = 0x24
  bDescriptorSubType = 0x01
  RAW dump:
  0x00 | 0x10, 0x24, 0x01, 0x02, 0x00, 0x01, 0x01, 0x00,
  0x08 | 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10


  Additional Descriptor

  bLength = 0x06
  bDescriptorType = 0x24
  bDescriptorSubType = 0x02
  RAW dump:
  0x00 | 0x06, 0x24, 0x02, 0x01, 0x04, 0x18


  Endpoint 0
  bLength = 0x0007
  bDescriptorType = 0x0005
  bEndpointAddress = 0x0001  <OUT>
  bmAttributes = 0x0005  <ASYNC-ISOCHRONOUS>
  wMaxPacketSize = 0x00c8
  bInterval = 0x0001
  bRefresh = 0x0000
  bSynchAddress = 0x0000

  Additional Descriptor

  bLength = 0x08
  bDescriptorType = 0x25
  bDescriptorSubType = 0x01
  RAW dump:
  0x00 | 0x08, 0x25, 0x01, 0x00, 0x00, 0x02, 0x08, 0x00


  Endpoint 1
  bLength = 0x0007
  bDescriptorType = 0x0005
  bEndpointAddress = 0x0081  <IN>
  bmAttributes = 0x0011  <ISOCHRONOUS>
  wMaxPacketSize = 0x0004
  bInterval = 0x0004
  bRefresh = 0x0000
  bSynchAddress = 0x0000


  Interface 1 Alt 2
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x0001
  bAlternateSetting = 0x0002
  bNumEndpoints = 0x0002
  bInterfaceClass = 0x0001  <Audio device>
  bInterfaceSubClass = 0x0002
  bInterfaceProtocol = 0x0020
  iInterface = 0x0004  <hiFaceTWO UAC2 Output>

  Additional Descriptor

  bLength = 0x10
  bDescriptorType = 0x24
  bDescriptorSubType = 0x01
  RAW dump:
  0x00 | 0x10, 0x24, 0x01, 0x02, 0x00, 0x01, 0x01, 0x00,
  0x08 | 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10


  Additional Descriptor

  bLength = 0x06
  bDescriptorType = 0x24
  bDescriptorSubType = 0x02
  RAW dump:
  0x00 | 0x06, 0x24, 0x02, 0x01, 0x02, 0x10


  Endpoint 0
  bLength = 0x0007
  bDescriptorType = 0x0005
  bEndpointAddress = 0x0001  <OUT>
  bmAttributes = 0x0005  <ASYNC-ISOCHRONOUS>
  wMaxPacketSize = 0x0064
  bInterval = 0x0001
  bRefresh = 0x0000
  bSynchAddress = 0x0000

  Additional Descriptor

  bLength = 0x08
  bDescriptorType = 0x25
  bDescriptorSubType = 0x01
  RAW dump:
  0x00 | 0x08, 0x25, 0x01, 0x00, 0x00, 0x02, 0x08, 0x00


  Endpoint 1
  bLength = 0x0007
  bDescriptorType = 0x0005
  bEndpointAddress = 0x0081  <IN>
  bmAttributes = 0x0011  <ISOCHRONOUS>
  wMaxPacketSize = 0x0004
  bInterval = 0x0004
  bRefresh = 0x0000
  bSynchAddress = 0x0000


  Interface 2
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x0002
  bAlternateSetting = 0x0000
  bNumEndpoints = 0x0000
  bInterfaceClass = 0x00fe  <Application specific>
  bInterfaceSubClass = 0x0001
  bInterfaceProtocol = 0x0001
  iInterface = 0x000f  <M2Tech DFU>

  Additional Descriptor

  bLength = 0x09
  bDescriptorType = 0x21
  bDescriptorSubType = 0x07
  RAW dump:
  0x00 | 0x09, 0x21, 0x07, 0xfa, 0x00, 0x40, 0x00, 0x10,
  0x08 | 0x01
```


----------



## protocelt (Mar 21, 2015)

I also have a similar issue with a Focusrite USB 2.0 audio interface that I just noticed today. Seems there is another user with a similar issue that has filed a PR 198444.


----------



## hselasky@ (Mar 21, 2015)

protocelt said:


> I also have a similar issue with a Focusrite USB 2.0 audio interface that I just noticed today. Seems there is another user with a similar issue that has filed a PR 198444.



Can you try the last "USB audio" patch in PR 198444 ?

--HPS


----------



## protocelt (Mar 21, 2015)

hselasky@ said:


> Can you try the last "USB audio" patch in PR 198444 ?
> 
> --HPS


Hi,

I've just tested the patch on 11-CURRENT r280199. It seems to work quite well for me thus far. Oh, and attached log is post patch. Thanks


----------



## hselasky@ (Mar 21, 2015)

Hi,

I've just updated 11-current. Could you do a simple listening test? Use SOX for example to playback a pure sine wave, like 300-400Hz. Play it for 1-5 minutes and see if you can hear any phase shifts. The USB audio specification is very silent about how playback only devices should be synchronized when asynchronous isochronous endpoints are used.

--HPS


----------



## protocelt (Mar 22, 2015)

Ok, I've updated 11-CURRENT to r280327. I've created both a 300Hz and 400Hz 3 minute long simple sine wave file. I *do* notice clicking/popping at 4 to 5 second intervals again on playback however did not notice any other playback anomalies. In case it is relevant, my device is in fact a recording interface however only audio outputs are detected and used under FreeBSD.


----------



## hselasky@ (Mar 22, 2015)

Could you set:
`sysctl hw.usb.uaudio.debug=16`
and collect the dmesg while doing this test? Could you also provide output from:
`usbconfig -d X.Y dump_device_desc dump_curr_config_desc`
Thank you!


----------



## protocelt (Mar 22, 2015)

hselasky@ said:


> Could you set:
> `sysctl hw.usb.uaudio.debug=16`
> and collect the dmesg while doing this test? Could you also provide output from:
> `usbconfig -d X.Y dump_device_desc dump_curr_config_desc`
> Thank you!


Logs attached. Thanks!


----------



## hselasky@ (Mar 23, 2015)

Hi,

Can you re-test 11-current with the last USB audio patch I've added to PR 198444

--HPS


----------



## protocelt (Mar 23, 2015)

hselasky@ said:


> Hi,
> 
> Can you re-test 11-current with the last USB audio patch I've added to PR 198444
> 
> --HPS


Re-tested 11-CURRENT with patch. There is still a random small click/pop at 20 to 40 second intervals during test but is very much improved.


----------



## protocelt (Mar 31, 2015)

One last follow up on my issue even though PR 198444 is now closed. Updated to recent CURRENT and ran tests again. Sound output is perfect with no clicks or pops at all. Thank you!


----------



## hselasky@ (Mar 31, 2015)

Thank you for reporting the issue and testing patches!


----------



## hanhtm (May 31, 2015)

Hi, currently I'm on 10.1 stable and there is the same crackle issue with OSS in a USB DAC.
If I upgrade to 11 CURRENT, this issue will be solved, right?


----------



## junovitch@ (May 31, 2015)

hanhtm said:


> Hi, currently I'm on 10.1 stable and there is the same crackle issue with OSS in a USB DAC.
> If I upgrade to 11 CURRENT, this issue will be solved, right?



According to the log at PR 198444, the fixes discussed above were already MFC'd to 10.1-STABLE at r280591.  If you are on a later revision than that you already have them and may be seeing a new issue.


----------



## protocelt (May 31, 2015)

I haven't updated my STABLE installs for a while but there was some changes made to uaudio(4) in r283185 that was MFC'd from HEAD. I did have to change a couple of sysctl knobs on my machine when those changes were pushed to HEAD due to a similar problem though I can't remember what knobs at the moment. I'll take a look in a bit and update my post if I can remember.

Edit: I changed the following sysctl knobs on my machine which fixed a similar issue for me:

```
dev.pcm.%d.play.vchanformat
dev.pcm.%d.vchanrate
```
The values needed are dependent on the hardware being used.


----------



## hanhtm (Jun 5, 2015)

Hi protocelt,
I inserted

```
dev.pcm.%d.play.vchanformat
dev.pcm.%d.vchanrate
```
into sysctl.conf and rebooted.

However I still no luck. The problem still remains
Anyone help please.
My sysctl.conf:

```
hw.snd.default_unit=4
```

Indeed it outputted sound of song. But with very much crackles.

Thank you.


----------



## IncompetentSpoon (Jun 5, 2015)

I've had occasional crackles with my DAC as well, which got fixed with the following in /etc/sysctl.conf:


```
hw.snd.feeder_rate_polyphase_max=0
dev.pcm.8.bitperfect=1
```

Where 8 is my pcm device number.


----------



## protocelt (Jun 5, 2015)

hanhtm, the %d in my previous post represents the device number of your USB device, which from looking at what you posted, would be "4". What is the exact model USB DAC you are using?


----------



## hanhtm (Jun 5, 2015)

IncompetentSpoon said:


> I've had occasional crackles with my DAC as well, which got fixed with the following in /etc/sysctl.conf:
> 
> 
> ```
> ...


Thank you for your advice. But issue still same, not solved.


----------



## hanhtm (Jun 5, 2015)

protocelt said:


> hanhtm, the %d in my previous post represents the device number of your USB device, which from looking at what you posted, would be "4". What is the exact model USB DAC you are using?


I'm using ciunas async DAC, 24/192.
https://sites.google.com/site/jkciunas/ciunas-dac
Does this have any clue for you?
Thank you.


----------



## protocelt (Jun 5, 2015)

hanhtm said:


> I'm using ciunas async DAC, 24/192.
> https://sites.google.com/site/jkciunas/ciunas-dac
> Does this have any clue for you?
> Thank you.


Looking at your device specifications it should theoretically work fine under FreeBSD.

Please post the output of the following commands from your machine:

`uname -a`
`cat /dev/sndstat`

`sysctl dev.pcm.4`
`sysctl hw.usb.uaudio`


----------



## hanhtm (Jun 5, 2015)

Many thanks for following up me.
1. `uname -a`

```
FreeBSD thecuong.tk 10.1-STABLE FreeBSD 10.1-STABLE #0 r282290: Fri May  1 14:16:20 ICT 2015  root@thecuong.tk:/usr/obj/usr/src/sys/VUDIEPANH  amd64
```

2. `cat /dev/sndstat`

```
pcm0: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm4: <USB audio> (play) default
```

3. `sysctl dev.pcm.4`

```
dev.pcm.4.%desc: USB audio
dev.pcm.4.%driver: pcm
dev.pcm.4.%location:
dev.pcm.4.%pnpinfo:
dev.pcm.4.%parent: uaudio0
dev.pcm.4.hwvol_step: 5
dev.pcm.4.hwvol_mixer: vol
dev.pcm.4.play.vchans: 1
dev.pcm.4.play.vchanmode: fixed
dev.pcm.4.play.vchanrate: 48000
dev.pcm.4.play.vchanformat: s16le:2.0
dev.pcm.4.buffersize: 0
dev.pcm.4.bitperfect: 1
dev.pcm.4.mixer.vol_0.val: -14521
dev.pcm.4.mixer.vol_0.min: -32767
dev.pcm.4.mixer.vol_0.max: 0
dev.pcm.4.mixer.vol_0.desc:
dev.pcm.4.mixer.mute_1.val: 0
dev.pcm.4.mixer.mute_1.min: 0
dev.pcm.4.mixer.mute_1.max: 1
dev.pcm.4.mixer.mute_1.desc:
dev.pcm.4.feedback_rate: 47999
```

4. `sysctl hw.usb.uaudio`

```
hw.usb.uaudio.debug: 0
hw.usb.uaudio.default_rate: 0
hw.usb.uaudio.default_bits: 32
hw.usb.uaudio.default_channels: 0
```
best regards,


----------



## protocelt (Jun 5, 2015)

First I see your using or trying to use bitperfect. Is that intentional or an attempt at fixing your problem? Try adding the following sysctl(8) settings to your sysctl.conf file:

```
hw.usb.uaudio.default_rate=44100
hw.usb.uaudio.default_bits=16
hw.usb.uaudio.default_channels=2
dev.pcm.4.bitperfect=0
```
If any of these sysctl(8) settings are already in the file, just replace them. Bitperfect just turns off all kernel mixing and sends a raw unaltered audio stream to your connected device(audio amp, etc) so won't do anything for this problem in case that was your reasoning behind setting it and if not, it shouldn't matter in this case whether it's set or not.

Additionally, there have been some updates to USB audio recently so if experimenting with these settings doesn't fix the issue, you could try updating your source tree and rebuilding 10-STABLE to see if that helps as well.


----------



## rossp (Nov 21, 2015)

I'm not sure what the local etiquette is for bumping an old thread rather creating a new one so apologies in advance if I have committed a faux pas.

I have a USB DAC that is also crackling. The model is the Audioengine D1. I'm attempting to use bitperfect mode. With bitperfect turned off there is less crackling, but I can still hear the occasional pop. Would upgrading to 10.2 stable possibly help?

Some stuff that was asked before plus some info from dmesg that will hopefully be helpful.



```
% uname -a
FreeBSD rosbox 10.2-RELEASE-p7 FreeBSD 10.2-RELEASE-p7 #15 r285073M: Thu Nov 12
14:34:22 PST 2015     ross@rosbox:/usr/obj/usr/src/sys/ALTQENABLED  amd64


% cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC662 (Analog)> (play/rec)
pcm1: <Realtek ALC662 (Onboard Digital)> (play)
pcm2: <Realtek ALC662 (Front Analog Headphones)> (play)
pcm3: <USB audio> (play) default


% sysctl dev.pcm.3
dev.pcm.3.feedback_rate: 48000
dev.pcm.3.mixer.mute_0.desc:
dev.pcm.3.mixer.mute_0.max: 1
dev.pcm.3.mixer.mute_0.min: 0
dev.pcm.3.mixer.mute_0.val: 0
dev.pcm.3.bitperfect: 1
dev.pcm.3.buffersize: 0
dev.pcm.3.play.vchans: 0
dev.pcm.3.hwvol_mixer: vol
dev.pcm.3.hwvol_step: 5
dev.pcm.3.%parent: uaudio0
dev.pcm.3.%pnpinfo:
dev.pcm.3.%location:
dev.pcm.3.%driver: pcm
dev.pcm.3.%desc: USB audio


% sysctl hw.usb.uaudio
hw.usb.uaudio.default_channels: 0
hw.usb.uaudio.default_bits: 32
hw.usb.uaudio.default_rate: 0
hw.usb.uaudio.debug: 0


% dmesg | grep uaudio
uaudio0: <Audioengine Audioengine D1, class 0/0, rev 1.10/0.03, addr 2> on usbus1
uaudio0: Play: 96000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 88200 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 48000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 44100 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 32000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: No recording.
uaudio0: No MIDI sequencer.
pcm3: <USB audio> on uaudio0
uaudio0: HID volume keys found.
```

Possibly related is that in bitperfect mode, the DAC doesn't seem to want to accept a stream that isn't 24bit. I can only play files with mplayer by adding '-format s24le'. Even natively 24bit files seem to be interpreted as 32bit by mplayer and need the flag added. If there is another, better player to try, I will happily test that out.


----------



## hselasky@ (Nov 21, 2015)

Hi,

Please try a 10-STABLE kernel first. Did you try different sample rates?

--HPS


----------



## metsuke (Nov 22, 2015)

hselasky@ said:


> Hi,
> 
> Please try a 10-STABLE kernel first. Did you try different sample rates?
> 
> --HPS



I have the same issue running 10.2-STABLE FreeBSD 10.2-STABLE #0 r291083

Which setting should be changed?


```
dev.pcm.6.feedback_rate: 48000
dev.pcm.6.mixer.mute_0.desc: 
dev.pcm.6.mixer.mute_0.max: 1
dev.pcm.6.mixer.mute_0.min: 0
dev.pcm.6.mixer.mute_0.val: 0
dev.pcm.6.bitperfect: 0
dev.pcm.6.buffersize: 0
dev.pcm.6.rec.vchanformat: s16le:2.0
dev.pcm.6.rec.vchanrate: 48000
dev.pcm.6.rec.vchanmode: fixed
dev.pcm.6.rec.vchans: 1
dev.pcm.6.play.vchanformat: s16le:2.0
dev.pcm.6.play.vchanrate: 48000
dev.pcm.6.play.vchanmode: fixed
dev.pcm.6.play.vchans: 1
dev.pcm.6.hwvol_mixer: vol
dev.pcm.6.hwvol_step: 5
dev.pcm.6.%parent: uaudio0
dev.pcm.6.%pnpinfo: 
dev.pcm.6.%location: 
dev.pcm.6.%driver: pcm
dev.pcm.6.%desc: USB audio
```


----------



## hselasky@ (Nov 22, 2015)

Hi,

Try to set:

`sysctl dev.pcm.6.play.vchanrate=44100
sysctl dev.pcm.6.rec.vchanrate=44100`

Before playback.

--HPS


----------



## metsuke (Nov 22, 2015)

This is the result when I make the attempt:

```
sudo sysctl dev.pcm.6.play.vchanrate=44100
dev.pcm.6.play.vchanrate: 48000 -> 48000
```

I also tried placing the change in /etc/sysctl.conf then rebooting with no effect.


----------



## hselasky@ (Nov 22, 2015)

That possibly means some application is already using /dev/dsp and it cannot change the rate. Please verify that vchanrate is 44100 Hz.
Can you log some debug prints?

1) `sysctl hw.usb.uaudio.debug=16`
2) Plug USB DAC
3) Play some music 5 seconds
4) Send dmesg log to me: hps@selasky.org

--HPS


----------



## rossp (Nov 24, 2015)

I've been keeping my system up to date with the freebsd-update(8) binaries. Should I rebuild the world, and the kernel as stable, or can I just build the kernel? I'd like to avoid getting off the release binaries.


----------



## hselasky@ (Nov 24, 2015)

It is enough to re-build the kernel.


----------



## rossp (Nov 24, 2015)

I tried files with different bit depths and sample rates and they all had crackles, even after upgrading to the 10.2 Stable kernel. I'm playing all these files with mplayer and the '-format s24le' argument.

I e-mailed you the logs you requested.


----------



## ogogon (Sep 8, 2019)

laufdi said:


> I have similar problems with a USB S/PDIF output (hiFaceTWO UAC2 M2Tech)


Please tell me how is your UAC2 audio device working now?
I generally could not find evidence of its support in FreeBSD. I even created a topic on the forum, but there are no answers.

Ogogon.


----------



## laufdi (Sep 8, 2019)

It's working very well now on 12 snd_uaudio.ko up to 24/96

```
ugen2.6: <M2Tech hiFaceTWO UAC2> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)
```
no problems


----------

