# Teac UD-503 / UD-501 – snd-usb-audio patch

> Linux snd-usb-audio kernel patch (merged upstream in 4.5) fixing Teac UD-503 / UD-501 freezes on format and rate changes, enabling bit-perfect playback.

- URL: https://guillaumeplayground.net/teac-ud-503-ud-501-snd-usb-audio-patch/
- Author: Guillaume (https://guillaumeplayground.net/about/)
- Published: 2016-01-03
- Updated: 2017-01-10
- Section: Computing & hacking
- Topics: dac, debian, ubuntu, bit perfect, kernel
- Source: Guillaume playground

\=== update Jan 26 ===  
Patch accepted in upstream sound, should be in next 4.5-rc2 and next stable vanilla kernel starting from 4.5.  
\===/===

I bought a fresh Teac UD-503 yesterday and it was driving me crazy last evening, always disconnecting/freezing when switching from S16 to S32 format, or simply changing file rate.  
I was also getting the same “clock source 41 is not valid, cannot use” as the UD-501. Error i never took time to check because it was working.

So, here is a patch i have make this morning to correct these bugs with these high-end/high-rec dacs and allow bit-perfect mode.  
It is a simple delay to append. After my tests, it seems quite similar to the patch for the “Playback Design” products.

Now everything works perfectly:  
– no clock error anymore  
– no freeze with the dac usb interface  
– seamless switch between format/rate or PCM/DSD mode.

The patch is small and generic, tested on kernel 4.3.0 and current mainline 4.4, should work on every >=3.x with some ajustement in lines.

[snd-usb-quirks-patch-teac.patch](https://guillaumeplayground.net/wp-content/uploads/2016/01/snd-usb-quirks-patch-teac.patch_.gz)

Under debian, you will only need to recompile the kernel module:

```
---- NEEDED PACKAGES (replace x.y.z-n in context and switch between amd64 or i386 if needed)
# apt-get install build-essential linux-source-x.y linux-headers-amd64

---- PREPARE THE SOURCE
# cd /usr/src/
# tar xf linux-source-x.y.tar.xz
# cd linux-source-x.y
# wget -qO- /wp-content/uploads/2016/01/snd-usb-quirks-patch-teac.patch_.gz | gunzip | patch -p0

---- PREPARE TO COMPILE
# cp /boot/config-x.y.z-n .config
# make oldconfig
# cp /usr/src/linux-headers-x.y.z-n/Module.symvers .
# make prepare

---- DEP problems - just run this shortly to get scripts/recordmcount compiled and once passed, CTRL-C
# make

---- Compile the module
# make M=sound/usb

---- Load the patched module
# rmmod snd-usb-audio
# insmod sound/usb/snd-usb-audio.ko

---- Test, enjoy
---- Make it permanent
# cp -a sound/usb/snd-usb-audio.ko /lib/modules/x.y.z-n/kernel/sound/usb/
# depmod -a
# rmmod snd-usb-audio
# modprobe snd-usb-audio
```

Bye!
