Open-source USB interface: Audio Widget

Hi Borge,

It is correct :) audio-widget-PCM5102 is a branch of audio-widget-nik. However, there are changes in the features such that you need to use the PCM5102 version of the WidgetControl GUI tool for widgets with the PCM5102 firmware. And it is recommended that you do a "factory reset" after flashing the new firmware. Using the PCM5102 GUI tool with the "old" firmware or "old" GUI with the new firmware will leand to unpredictable results (ie disaster) :)

In other words, upgrade BOTH firmware and GUI tool at the same time.

Alex
 
OK. Do you think it is possible to change WidgetControl so that it simply dumps a range of defaults? That should be fairly easy, I guess, if read-status-from-Widget were a separate button and didn't happen automatically.

I'd prefer that over maintaining a separate set-the-defaults firmware. Clicking through WidgetControl takes quite a while when you're making a large pile of boards.

Børge
 
Hi Borge,

That's why it is easier to use Linux :)


alex@downstairs:~/sdr-widget$ ./widget-control
usage: sudo ./widget-control [options] [values]
options: -a = list the devices connected and their serialIds.
-d = print the default feature values.
-g = get the feature values from the widget nvram.
-l = list the possible feature values.
-m = get the feature values from the widget ram.
-r = reboot the widget.
-s = set the feature values in the widget nvram.
-u serialId = open the device with the specified serialId.
Only -s and -u take values.
The -s option takes values in the form printed by -d or -g or -m.
The acceptable values for each feature are listed by -l.
The major and minor version numbers are optional to -s, but
if provided they must match the ones printed by -d, -g, -l, and -m,
which should all match each other
The -u option takes one value which is the serialId of the device you
want to program.
alex@downstairs:~/sdr-widget$ ./widget-control -d
11 38 widget uac1_dg8saq normal normal ak5394a pcm5102 hd44780 500ms fir
alex@downstairs:~/sdr-widget$
 
You should be able to give systemcalls in the c files. You could probably also keep it outside the code in the makefile as there should be some post processing abilities. So instead of a fairytale tonight - read them the make man page...

Brgds

BTW: The widget-control only works when I'm logged in as root in linux... How do I run it as admin in windows? I have tried to start a shell as admin and so forth and then shoot of the command without luck... It is just doing nothing. But alas, I have the crappiest XP installation at hand... Totally screwed. How do the rest of the XP users handle this?

About the experimental drivers - do you people get BSOD's when connecting the widget in XP? Vista works OK but I'm not alowed to experiment on that machine :-(
 
Last edited:
I tested a modified source for the 3.3 vol. analog AB1.1.

An externally hosted image should be here but it was not working when we last tested it.


R13 goes from 2490 to 100 Oh.
0.1uF to 100uF C6.
and C9, C10 470uF to 10uF.

This gives a flat frequency impedance in the audio band and a theoretical impedance from 180mOh. to 25mOh.

An externally hosted image should be here but it was not working when we last tested it.


The results appear satisfactory. Mainly noticeable improvement in low frequency and more accuracy of the scene.
 
Member
Joined 2004
Paid Member
oneoclock:
I think it looks good. Check the power dissipation to make sure nothing is stressed. Also check the collector current and the base current in Q1 against the datasheet to be sure you are in the max beta range and look at the noise curve for the device. I'll play with it myself tonight.

Of course nothing beats building and testing.
 
For audio-widget Linux users:

1. To enable non-root access to the audio-widget, create this file:


alex@alex-Aspire-4750:/etc/udev/rules.d$ cat 99-softrock.rules

SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="16c0",ATTR{idProduct}=="05dc", MODE="0666", GROUP="softrock", SYMLINK="softrock"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="16c0",ATTR{idProduct}=="03e8", MODE="0666", GROUP="softrock", SYMLINK="softrock"

After reboot you will have user space privilage. You can either make your user id part of the softrock group, or you change "softrock" to "audio" and make sure your user id is part of the audio group.

2. For user land access to flash the widgets, add this:
alex@alex-Aspire-4750:/etc/udev/rules.d$ cat 99-avrtools.rules
# ICE50:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2101", MODE:="0666"

# JTAGICE mkII:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2103", MODE:="0666"

# AVRISP mkII:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2104", MODE:="0666"

# AVRONE:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2105", MODE:="0666"

# STK600:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2106", MODE:="0666"

# AVR Dragon:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2107", MODE:="0666"

# RzUsbStick:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="210a", MODE:="0666"

# QT600:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2114", MODE:="0666"

# QT600P:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2116", MODE:="0666"

# Add support AT32UC3A0128 AT32UC3A0256 AT32UC3A0512
# AT32UC3A1128 AT32UC3A1256 AT32UC3A1512
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2ff8", MODE:="0666"

# Add support AT32UC3A3256
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2ff1", MODE:="0666"

# Add support AT32UC3B0128 AT32UC3B0256 AT32UC3B064
# AT32UC3B1128 AT32UC3B1256 AT32UC3B164
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb",
ATTRS{idProduct}=="2ff6", MODE:="0666"


3. Add the last two lines to:

alex@alex-Aspire-4750:/etc/security$ cat limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
# - NOTE: group and wildcard limits are not applied to root.
# To apply a limit to the root user, <domain> must be
# the literal username root.
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit (KB)
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19]
# - rtprio - max realtime priority
# - chroot - change root to directory (Debian-specific)
#
#<domain> <type> <item> <value>
#

#* soft core 0
#root hard core 100000
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#ftp - chroot /ftp
#@student - maxlogins 4
@audio - rtprio 99
@audio - memlock unlimited

This will give your audio software/driver real time priority.

4. This is my pulse/daemon. Change the line of "default-sampe-rate" to your favorite sample rate, eg 44100 or 48000 or 96000 or 192000 etc. Pulse will resample other sample rates to this default rate.

alex@alex-Aspire-4750:~$ cat .pulse/daemon.conf
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out. Use either ; or # for
## commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

resample-method = speex-float-8
; enable-remixing = yes
; enable-lfe-remixing = no

flat-volumes = no

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 1000000

default-sample-format = s32le
default-sample-rate = 48000
default-sample-channels = 2
default-channel-map = front-left,front-right

default-fragments = 8
default-fragment-size-msec = 8

; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0


Alex
 
Alexlee188: The circuits are powered directly from USB without problems.

1Audio: From what I've tried the saturation would occur with 20 to 10 Oh. approx. If you could simulate it and check with datasheed would appreciate it if I had been wrong.

2N3604 simulation for peak current of 100 mA: Vbe from 0.66V now go to 0.71V
Ie 0.88mA to 8.8mA
Ib 3uA to 30uA
Vce 0.73 V to 0.74 V
0.65 mW to 6.5 mW.

I have made ​​the circuit with BC560C and BC550C because I have at home.
Gives the same simulations and gives lower noise datasheed specifications.
 
Member
Joined 2004
Paid Member
Look at the detailed data sheet for the the 2n3904 http://www.fairchildsemi.com/ds/2N/2N3904.pdf and you can learn a lot about optimizing for the device. In this case the source resistance is 1K but the Z is essentially zero. If you look at the noise curves they suggest optimums for different source resistances. The beta curve is pretty flat up to 20 mA.

Jjust to see I tried replacing Q2 with a much bigger device D45H11 (the one in the database) and loading up to 1A. The dissipation goes up but it would all still work and the noise goes down, 20 mW for Q1 and 1.9W for Q2 w/ r3 at 2200 Ohms. Q1 goes up to 25 mW w/ 100 Ohms for R3. They all work so I don't think there is a right answer, there are plenty of options.

Making a shunt from this will be an interesting exercise. Sketch later today.
 
Member
Joined 2004
Paid Member
Shunt regulator

Here is a shunt variation on the basic concepts. Seems to work in the simulations.
 

Attachments

  • Shunt.JPG
    Shunt.JPG
    54 KB · Views: 439
  • shunt noise filter.asc
    2.6 KB · Views: 52
For 5mA optimum is R=150 to 200Oh.
For 8mA R=100 can not be far from optimal.

It is very difficult for me measure the noise directly. But I put an indirect measure that can guide relatively in comparison to others about the noise.

Is a Test-J signal wich 229 Hz tone.

An externally hosted image should be here but it was not working when we last tested it.

Blue: DA10 Lavri.
Yellow: New Apogee Duet.
Green: AB1.1 Analog R=100Oh
Red: AB1.1 Analog R=2200Oh
The two AB1.1 low-noise source 1Audio to clock.

With the supply analog of 100Oh is more noise than the original 2200Oh. but is very low noise also and lower impedance than original. The two DAC that I put have the lowest noise measures that I have. I have other measures of diferent DAC models but are worse.

Just as the difference sound between the power source LED and TL431 were important, the difference between 2200Oh. and 100Oh is fundamentally more bass, but is small.

It may be important to people prove the other two versions listen and comment it.

The clock power supply is indisputable 2200Oh versión.

I have done simulations of the Shunt supply. That's interesting.

The ideal is with a constant current source. But starting from 5 V. going to be impossible.
 
Last edited:
Oneoclock,

this is cool stuff! I'll try to put down a layout on the next prototype board. Two questions:

- Do you mind me putting down SMD transistors? (In my experience, draining tin from through-plated holes may be trickier than dropping a blob of tin on an SMD transistor.)

- Which footprint do you suggest for the capacitors? I'd like it if you could send some digikey links etc.

Cheers,
Børge
 
Member
Joined 2004
Paid Member
Oneoclock:
Good start. It looks good. Possibly too good. As you can see measurements at this level are quite challenging. The LF noise may not be a function of the regulator. It could be coming from several places making analysis even more difficult. Even with balanced inputs and careful grounding connections the analyzer can create noise from the extra ground return paths.

The tel-tale on the noise would be the width of the base of the 11.025 KHz tone. To get a meaningful measurement I would set as follows:
1) High sample rate for the analyzer, preferably at a different clock range that the source so they do relate.
2) at least 252K bins. I use 16M bins but it can take an hour for an averaged measurement. Avreage 10 times at least.
3) display with a linear frequency scale. The jitter/phase noise will be symmetrical about 11KHz making real jitter and phase noise easy to see. Zoom way in.
4) make a tst with everything connected but not operating to look for stray noises, grounding problems, system residuals etc.

Borge:
If the power dissipation for the device is OK SMD should be fine. The parts are getting too small for me to deal with but that should not be an issue if you have the assembly side handled. There are SMD versions of the transistors. The resistors are actually a limitation and most smd resistors are not very good. I don't have a recommendation but I'm sure there are many on this forum elsewhere. For the caps I would look for ones with around 50 mOhm esr. Higher will cause problems. A Digikey search yields a number of options. The through hole parts are cheaper and can be had in small quantities. Search on 470 uF at 10V. Pretty much any part would work. They also have Nichicon audio caps, which may make a difference, but not at that value. They could work at 22 uF or 47 uF on the output.