[Solved] No USB Sound 2.1 kit

Support with sound and multimedia cards on GhostBSD
Post Reply
vandykmarsu
Posts: 6
Joined: Sat Nov 23, 2019 1:53 pm

[Solved] No USB Sound 2.1 kit

Post by vandykmarsu »

Hello GhostBSD User's

I am currently having a problem running my 2.1 kit on GhostBSD 19.10.

I went through FreeBSD forums and tutorials with no results.

I'll come back to you if you can enlighten me please.
Last edited by vandykmarsu on Mon Mar 02, 2020 12:39 pm, edited 1 time in total.
vandykmarsu
Posts: 6
Joined: Sat Nov 23, 2019 1:53 pm

Re: No USB Sound 2.1 kit

Post by vandykmarsu »

I share here a find to use a 2.1 speaker kit USB plugged.

Adding USB Driver.


Add driver snd_uaudio to rc.conf:

Code: Select all

sudo nano /etc/rc.conf
Paste:

Code: Select all

snd_uaudio="YES"

Automating boot:

Code: Select all

sudo nano /boot/loader.conf
Paste:

Code: Select all

snd_uaudio_load="YES"
Loading the driver:

Code: Select all

kldload snd_driver

Output configuration.


How to know his output device:

Code: Select all

cat /dev/sndstat
We configure a file in devd:

Code: Select all

sudo nano /etc/devd/usb_hp.conf
Paste the lines and configure pcm unit/number with the output:

Code: Select all

# /etc/devd/usb_hp.conf
attach 100 {
  device-name "pcm?";
  action "sysctl hw.snd.default_unit=?";
};

detach 100 {
  device-name "pcm?";
  action "sysctl hw.snd.default_unit=0";
};
Paste this line in sysctl with the right pcm:

Code: Select all

sudo nano /etc/sysctl.conf
Then paste:

Code: Select all

hw.snd.default_unit=?

Reboot, after boot 2.1 Kit are singing well
wb7odyfred
Posts: 188
Joined: Sat Nov 12, 2016 5:44 pm

Re: [Solved] No USB Sound 2.1 kit

Post by wb7odyfred »

Thank you for this detailed setup. I am testing on GhostBSD-Arm64 on Raspberry Pi 4B with 8gb dram.
wb7odyfred
Posts: 188
Joined: Sat Nov 12, 2016 5:44 pm

Re: [Solved] No USB Sound 2.1 kit

Post by wb7odyfred »

Thank you for this detailed setup. I am testing on GhostBSD-Arm64 on Raspberry Pi 4B with 8gb dram.https://Ghostbsd-Arm64.blogspot.com
https://T.me/Arm_Open-Source Telegram Arm_Open-Source channel Fred Finster created
https://t.me/ghostbsd_dev/24054 GhostBSD Development Arm64 Development Eric Turgeon created
https://ghostbsd-arm64.blogspot.com/202 ... o-usb.html How to install GhostBSD-Arm64 into a USB Flash drive

example of the Build information Operating System that my Raspberry Pi 4B FreeBSD 15.0 Development Workstation runs to create GhostBSD-Arm64 from source code github.com/ghostbsd/ghostbsd-src
uname -aKmnopr
FreeBSD Ghost14-selfbuilt-rpi4B-nginx-tst1 15.0-CURRENT FreeBSD 15.0-CURRENT #2 main-d06328c37b-dirty: Wed Sep 20 17:40:00 PDT 2023 root@gen
eric:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC-VCHIQ arm64 aarch64 1500001
Last edited by wb7odyfred on Sat Jan 13, 2024 10:36 pm, edited 2 times in total.
wb7odyfred
Posts: 188
Joined: Sat Nov 12, 2016 5:44 pm

Re: [Solved] No USB Sound 2.1 kit

Post by wb7odyfred »

Thank you for this detailed setup. I am testing USB Headphone headset Logitech H390 on GhostBSD-Arm64 on Raspberry Pi 4B with 8gb dram.https://Ghostbsd-Arm64.blogspot.com
https://T.me/Arm_Open-Source
cat /dev/sndstat ; sysctl hw.snd.default_unit
Installed devices:
pcm0: <VCHIQ audio> (play)
pcm1: <USB audio> (play/rec) default
No devices installed from userspace.
hw.snd.default_unit: 1
tail -3 /boot/loader.conf
vfs.root.mountfrom="zfs:arm64pool/ROOT/default"
kldload_list+="cuse snd_uaudio"
snd_uaudio_load="YES"

tail -3 /etc/rc.conf
#AUDIO
sound_load="YES"
snd_uaudio_load="YES"

cat /etc/sysctl.conf
#
# This file is read when going to multi-user and its contents piped thru
# ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details.
#
# add user mount
vfs.usermount=1
vfs.zfs.min_auto_ashift=12

# the following is required to run chromium browser
kern.ipc.shm_allow_removed=1

