kdoren / jambox-pi-gen

Start jamming online easily with a Raspberry Pi, an audio interface, and this free Jambox image file. Just download/burn/boot/jam. Choose from multiple jamming apps: Jamulus, SonoBus, JackTrip, JamTaba, JammerNetz or HpsJam. User interface is any web browser on same local network. Pre-built image file is available under "Releases".
BSD 3-Clause "New" or "Revised" License
75 stars 9 forks source link

"No ALSA Devices Found" with pimixer on 1.3.0b1 #55

Closed skrul closed 2 years ago

skrul commented 3 years ago

When I try launching "Audio Device Settings" (aka pimixer) on 1.3.0b1 I get a pop up dialog stating "No ALSA Devices Found". However, Jamulus works fine with my audio interface, the Audient iD4.

Not sure what to do to help debug this but happy to help provide further diagnostics if needed.

image

kdoren commented 3 years ago

Thanks for reporting. I'm not familiar with Audient iD4. Glad it works with Jamulus, that might be all you need.

Others have reported problems with that interface under linux.

These threads makes reference to firmware versions, and USB hub possibly causing issues: https://linuxmusicians.com/viewtopic.php?t=20310 https://www.spinics.net/linux/fedora/alsa-user/msg14755.html

FYI there is a kernel installed on Jambox 1.3.0b1 which is not used by default, which has a patch set applied that deals with certain USB issues. However I was not able to really test it, and I doubt it will help your issue. If you feel like trying it, in the kernels section at the bottom of /boot/config.txt, change the [none] filter (5.16 kernel name has usb in it) to [pi4] and vice versa, then reboot. If it doesn't help, change it back.

kdoren commented 3 years ago

I'm guessing maybe alsa doesn't have profiles for audient devices... heres a link to someone who's adding an alsamixer profile for an audient EVO..... https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/397/diffs

The changes are in rules and conf files, not compiled code, so if might be possible to add something for id4, if that's what it needs...

skrul commented 3 years ago

Thanks @kdoren for looking into this so closely, I never would have thought that this audio interface had peculiarities with linux. I can try your suggestion but I think I'm going to be using jambox with a different interface now.

skrul commented 3 years ago

So I had the same results with my Yamaha MG10XU, but it still works fine with Jamulus. Some light digging shows that pimixer uses gstreamer to find mixers attached to the system and shows this error message when it does not find any. Perhaps adding an alsa profile here will help as you suggest. However, I don't think either of these devices have any controls for the mixer to show anyhow as I don't have any mixer-type controls when using these devices on macOS.

Going to close this since it is clearly out of the hands of jambox. Perhaps you could wrap pimixer in a script that detects this situation and shows a better error message!

kdoren commented 3 years ago

@skrul If you need to change a specific internal setting, you might be able to view & change it with the "amixer" command. It would take some trial and error, but if you can find the magic amixer command for the setting you want, you can put that command into /etc/jackdrc.conf and it will get executed when jack restarts.

See this discussion: https://github.com/kdoren/jambox-pi-gen/discussions/25

kdoren commented 3 years ago

@skrul the raspberry pi alsa libs and utils are pretty old.

I built newer versions and put them in my repo. I don't know if this will help pimixer. It looks painful to get pimixer to build with an updated grstreamer (1.15 vs 0.10.36),

You can install the updates alsa packages with:

sudo apt update && sudo apt install libasound2

This will update a number of alsa-related things, including alsamixer. Please try it and see if that makes any difference. Reopening for the time being so others can see this and try if they want.

TheRico12 commented 3 years ago

@skrul I have the same issue and I'm using a Focusrite Scarlett 2i2 2nd gen

ekrahmer commented 3 years ago

using a SADES SA-902 USB headset. Works with 13.0b1 and 13.0b2. Updated all apps. still works. So the approach to a one-box plug&sing equipment seems to work. However, the mic slider in pimixer has no effect to the jamulus input level. Is there any explanation of jambox sound signal paths available?

kdoren commented 3 years ago

Many USB devices have internal level controls and switches that are unique to that device. Usually you can get to them with the "amixer" command line utility, but it's very painful to use amixer to figure out what level or switch to set, then figure out what exact command to use to set it, then put the command in the jamulus_start.conf file to run at startup.

Pimixer is the friendliest tool for this, so you should try it first. All devices are different, Your device might have switches (check boxes) for "boost" or "agc" that could give you a lot more input gain.

The internal settings of USB audio devices can be confusing. For example, there might be more than on "mic slider", and one of them might be in the playback section and control the mic monitor level, not affecting the level sent to Jamulus. for that there might be a separate mic level in the capture section. Usually I expect to see a capture mic level, but I suppose it's possible that yours only has AGC.

Pimixer itself doesn't know about your device's controls, it gets that information from gstreamer0.10 which gets it from ALSA. Pimixer is a deprecated tool because it uses the mixer functions of gstreamer0.10 which have been removed from later gstreamer versions. So it's possible that there exists an internal control for what you want, but it's missing somewhere in the chain, and pimixer simply can't you do what you want. In that case, amixer might help if you are willing to go through the pain (see below).

Also be aware the the jambox "CAPTURE_LEVEL" setting (default 80%, used only at jamulus startup time) might override something you set with pimixer or amixer. If you can get your headset working the way you like with pimixer or amixer, you can disable CAPTURE_LEVEL setting by commenting it out in jamulus_start.conf.

Below is some amixer info from another discussion topic. in this example "-c 1" is for "card 1", you'll probably need to use "-c 0".

Even the cheapest USB Audio Interfaces can have internal controls and switches that might be useful (sometimes a bewildering array of them) They're not necessarily exposed through any GUI, but you might be able to get to them via the "amixer" command.

For example, it might be possible to disable AGC. Here's a cheap one (Sabrent I think, card 1 in this case) that has AGC:

# look for a control with "Auto" in the name
pi@jambox:~ $ amixer -c 1 | grep Auto
Simple mixer control 'Auto Gain Control',0

# get the value of mixer control "Auto Gain Control
pi@jambox:~ $ amixer -c 1 cget iface=MIXER,name='Auto Gain Control'
numid=9,iface=MIXER,name='Auto Gain Control'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on

# set "Auto Gain Control" off
pi@jambox:~ $ amixer -c 1 cset iface=MIXER,name='Auto Gain Control' 0
numid=9,iface=MIXER,name='Auto Gain Control'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off

If you find the magic command that disables AGC, you could put it in /etc/jackdrc.conf (that file is sourced so any commands in it are executed). Then it will get executed whenever Jamulus starts or jack is restarted.

ekrahmer commented 3 years ago

Thanks. Together with the amixer manpage your post helped me a lot to understand amixer and pimixer settings. Perfect match to my requirements.

kdoren commented 2 years ago

Jambox 1.4.0-b.1 and later have "QasMixer" installed on the desktop by default. In most cases this will be preferable to pimixer ("Audio Device Settings"), which I have also left on the desktop because some people are already familiar with it.