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

Byteswap default in pcmcat changed #66

Closed
argilo opened this issue Nov 27, 2024 · 8 comments
Closed

Byteswap default in pcmcat changed #66

argilo opened this issue Nov 27, 2024 · 8 comments

Comments

@argilo
Copy link
Contributor

argilo commented Nov 27, 2024

After a recent change to pcmcat (made in 5e606d5), Auto-RX stopped working. It looks like the reason is that pcmcat previously defaulted to byteswapping, but now only does so when the stream type is 10 or 11 (44100 sps, S16BE). Auto-RX uses type 113 (48000 sps, S16BE) and a number of other non-standard sample rates for which stream types are dynamically allocated.

Adding the -b 1 argument works around the problem, but I'm not sure whether it was intentional to change the default behaviour for stream type 113 (and other S16BE stream types, including dynamically allocated ones).

@argilo
Copy link
Contributor Author

argilo commented Nov 27, 2024

I have proposed to explicitly request byteswapping in Auto-RX with the -b 1 argument: projecthorus/radiosonde_auto_rx#947

@ka9q
Copy link
Owner

ka9q commented Dec 17, 2024

This should be rendered moot by the new pcmrecord.c, which looks at the status stream to determine sample encoding, channel count and sample rate.

@ka9q
Copy link
Owner

ka9q commented Dec 19, 2024

The new pcmrecord automatically swaps S16BE to be S16LE, so it always writes the latter. It also recognizes float32, float16 and Opus, as well as the sample rate and channel count and writes the correct formats. Hopefully this solves your problem so I'm closing this.

@argilo
Copy link
Contributor Author

argilo commented Dec 19, 2024

Yeah, I see there's now an option to output to stdout in pcmrecord, so I expect that Auto-RX can switch to that. For the time being, we're using pcmcat with -b 1.

@ka9q
Copy link
Owner

ka9q commented Dec 19, 2024

Yeah, I'm thinking of doing away entirely with pcmcat and pcmspawn, unless that would break too much. Their functions ought to be completely superseded with --stdout and --exec. Note: a wav header is always added to pcm output as there is no other easy way to get metadata to the client. You can probably just ignore it if you want to treat it as raw and can tolerate the initial noise burst.

@argilo
Copy link
Contributor Author

argilo commented Dec 19, 2024

You can probably just ignore it if you want to treat it as raw and can tolerate the initial noise burst.

Yeah, I expect Auto-RX will tolerate it.

Perhaps it could be made optional (via a command line argument) to save downstream applications from having to strip it off if they don't want it.

@ka9q
Copy link
Owner

ka9q commented Dec 19, 2024

I've been thinking about doing just that, adding a --raw option.

@ka9q
Copy link
Owner

ka9q commented Dec 20, 2024

If you're happy with my plan to replace pcmcat with the new pcmrecord, I will probably create a short shell script named "pcmcat" that will invoke "pcmrecord" with the --stdout flag and pass along other flags. Any I should add besides maybe --raw before I close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants