Monday, June 5, 2017

Configuring my SA9227 with PCM5102A 32BIT / 384KHZ USB3 Hifi Audio DAC on Linux

Configuring my SA9227 with PCM5102A 32BIT / 384KHZ USB3 Hifi Audio DAC on Linux


SA9227 with PCM5102A 32BIT / 384KHZ USB3 Hifi Audio DAC 
I was looking for a high end Audio DAC for Linux and found this unit. I wanted to generate IQ moderation for a transmitter and this module would work nicely. It Unfortunately it only works on USB3 so this one cant be used on raspberry Pi 3 :-( but works fine on my Ubuntu laptop.


Description

  • Input :5 V (USB supply),
  • THD+N: <0.005% (RL = 10 kω)
  • independence: >95 dB
  • DRC: >95 dB
  • USB sample rate:16-32BIT/32-284KHZ
I first tried it on a USB 2 port but got this error when connecting the Device to the usb2 port

/var/log$ tail -f syslog
Jun  5 21:32:03 anton-SATELLITE-P755 kernel: [101544.064132] usb 2-1.2: device descriptor read/64, error -32
Jun  5 21:32:03 anton-SATELLITE-P755 kernel: [101544.240155] usb 2-1.2: new full-speed USB device number 21 using ehci-pci
Jun  5 21:32:03 anton-SATELLITE-P755 kernel: [101544.312119] usb 2-1.2: device descriptor read/64, error -32
Jun  5 21:32:03 anton-SATELLITE-P755 kernel: [101544.488089] usb 2-1.2: device descriptor read/64, error -32
Jun  5 21:32:04 anton-SATELLITE-P755 kernel: [101544.664066] usb 2-1.2: new full-speed USB device number 22 using ehci-pci
Jun  5 21:32:04 anton-SATELLITE-P755 kernel: [101545.072135] usb 2-1.2: device not accepting address 22, error -32
Jun  5 21:32:04 anton-SATELLITE-P755 kernel: [101545.144111] usb 2-1.2: new full-speed USB device number 23 using ehci-pci
Jun  5 21:32:05 anton-SATELLITE-P755 kernel: [101545.552096] usb 2-1.2: device not accepting address 23, error -32
Jun  5 21:32:05 anton-SATELLITE-P755 kernel: [101545.552269] usb 2-1-port2: unable to enumerate USB device
Jun  5 21:32:05 anton-SATELLITE-P755 gnome-session[2394]: (gnome-software:2545): Gs-WARNING **: failed to call gs_plugin_refine on appstream: Error opening file: Permission denied


I then tried it on a usb 3 port  and got the following log.

Jun  5 21:49:55 anton-SATELLITE-P755 kernel: [102616.072168] usb 3-1: new full-speed USB device number 2 using xhci_hcd
Jun  5 21:49:55 anton-SATELLITE-P755 kernel: [102616.192175] usb 3-1: device descriptor read/64, error -71
Jun  5 21:49:55 anton-SATELLITE-P755 kernel: [102616.416205] usb 3-1: device descriptor read/64, error -71
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102616.632092] usb 3-1: new full-speed USB device number 3 using xhci_hcd
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102616.752241] usb 3-1: device descriptor read/64, error -71
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102616.976267] usb 3-1: device descriptor read/64, error -71
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102617.192119] usb 3-1: new full-speed USB device number 4 using xhci_hcd
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102617.192513] usb 3-1: Device not responding to setup address.
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102617.396397] usb 3-1: Device not responding to setup address.
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.600038] usb 3-1: device not accepting address 4, error -71
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.712114] usb 3-1: new high-speed USB device number 5 using xhci_hcd
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.733859] usb 3-1: New USB device found, idVendor=262a, idProduct=9227
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.733864] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.733867] usb 3-1: Product: HD USB Audio
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.733869] usb 3-1: Manufacturer: XENRAN Audio
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.737019] input: XENRAN Audio HD USB Audio as /devices/pci0000:00/0000:00:1c.5/0000:05:00.0/usb3/3-1/3-1:1.0/0003:262A:9227.0002/input/input16
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.737332] hid-generic 0003:262A:9227.0002: input,hidraw0: USB HID v1.00 Device [XENRAN Audio HD USB Audio] on usb-0000:05:00.0-1/input0
Jun  5 21:49:57 anton-SATELLITE-P755 mtp-probe: checking bus 3, device 5: "/sys/devices/pci0000:00/0000:00:1c.5/0000:05:00.0/usb3/3-1"
Jun  5 21:49:57 anton-SATELLITE-P755 mtp-probe: bus: 3, device: 5 was not an MTP device
Jun  5 21:49:57 anton-SATELLITE-P755 systemd-udevd[19211]: Process '/usr/sbin/alsactl -E HOME=/run/alsa restore 1' failed with exit code 99.
Jun  5 21:50:01 anton-SATELLITE-P755 gnome-session[2394]: (gnome-software:2545): Gs-WARNING **: failed to call gs_plugin_refine on appstream: Error opening file: Permission denied


This looked promising

I then checked if Alsa would see the device

sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [HD USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: Audio [HD USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and the yellow was added as a new device to be used.

I could now use the normal Alsa audio controls with this device.

Sunday, June 4, 2017

Configuring my wifi dongle on the Raspberry Pi to connect to my network router.

Configuring my wifi dongle on the Raspberry Pi to connect to my network router.

Generic Wifi dongle used on my Raspberry Pi


I had to get my router details and had to configure the following configuration files.
I wanted to give my Raspberry Pi a spear static IP so I always know what it is on my network.

I edited the following files.

/etc/wpa_supplicant/wpa_supplicant.conf

I added the following at the end. I was using WEB encryption and shared key on my router.
Change the details in yellow for your router if you use web encryption with shared key.
use your favorite editor
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf

#Configeration of the file /etc/wpa_supplicant/wpa_supplicant.conf
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
        ssid="MyRouter"  # your router ID
        key_mgmt=NONE
        wep_key0="0123456789123"  # or 13 characters, or a hexkey starting with 0x your key
        wep_tx_keyidx=0
        auth_alg=OPEN
}

Save and exit
And the change the following file

Edit the file as follows in the section configuring wlan0
I gave my Raspberry pi a spear static Ip on my network so always now what the ip is and don't use DHCP so I will not know what the Ip will be 
use your favorite editor

sudo vi /etc/network/interfaces
auto wlan0
allow-hotplug wlan0
#iface wlan0 inet dhcp
iface wlan0 inet static
address 192.168.1.205  #Static Ip
netmask 255.255.255.0 # Ip mask of network
gateway 192.168.1.254 # IP gateway of router
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Save

And reboot Raspberry Pi  sudo shutdown -r 0

ping your new Ip on Wifi network

ping 192.168.1.205

And it should now work.