Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PortAudio usage fails under PipeWire 1.0.3 #72

Open
KynikossDragonn opened this issue Apr 4, 2024 · 5 comments
Open

PortAudio usage fails under PipeWire 1.0.3 #72

KynikossDragonn opened this issue Apr 4, 2024 · 5 comments
Labels
investigate Issues where it's unclear or not neccesarily agbplay's fault.

Comments

@KynikossDragonn
Copy link

I just get the following in the error window:

Pa_OpenStream(): unable to open stream with host API JACK Audio Connection Kit: Invalid number of channels

Nothing will play, it used to work just fine several years back.

I'm not even sure why it's trying to use JACK either. I can't find any options or environment variables to make PortAudio cooperate.

@ipatix
Copy link
Owner

ipatix commented Apr 7, 2024

Interesting. I can run agbplay just fine with Pipewire 1.0.4. Does your sound card happen to have more than 2 output channels?

The reason it's trying to use JACK is because agbplay explicitly asks for JACK. I implemented this a while a go to reduce latency while being under the impression that any system that does have JACK shouldn't have a problem with it.

@KynikossDragonn
Copy link
Author

Interesting. I can run agbplay just fine with Pipewire 1.0.4. Does your sound card happen to have more than 2 output channels?

The reason it's trying to use JACK is because agbplay explicitly asks for JACK. I implemented this a while a go to reduce latency while being under the impression that any system that does have JACK shouldn't have a problem with it.

It... shouldn't. Everything is setup as "Analog Stereo".

Audio
 ├─ Devices:
 │      43. Blue Snowball                       [alsa]
 │      44. Built-in Audio                      [alsa]
 │  
 ├─ Sinks:
 │  *   50. Built-in Audio Analog Stereo        [vol: 1.00]
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  *   49. Blue Snowball Mono                  [vol: 0.69]
 │      56. Voice Modulation Source             [vol: 1.00]
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:
        55. effect_input.filter-chain-voicemod                          
             58. input_MONO      < Blue Snowball:capture_MONO	[paused]
             59. monitor_MONO   
        74. PipeWire ALSA [mpv]                                         
             63. output_FL       > ALC233 Analog:playback_FL	[active]
             75. output_FR       > ALC233 Analog:playback_FR	[active]

Screenshot_2024-04-07_14-52-47
Screenshot_2024-04-07_14-52-58

I can get it to work by exporting a PIPEWIRE_NOJACK=1 but then it requests a ridiculous low latency anyways (below the minimum QUANT of 64) and while the audio works, nothing displays properly.

@ipatix
Copy link
Owner

ipatix commented Apr 8, 2024

I'm not quite sure. Even if the sound card would have had more channels I would've expected portaudio would handle this just by using only the first two channels. If your sound card is mono only, I would not be surprised that this happens when using JACK. Can you check in the qjackctl Graph View that your sound card do indeed have two channels? Is it possible that agbplay tries to output to a different sound card than intended?

In regards to the usage of ALSA: I can imagine what's causing it as agbplay uses a suggested minimum latency setting from portaudio, which I've seen is sometimes reported as 0.0 ms.

Unfortunately I currently do not have much time to get into this, but in about a month that will change.

@ipatix ipatix added the investigate Issues where it's unclear or not neccesarily agbplay's fault. label Apr 8, 2024
@KynikossDragonn
Copy link
Author

It's weird that Audacity still manages to somehow work via JACK, and that's also using PortAudio. I wouldn't be entirely fully sure why either.

This is what things look like in qjackctl:
Screenshot_2024-04-08_11-16-25

@ipatix
Copy link
Owner

ipatix commented Aug 26, 2024

The problem likely is that agbplay tries to connect to 'Voice Modulation Source'. If you use branch 'agbplay_v2' it will now output which device failed to open.

a1d61f0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Issues where it's unclear or not neccesarily agbplay's fault.
Projects
None yet
Development

No branches or pull requests

2 participants