argilo / gr-nrsc5

A GNU Radio implementation of HD Radio (NRSC-5)
GNU General Public License v3.0
129 stars 24 forks source link

Some Questions Regarding Usage #28

Closed secludedhusky closed 1 year ago

secludedhusky commented 2 years ago

I have been testing out this HD Radio tool for the hackrf for at least a week or two now, but I have quite a few questions regarding the usage of the tool and what I need to do to fully integrate this into "production."

My first question is I've noticed that the MP5 modes (or literally all modes other than MP1) require more than one Layer 2 encoder, which I have legitimately zero clues how exactly I would setup an MP5 HD station with 5 HD subchannels. I have tried to get it to work by messing around with the bandwidths and bitrates but I have been unable to get it to work. So more documentation on the bitrates and how to setup each mode would be beneficial.

Also, for the Program Service Display, adding the ability to encode a Long Station Name would be extremely useful for this utility in addition to the ability to encode a PTY to our stations. These two functions I feel like are a necessity for me in order to get it to work fully on the platform, as I would really enjoy being able to setup PTYs and have a long station name to play around with. I believe with your current code base this is possible to do, however I have generally no idea how to code it myself or else I would do so and make a pull request for these two features.

Additionally, I am trying to make it so that I can pull Artist and Title from a text file and have it auto update when the text file changes, similar to how I can easily do with my RDS with separate transmitters and using programs such as Airomate, StereoTool and JMPX, however I have no clue how to go about doing this in GNURadio, so a tutorial for me on how to make my artist and titles auto update in GNURadio from a text file stored on the hard drive would be beneficial.

image Currently, my setup looks like (the above attached image) and it is working well, just I have those two nitpicks in terms of how to get my instance fully working.

I would also appreciate the ability for the encoding of EAS alert messages (however I'm assuming this is impossible to do without a developer's access to a physical eas endec such as a Sage or DASDEC). Again, this is not a requirement for me in terms of my usage but I've had a significant amount of individuals ask me whether or not it could do this feature, and again, it's not outlined in the documentation.

The reason I'm making an issue post about this is because I have no general way of contacting you guys (the authors) and I want to be able to be helped in terms of my issues by the community in case this project is dead or nonrecoverable.

Thank you.

argilo commented 2 years ago

Hi @RadarFolf, and thanks for your interest in the project.

First off, I should point out that I created this project in my spare time for the fun of it, and didn't have any plans to put it into "production" use. That said, I don't see any reason it couldn't be extended to be production-ready. As you noticed, not all parts of the NRSC-5 specification are implemented at this point. Another factor that would likely get in the way of production use (at least for the next few years) is that there are several patents covering aspects of the NRSC-5 standard and the associated HDC audio codec.

My first question is I've noticed that the MP5 modes (or literally all modes other than MP1) require more than one Layer 2 encoder, which I have legitimately zero clues how exactly I would setup an MP5 HD station with 5 HD subchannels. I have tried to get it to work by messing around with the bandwidths and bitrates but I have been unable to get it to work. So more documentation on the bitrates and how to setup each mode would be beneficial.

The approximate bit rates of the logical channels are listed in table 4-1 of https://www.nrscstandards.org/standards-and-guidelines/documents/standards/nrsc-5-d/reference-docs/1011s.pdf, and the total bit rates of the HDC encoders feeding into a given Layer 2 encoder would need to be less than the available bit rate of the corresponding logical channel.

In addition, the "First prog. no." parameter of each Layer 2 encoder needs to be set to match the program number of the first PSD encoder block feeding into it, and the program numbers must all be unique.

I think that should be it, but I haven't tested modes other than MP1 in some time. There's no reason you couldn't run 5 subchannels in mode MP1, but you'd be limited to 98 kbps.

All commercial stations I have seen use either MP1 or MP3.

Also, for the Program Service Display, adding the ability to encode a Long Station Name would be extremely useful for this utility in addition to the ability to encode a PTY to our stations. These two functions I feel like are a necessity for me in order to get it to work fully on the platform, as I would really enjoy being able to setup PTYs and have a long station name to play around with. I believe with your current code base this is possible to do, however I have generally no idea how to code it myself or else I would do so and make a pull request for these two features.

As you probably noticed, only short name is implemented at present. The relevant specification is https://www.nrscstandards.org/standards-and-guidelines/documents/standards/nrsc-5-d/reference-docs/1020s.pdf, and I expect it wouldn't be too much work to add support for additional fields to the SIS encoder block (https://github.com/argilo/gr-nrsc5/blob/master/lib/sis_encoder_impl.cc).

Additionally, I am trying to make it so that I can pull Artist and Title from a text file and have it auto update when the text file changes, similar to how I can easily do with my RDS with separate transmitters and using programs such as Airomate, StereoTool and JMPX, however I have no clue how to go about doing this in GNURadio, so a tutorial for me on how to make my artist and titles auto update in GNURadio from a text file stored on the hard drive would be beneficial.

Again, this is not supported at present. The PSD encoder block currently takes "Title" and "Artist" values only at initialization time, which is of limited use. Adding one or more message inputs to the block would allow for dynamic updates. The block should probably also support other field types in addition to title and artist.

I don't have any immediate plans to add new features to gr-nrsc5, but I would happily consider pull requests if you or others want to work on improvements.

argilo commented 1 year ago

Long Station Name and dynamic updates of title & artist are now supported. See the readme & sample flow graphs for details.