# For Desktop use default for server is 80
kern.sched.preempt_thresh=224

# this is required for MBR 4 alignement
kern.geom.part.mbr.enforce_chs=0


hw.snd.default_unit=1
cat /boot/loader.conf
kern.vty=vt
# Configure USB OTG; see usb_template(4).
# hw.usb.template=3
umodem_load="YES"
# Multiple console (serial+efi gop) enabled.
boot_multicons="YES"
boot_serial="YES"
# Disable the beastie menu and color
#beastie_disable="YES"
loader_color="NO"
security.bsd.allow_destructive_dtrace=0
kern.geom.label.disk_ident.enable=0
kern.geom.label.gptid.enable=0
# cryptodev_load="YES"
cryptodev_load="NO"
zfs_load="YES"
vfs.zfs.debug=0
# vfs.root.mountfrom="zfs:zroot/ROOT/default"
# vfs.root.mountfrom="zfs:arm64pool/ROOT/default"
vfs.root.mountfrom="zfs:arm64pool/ROOT/default"
kldload_list+="cuse snd_uaudio"
snd_uaudio_load="YES"
Last edited by wb7odyfred on Sat Jan 13, 2024 10:05 pm, edited 4 times in total.
wb7odyfred
Posts: 188
Joined: Sat Nov 12, 2016 5:44 pm

Re: [Solved] No USB Sound 2.1 kit, reset Audio device with sysctl. Restart applications to pickup new change.

Post by wb7odyfred »

Re: [Solved] No USB Sound 2.1 kit, reset Audio device with sysctl. Restart applications to pickup new change.
execute command: sudo kldload snd_driver

ls -lh /boot/kernel/snd*.ko
-r-xr-xr-x 1 root wheel 13592 Sep 22 06:25 /boot/kernel/snd_driver.ko

cat /dev/sndstat ; sysctl hw.snd.default_unit ; sysctl hw.snd.default_unit=3 or unit=2 or unit=1 or unit=0 , whatever output of cat /dev/sndstat says
dmesg | tail -23 will show you when you plugged in a USB Audio device like USB Audio adapter and USB Audio Headset Logitech H390

Read Vermaden's blog post write up
https://vermaden.wordpress.com/2024/01/ ... rovements/ Vermaden's 10/January/2024 write up on configuring USB Audio setup for FreeBSD
https://t.me/ghostbsd/143999/153506

cat /dev/sndstat ; sysctl hw.snd.default_unit
Installed devices:
pcm0: <VCHIQ audio> (play)
pcm1: <USB audio> (play/rec) default
No devices installed from userspace.

hw.snd.default_unit: 1
Testing USB Headset Logitech H390 on a Raspberry Pi. See insertion of USB Device uhid1 on uhub1 ?
dmesg | tail -33
genet0: link state changed to UP
usb_alloc_device: set address 6 failed (USB_ERR_TIMEOUT, ignored)
ugen0.6: <Logitech USB Headset Logitech USB Headset> at usbus0
uhid1 on uhub1
uhid1: <Logitech USB Headset Logitech USB Headset, class 0/0, rev 1.10/0.12, addr 6> on usbus0
uaudio0 on uhub1
uaudio0: <Logitech USB Headset> on usbus0
uaudio0: Play[0]: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Play[0]: 44100 Hz, 2 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Play[0]: 32000 Hz, 2 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Play[0]: 22050 Hz, 2 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Play[0]: 16000 Hz, 2 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Play[0]: 11025 Hz, 2 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Play[0]: 8000 Hz, 2 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Record[0]: 48000 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Record[0]: 44100 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Record[0]: 32000 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Record[0]: 22050 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Record[0]: 16000 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Record[0]: 11025 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: Record[0]: 8000 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer.
uaudio0: No MIDI sequencer.
pcm1: <USB audio> on uaudio0
uaudio0: HID volume keys found.
genet0: link state changed to DOWN
genet0: link state changed to UP
genet0: link state changed to DOWN
genet0: link state changed to UP
KLD snd_driver.ko: depends on snd_cmi - not available or version mismatch
mixer
pcm1:mixer: <USB audio> at ? kld snd_uaudio (play/rec) (default)
vol = 0.75:0.75 pbk
pcm = 0.75:0.75 pbk
mic = 0.25:0.25 pbk
v9n7p
Posts: 3
Joined: Thu Nov 09, 2023 9:21 pm

Re: [Solved] No USB Sound 2.1 kit

Post by v9n7p »

I followed these instructions to geta USB audio adapter working so I could use headphones on my Thinkpad T480s laptop. As a novice, I wasn't sure where this was supposed to be pasted:
Loading the driver:
CODE: SELECT ALL

kldload snd_driver
I guessed it was part of what was to be added here:
sudo nano /boot/loader.conf
and that turned out to be correct.

Also, I think this may have a typo?
# /etc/devd/usb_hp.conf
attach 100 {
device-name "pcm?";
action "sysctl hw.snd.default_unit=?";
};

detach 100 {
device-name "pcm?";
action "sysctl hw.snd.default_unit=0";
};
Should that last line "sysctl hw.snd.default_unit=0" be "sysctl hw.snd.default_unit=?" with a question mark instead of a zero? My USB audio adapter is pcm3, so I changed all the question marks to 3's, and I used "sysctl hw.snd.default_unit=3" and that seems to have worked.
v9n7p
Posts: 3
Joined: Thu Nov 09, 2023 9:21 pm

Re: [Solved] No USB Sound 2.1 kit

Post by v9n7p »

Here is my output for
cat /dev/sndstat
sysctl hw.snd.default_unit
mesg | tail -33
cat /boot/loader or tail -12 /boot/loader.conf
cat /etc/rc.conf or tail -12 /etc/rc.conf



cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC257 (Analog 2.0+HP/2.0)> (play/rec)
pcm1: <Realtek ALC257 (Right Analog Mic)> (rec)
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> (play)
pcm3: <USB audio> (play/rec) default
No devices installed from userspace.

sysctl hw.snd.default_unit
hw.snd.default_unit: 3

mesg | tail -33
acpi_wmi0: <ACPI-WMI mapping> on acpi0
acpi_wmi1: <ACPI-WMI mapping> on acpi0
acpi_wmi1: Embedded MOF found
ACPI: \134_SB.WMI1.WQBA: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
acpi_wmi2: <ACPI-WMI mapping> on acpi0
acpi_wmi2: Embedded MOF found
ACPI: \134_SB.WMI2.WQBB: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
acpi_wmi3: <ACPI-WMI mapping> on acpi0
acpi_wmi3: Embedded MOF found
ACPI: \134_SB.WMI3.WQBC: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
uaudio0: Play[0]: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play[0]: 44100 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record[0]: 48000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
uaudio0: No MIDI sequencer.
pcm3: <USB audio> on uaudio0
uaudio0: HID volume keys found.
wlan0: Ethernet address: d4:6d:6d:2a:ac:ec
lo0: link state changed to UP
ugen0.3: <Logitech USB Receiver> at usbus0
ugen0.4: <vendor 0x8087 product 0x0a2b> at usbus0
ugen0.5: <SunplusIT Inc Integrated Camera> at usbus0
ugen0.6: <vendor 0x06cb product 0x009a> at usbus0
ums0 on uhub0
ums0: <Logitech USB Receiver, class 0/0, rev 2.00/5.00, addr 2> on usbus0
ums0: 16 buttons and [XYZT] coordinates ID=0
uhid0 on uhub0
uhid0: <Logitech USB Receiver, class 0/0, rev 2.00/5.00, addr 2> on usbus0
ipfw2 (+ipv6) initialized, divert loadable, nat loadable, default to accept, logging disabled
Security policy loaded: MAC/ntpd (mac_ntpd)
wlan0: link state changed to UP
arp: 10.0.0.92 moved from 98:ee:cb:3e:1b:a7 to b8:81:98:2d:84:0d on wlan0
arp: 10.0.0.92 moved from b8:81:98:2d:84:0d to 98:ee:cb:3e:1b:a7 on wlan0
arp: 10.0.0.102 moved from 98:ee:cb:3e:1b:a7 to b8:81:98:2d:84:0d on wlan0


cat /boot/loader
Request failed


tail -12 /boot/loader.conf
rc_system="bsdrc"
crypto_load="YES"
aesni_load="YES"
geom_eli_load="YES"
vfs.zfs.arc_max="512M"
zfs_load="YES"
snd_uaudio_load="YES"
kldload snd_driver⏎


cat /etc/rc.conf
zfs_enable="YES"
kld_list="linux linux64 cuse fusefs /boot/modules/i915kms.ko"
linux_enable="NO"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
devfs_enable="YES"
devfs_system_ruleset="devfsrules_common"
dbus_enable="YES"
lightdm_enable="YES"
webcamd_enable="YES"
cupsd_enable="YES"
avahi_daemon_enable="YES"
avahi_dnsconfd_enable="YES"
moused_enable="YES"
ipfw_enable="YES"
firewall_enable="YES"
ifconfig_em0="DHCP"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA DHCP"
keymap="us.kbd"
hostname="mycomputer-gbsd"
ubuntu_enable="YES"
snd_uaudio="YES"


tail -12 /etc/rc.conf
avahi_daemon_enable="YES"
avahi_dnsconfd_enable="YES"
moused_enable="YES"
ipfw_enable="YES"
firewall_enable="YES"
ifconfig_em0="DHCP"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA DHCP"
keymap="us.kbd"
hostname="mycomputer-gbsd"
ubuntu_enable="YES"
snd_uaudio="YES"
Post Reply